entry.S 635 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include <asm/asm.h>
  11. #include <linux/linkage.h>
  12. .text
  13. SYM_CODE_START(purgatory_start)
  14. lla sp, .Lstack
  15. mv s0, a0 /* The hartid of the current hart */
  16. mv s1, a1 /* Phys address of the FDT image */
  17. jal purgatory
  18. /* Start new image. */
  19. mv a0, s0
  20. mv a1, s1
  21. ld a2, riscv_kernel_entry
  22. jr a2
  23. SYM_CODE_END(purgatory_start)
  24. .align 4
  25. .rept 256
  26. .quad 0
  27. .endr
  28. .Lstack:
  29. .data
  30. .align LGREG
  31. SYM_DATA(riscv_kernel_entry, .quad 0)
  32. .end