diff options
| author | Anup Patel <[email protected]> | 2019-11-06 16:24:35 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2019-11-15 17:41:18 +0530 |
| commit | 7a13beb213266cbf6f15ddbbef5bfca274086bd3 (patch) | |
| tree | 31feb9270d13674ef8134618729a06ea269d46eb /firmware/fw_base.S | |
| parent | 18897aaf5d0382017c05a5690d0bc8e0d044270f (diff) | |
firmware: Add preferred boot HART field in struct fw_dynamic_info
It has been reported that link address range of previous booting stage
(such as U-Boot SPL) can overlap the link address rage of FW_DYNAMIC.
This means self-relocation in FW_DYNAMIC can potentially corrupt
previous booting stage if any of the secondary HART enter FW_DYNAMIC
before primary HART.
To tackle this, we add preferred boot HART field (i.e boot_hart) in
struct fw_dyanmic_info. We use this field to force secondary HARTs
into relocation wait loop till preferred/primary boot HART enters
FW_DYNAMIC completes self-relocation. If preferred boot HART is not
available then we fall back to relocation lottery approach.
Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'firmware/fw_base.S')
| -rw-r--r-- | firmware/fw_base.S | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S index 375c1583..0797cc00 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -46,6 +46,16 @@ .globl _start .globl _start_warm _start: + /* Find preferred boot HART id */ + MOV_3R s0, a0, s1, a1, s2, a2 + call fw_boot_hart + add a6, a0, zero + MOV_3R a0, s0, a1, s1, a2, s2 + li a7, -1 + beq a6, a7, _try_lottery + /* Jump to relocation wait loop if we are not boot hart */ + bne a0, a6, _wait_relocate_copy_done +_try_lottery: /* Jump to relocation wait loop if we don't get relocation lottery */ la a6, _relocate_lottery li a7, 1 |
