mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
firmware: Use macro instead of magic number for boot status
The boot status is currently hard-coded. Define some macros for it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
#include <sbi/sbi_scratch.h>
|
||||
#include <sbi/sbi_trap.h>
|
||||
|
||||
#define BOOT_STATUS_RELOCATE_DONE 1
|
||||
#define BOOT_STATUS_BOOT_HART_DONE 2
|
||||
|
||||
.macro MOV_3R __d0, __s0, __d1, __s1, __d2, __s2
|
||||
add \__d0, \__s0, zero
|
||||
add \__d1, \__s1, zero
|
||||
@@ -115,7 +118,7 @@ _wait_relocate_copy_done:
|
||||
add t3, t3, t1
|
||||
1:
|
||||
/* waitting for relocate copy done (_boot_status == 1) */
|
||||
li t4, 1
|
||||
li t4, BOOT_STATUS_RELOCATE_DONE
|
||||
REG_L t5, 0(t2)
|
||||
/* Reduce the bus traffic so that boot hart may proceed faster */
|
||||
nop
|
||||
@@ -127,7 +130,7 @@ _relocate_done:
|
||||
|
||||
/* mark relocate copy done */
|
||||
la t0, _boot_status
|
||||
li t1, 1
|
||||
li t1, BOOT_STATUS_RELOCATE_DONE
|
||||
REG_S t1, 0(t0)
|
||||
fence rw, rw
|
||||
|
||||
@@ -302,7 +305,7 @@ _fdt_reloc_again:
|
||||
_fdt_reloc_done:
|
||||
|
||||
/* mark boot hart done */
|
||||
li t0, 2
|
||||
li t0, BOOT_STATUS_BOOT_HART_DONE
|
||||
la t1, _boot_status
|
||||
REG_S t0, 0(t1)
|
||||
fence rw, rw
|
||||
@@ -310,7 +313,7 @@ _fdt_reloc_done:
|
||||
|
||||
/* waitting for boot hart done (_boot_status == 2) */
|
||||
_wait_for_boot_hart:
|
||||
li t0, 2
|
||||
li t0, BOOT_STATUS_BOOT_HART_DONE
|
||||
la t1, _boot_status
|
||||
REG_L t1, 0(t1)
|
||||
/* Reduce the bus traffic so that boot hart may proceed faster */
|
||||
|
Reference in New Issue
Block a user