summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorHimanshu Chauhan <hchauhan@ventanamicro.com>2023-01-19 18:18:24 +0300
committerAnup Patel <anup@brainfault.org>2023-01-23 07:36:14 +0300
commitc10e3fe5f9a14de3f001a6b007b7d9f117858dff (patch)
treecea7c7990e4c2a74aa0589a9baaf357e37905433 /firmware
parent2f40a99c9e0876ac543e918191b2e06ab8a0fdc5 (diff)
downloadopensbi-c10e3fe5f9a14de3f001a6b007b7d9f117858dff.tar.xz
firmware: Add RW section offset in scratch
Add the RW section offset, provided by _fw_rw_offset symbol, to the scratch structure. This will be used to program separate pmp entry for RW section. Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/fw_base.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index 3f622b3..e04b683 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -298,6 +298,12 @@ _scratch_init:
sub a5, t3, a4
REG_S a4, SBI_SCRATCH_FW_START_OFFSET(tp)
REG_S a5, SBI_SCRATCH_FW_SIZE_OFFSET(tp)
+
+ /* Store R/W section's offset in scratch space */
+ lla a4, __fw_rw_offset
+ REG_L a5, 0(a4)
+ REG_S a5, SBI_SCRATCH_FW_RW_OFFSET(tp)
+
/* Store next arg1 in scratch space */
MOV_3R s0, a0, s1, a1, s2, a2
call fw_next_arg1
@@ -519,6 +525,8 @@ _link_start:
RISCV_PTR FW_TEXT_START
_link_end:
RISCV_PTR _fw_reloc_end
+__fw_rw_offset:
+ RISCV_PTR _fw_rw_offset
.section .entry, "ax", %progbits
.align 3