Skip to content

Commit 6b5baf9

Browse files
committed
[nrf noup] Kconfig: Add support for relocation pattern in nRF54H20
This update introduces a new configuration option to automatically calculate the Load Memory Address (LMA) adjustment for firmware relocation. If the 'fw-to-relocate' chosen node exists, the firmware will load from the MRAM partition it points to and run from the specified TCM region. Otherwise, it defaults to the standard code-partition calculation. Signed-off-by: Jan Zyczkowski <[email protected]>
1 parent de56740 commit 6b5baf9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,22 @@ config POWER_DOMAIN
1717
config CODE_DATA_RELOCATION
1818
default y if PM || POWEROFF
1919

20+
# Support for firmware relocation pattern (load from MRAM, run from TCM)
21+
# If 'fw-to-relocate' chosen node exists, use it to calculate LMA adjustment
22+
# Otherwise, fall back to standard code-partition calculation
23+
DT_CHOSEN_FW_TO_RELOCATE = fw-to-relocate
24+
DT_CHOSEN_Z_CODE = zephyr,code-partition
25+
DT_CHOSEN_Z_SRAM = zephyr,sram
26+
27+
config BUILD_OUTPUT_ADJUST_LMA
28+
default "$(dt_chosen_partition_addr_hex,$(DT_CHOSEN_FW_TO_RELOCATE)) - \
29+
$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE))" \
30+
if "$(dt_chosen_enabled,$(DT_CHOSEN_FW_TO_RELOCATE))" = "y"
31+
help
32+
Automatically calculate LMA adjustment for firmware relocation.
33+
If 'fw-to-relocate' chosen node exists, the firmware will be loaded
34+
from the MRAM partition it points to, but will run from the TCM region
35+
specified by 'zephyr,code-partition'.
36+
Otherwise, uses standard code-partition - sram calculation.
37+
2038
endif # SOC_NRF54H20_CPURAD

0 commit comments

Comments
 (0)