diff options
| author | Himanshu Chauhan <[email protected]> | 2023-01-19 20:48:22 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-01-23 10:06:14 +0530 |
| commit | fefa5488038584a6376a8f361e74ccc2183dd50b (patch) | |
| tree | 28820c8d36a8d4029aceb2c7889de2a8d6bee3d6 | |
| parent | a990309fa362aa050caf7fb175f35c7bfa486ccc (diff) | |
firmware: Split RO/RX and RW sections
Split the RO/RX and RW sections so that they can have
independent pmp entries with required permissions. The
split size is ensured to be a power-of-2 as required by
pmp.
_fw_rw_offset symbol marks the beginning of the data
section.
Signed-off-by: Himanshu Chauhan <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
| -rw-r--r-- | firmware/fw_base.ldS | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS index 563ae252..5411bbdc 100644 --- a/firmware/fw_base.ldS +++ b/firmware/fw_base.ldS @@ -42,6 +42,14 @@ . = ALIGN(0x1000); /* Ensure next section is page aligned */ + /* + * PMP regions must be to be power-of-2. RO/RW will have separate + * regions, so ensure that the split is power-of-2. + */ + . = ALIGN(1 << LOG2CEIL(SIZEOF(.rodata) + SIZEOF(.text))); + + PROVIDE(_fw_rw_offset = (. - _fw_start)); + /* Beginning of the read-write data sections */ .data : |
