summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2019-08-08 11:59:31 +0300
committerAnup Patel <anup@brainfault.org>2019-08-09 10:00:08 +0300
commitb1318e578b81690d7dcc57019e3f26c2b563bd74 (patch)
tree5731b62e74254b6c38c4ca04bf007449aa146399 /firmware
parent446b6f30a44a856e81aa50684ac428f30221f4bb (diff)
downloadopensbi-b1318e578b81690d7dcc57019e3f26c2b563bd74.tar.xz
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>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/fw_base.S11
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index 225f64f..f2b1ee0 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -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 */