diff options
author | Xiang W <wxjstz@126.com> | 2024-03-04 20:15:51 +0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2024-03-09 18:14:46 +0530 |
commit | 8151105af5e4bd5d2a17fe0babd6cff3b36496fb (patch) | |
tree | b607832092ce8b43ae5cfb9c09b092dfdbab4086 /firmware | |
parent | 187397fd65570de547f3b7d49455855dd18dfff5 (diff) | |
download | opensbi-8151105af5e4bd5d2a17fe0babd6cff3b36496fb.zip opensbi-8151105af5e4bd5d2a17fe0babd6cff3b36496fb.tar.gz opensbi-8151105af5e4bd5d2a17fe0babd6cff3b36496fb.tar.bz2 |
firmware: fw_base.S: Remove _relocate_lottery
Remove _relocate_lottery and use _boot_status instead.
Signed-off-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/fw_base.S | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S index d87c0a5..d83397e 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -14,8 +14,9 @@ #include <sbi/sbi_scratch.h> #include <sbi/sbi_trap.h> -#define BOOT_STATUS_RELOCATE_DONE 1 -#define BOOT_STATUS_BOOT_HART_DONE 2 +#define BOOT_STATUS_LOTTERY_DONE 1 +#define BOOT_STATUS_RELOCATE_DONE 2 +#define BOOT_STATUS_BOOT_HART_DONE 3 .macro MOV_3R __d0, __s0, __d1, __s1, __d2, __s2 add \__d0, \__s0, zero @@ -58,9 +59,9 @@ _start: bne a0, a6, _wait_relocate_copy_done _try_lottery: /* Jump to relocation wait loop if we don't get relocation lottery */ - lla a6, _relocate_lottery - li a7, 1 - amoadd.w a6, a7, (a6) + lla a6, _boot_status + li a7, BOOT_STATUS_LOTTERY_DONE + amoswap.w a6, a7, (a6) bnez a6, _wait_relocate_copy_done #ifdef FW_PIC @@ -101,8 +102,6 @@ _relocate: blt t2, t0, _relocate_copy_to_upper _relocate_copy_to_lower: ble t1, t2, _relocate_copy_to_lower_loop - lla t3, _relocate_lottery - BRANGE t2, t1, t3, _start_hang lla t3, _boot_status BRANGE t2, t1, t3, _start_hang lla t3, _relocate @@ -119,8 +118,6 @@ _relocate_copy_to_lower_loop: jr t4 _relocate_copy_to_upper: ble t3, t0, _relocate_copy_to_upper_loop - lla t2, _relocate_lottery - BRANGE t0, t3, t2, _start_hang lla t2, _boot_status BRANGE t0, t3, t2, _start_hang lla t2, _relocate @@ -474,8 +471,6 @@ _skip_trap_handler_rv32_hyp: .data .align 3 -_relocate_lottery: - RISCV_PTR 0 _boot_status: RISCV_PTR 0 |