1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * purgatory: Runs between two kernels
4 *
5 * Copyright (C) 2022 Huawei Technologies Co, Ltd.
6 *
7 * Author: Li Zhengyu ([email protected])
8 *
9 */
10#include <asm/asm.h>
11#include <linux/linkage.h>
12
13.text
14
15.align	2
16SYM_CODE_START(purgatory_start)
17
18	lla	sp, .Lstack
19	mv	s0, a0	/* The hartid of the current hart */
20	mv	s1, a1	/* Phys address of the FDT image */
21
22	jal	purgatory
23
24	/* Start new image. */
25	mv	a0, s0
26	mv	a1, s1
27	ld	a2, riscv_kernel_entry
28	jr	a2
29SYM_CODE_END(purgatory_start)
30
31.align 4
32	.rept	256
33	.quad	0
34	.endr
35.Lstack:
36
37.data
38
39.align LGREG
40SYM_DATA(riscv_kernel_entry, .quad 0)
41
42.end
43