summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang W <wxjstz@126.com>2021-07-14 10:14:39 +0300
committerAnup Patel <anup@brainfault.org>2021-07-27 12:50:49 +0300
commit74db0acbe5de8c82cc3ae050d6bd119f33dce4cf (patch)
tree806a3acce811ab0c2785b90a7801ee8a686a6f28
parent989039117fc0181bb971acf2c934d3fba454c153 (diff)
downloadopensbi-74db0acbe5de8c82cc3ae050d6bd119f33dce4cf.tar.xz
firmware: use _fw_start for load address
The previous code uses _start as the load address, this default .entry is the first segment, using _fw_start does not need to make this assumption. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
-rw-r--r--firmware/fw_base.S6
-rw-r--r--firmware/fw_base.ldS2
2 files changed, 4 insertions, 4 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index 6baf6ab..1569e60 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -65,14 +65,14 @@ _try_lottery:
/* Save load address */
lla t0, _load_start
- lla t1, _start
+ lla t1, _fw_start
REG_S t1, 0(t0)
#ifdef FW_PIC
/* relocate the global table content */
lla t0, _link_start
REG_L t0, 0(t0)
- /* t1 shall has the address of _start */
+ /* t1 shall has the address of _fw_start */
sub t2, t1, t0
lla t3, _runtime_offset
REG_S t2, (t3)
@@ -172,7 +172,7 @@ _relocate_copy_to_upper_loop:
blt t0, t1, _relocate_copy_to_upper_loop
jr t4
_wait_relocate_copy_done:
- lla t0, _start
+ lla t0, _fw_start
lla t1, _link_start
REG_L t1, 0(t1)
beq t0, t1, _wait_for_boot_hart
diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS
index 0d222da..220c043 100644
--- a/firmware/fw_base.ldS
+++ b/firmware/fw_base.ldS
@@ -8,7 +8,7 @@
*/
. = FW_TEXT_START;
-
+ /* Don't add any section between FW_TEXT_START and _fw_start */
PROVIDE(_fw_start = .);
. = ALIGN(0x1000); /* Need this to create proper sections */