xref: /openbmc/linux/arch/riscv/purgatory/entry.S (revision 6bfb56e9)
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 (lizhengyu3@huawei.com)
8 *
9 */
10
11.macro	size, sym:req
12	.size \sym, . - \sym
13.endm
14
15.text
16
17.globl purgatory_start
18purgatory_start:
19
20	lla	sp, .Lstack
21	mv	s0, a0	/* The hartid of the current hart */
22	mv	s1, a1	/* Phys address of the FDT image */
23
24	jal	purgatory
25
26	/* Start new image. */
27	mv	a0, s0
28	mv	a1, s1
29	ld	a2, riscv_kernel_entry
30	jr	a2
31
32size purgatory_start
33
34.align 4
35	.rept	256
36	.quad	0
37	.endr
38.Lstack:
39
40.data
41
42.globl riscv_kernel_entry
43riscv_kernel_entry:
44	.quad	0
45size riscv_kernel_entry
46
47.end
48