summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-05-23 09:07:15 +0300
committerAnup Patel <anup@brainfault.org>2020-06-05 06:32:30 +0300
commit64f140830d758ebcf9d9b6ab071ae24fcc37b884 (patch)
treeca4c8a1f9c57f61f6dfbed7176e1e16a2aed7a97 /firmware
parent30b60401e1a88164d91ed0c7cccaecb17f71afd8 (diff)
downloadopensbi-64f140830d758ebcf9d9b6ab071ae24fcc37b884.tar.xz
firmware: fw_base: Make builtin DTB available to fw_platform_init()
Currently, fw_prev_arg1() is called after fw_platform_init() which caused builtin DTB to be not available to fw_platform_init(). To allow builtin DTB available to fw_platform_init(), we should call fw_save_info() and fw_prev_arg1() before fw_platform_init(). Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/fw_base.S28
1 files changed, 14 insertions, 14 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index 732bc3b..b28119a 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -177,6 +177,20 @@ _bss_zero:
li s5, (SBI_SCRATCH_SIZE * 2)
add sp, s4, s5
+ /* Allow main firmware to save info */
+ MOV_5R s0, a0, s1, a1, s2, a2, s3, a3, s4, a4
+ call fw_save_info
+ MOV_5R a0, s0, a1, s1, a2, s2, a3, s3, a4, s4
+
+ /* Override previous arg1 */
+ MOV_3R s0, a0, s1, a1, s2, a2
+ call fw_prev_arg1
+ add t1, a0, zero
+ MOV_3R a0, s0, a1, s1, a2, s2
+ beqz t1, _prev_arg1_override_done
+ add a1, t1, zero
+_prev_arg1_override_done:
+
/*
* Initialize platform
* Note: The a0 to a4 registers passed to the
@@ -186,11 +200,6 @@ _bss_zero:
call fw_platform_init
MOV_5R a0, s0, a1, s1, a2, s2, a3, s3, a4, s4
- /* Allow main firmware to save info */
- MOV_5R s0, a0, s1, a1, s2, a2, s3, a3, s4, a4
- call fw_save_info
- MOV_5R a0, s0, a1, s1, a2, s2, a3, s3, a4, s4
-
/* Preload HART details
* s7 -> HART Count
* s8 -> HART Stack Size
@@ -271,15 +280,6 @@ _scratch_init:
add t1, t1, t2
blt t1, s7, _scratch_init
- /* Override previous arg1 */
- MOV_3R s0, a0, s1, a1, s2, a2
- call fw_prev_arg1
- add t1, a0, zero
- MOV_3R a0, s0, a1, s1, a2, s2
- beqz t1, _prev_arg1_override_done
- add a1, t1, zero
-_prev_arg1_override_done:
-
/*
* Relocate Flatened Device Tree (FDT)
* source FDT address = previous arg1