Skip to content

Commit 3f19930

Browse files
jonathannilsenhakonfam
authored andcommitted
[nrf fromlist] soc: nordic: add IRONside SE compatible UICR support
Upstream PR #: 91005 Add support for generating UICR and associated artifacts in a format compatible with IRONside SE, to be used for nRF SoCs in the Haltium family. The main feature added with this is the ability to configure certain global domain peripherals that are managed by the secure domain through setting UICR.PERIPHCONF. This register points at a blob of (register address, register value) pairs which are loaded into the peripherals by IRONside SE ahead of the application boot. The added helper macros in uicr.h can be used to add register configurations to the PERIPHCONF. Entries added through these macros are then extracted by a script, post-processed and placed in a blob located at specific part of MRAM. A default PERIPHCONF configuration has been added for the nrf54h20 soc to support the standard BLE use case. Signed-off-by: Jonathan Nilsen <[email protected]>
1 parent 02161b9 commit 3f19930

File tree

11 files changed

+746
-0
lines changed

11 files changed

+746
-0
lines changed

boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,11 @@
100100
storage_partition: partition@1a8000 {
101101
reg = <0x1a8000 DT_SIZE_K(40)>;
102102
};
103+
104+
periphconf_partition: partition@1b2000 {
105+
compatible = "zephyr,memory-region";
106+
reg = <0x1b2000 DT_SIZE_K(8)>;
107+
zephyr,memory-region = "PERIPHCONF";
108+
};
103109
};
104110
};

boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@
99
#include "nrf54h20dk_nrf54h20-memory_map_iron.dtsi"
1010

1111
/delete-node/ &cpusec_cpurad_ipc;
12+
/delete-node/ &cpuapp_uicr;
13+
14+
/ {
15+
soc {
16+
uicr: uicr@fff8000 {
17+
compatible = "zephyr,memory-region", "nordic,nrf-uicr";
18+
zephyr,memory-region = "UICR";
19+
reg = <0xfff8000 DT_SIZE_K(2)>;
20+
#address-cells = <1>;
21+
#size-cells = <1>;
22+
ranges = <0x0 0xfff8000 DT_SIZE_K(2)>;
23+
24+
bicr: bicr@7b0 {
25+
compatible = "nordic,nrf-bicr";
26+
reg = <0x7b0 48>;
27+
};
28+
};
29+
};
30+
};
1231

1332
/ {
1433
chosen {

soc/nordic/common/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
add_subdirectory_ifdef(CONFIG_RISCV_CORE_NORDIC_VPR vpr)
55

6+
if((CONFIG_NRF_PERIPHCONF_SECTION OR CONFIG_NRF_HALTIUM_GENERATE_UICR))
7+
add_subdirectory(uicr)
8+
endif()
9+
610
# Let SystemInit() be called in place of soc_reset_hook() by default.
711
zephyr_linker_symbol(SYMBOL soc_reset_hook EXPR "@SystemInit@")
812

soc/nordic/common/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ source "subsys/logging/Kconfig.template.log_config"
4949
endif # MRAM_LATENCY
5050

5151
rsource "vpr/Kconfig"
52+
rsource "uicr/Kconfig"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(CONFIG_NRF_PERIPHCONF_SECTION)
5+
zephyr_linker_sources(SECTIONS uicr.ld)
6+
endif()
7+
8+
if(CONFIG_NRF_HALTIUM_GENERATE_UICR)
9+
set(uicr_hex_file ${PROJECT_BINARY_DIR}/uicr.hex)
10+
set(periphconf_hex_file ${PROJECT_BINARY_DIR}/periphconf.hex)
11+
12+
set(uicrgen_command
13+
${CMAKE_COMMAND} -E env PYTHONPATH=${ZEPHYR_BASE}/scripts/dts/python-devicetree/src
14+
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/uicrgen.py
15+
--in-config ${DOTCONFIG}
16+
--in-edt-pickle ${EDT_PICKLE}
17+
--in-periphconf-elf $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE}>
18+
--out-uicr-hex ${uicr_hex_file}
19+
--out-periphconf-hex ${periphconf_hex_file}
20+
)
21+
22+
if(CONFIG_NRF_HALTIUM_UICR_INCLUDE_IN_IMAGE)
23+
set(uicr_source_file ${PROJECT_BINARY_DIR}/uicr_generated.c)
24+
add_custom_command(
25+
OUTPUT ${uicr_hex_file} ${periphconf_hex_file} ${uicr_source_file}
26+
COMMAND ${uicrgen_command} --out-uicr-source ${uicr_source_file}
27+
DEPENDS ${ZEPHYR_LINK_STAGE_EXECUTABLE}
28+
)
29+
add_library(generate_uicr_lib OBJECT ${uicr_source_file})
30+
target_link_libraries(generate_uicr_lib PRIVATE zephyr_interface)
31+
32+
set_property(
33+
GLOBAL APPEND
34+
PROPERTY GENERATED_KERNEL_OBJECT_FILES $<TARGET_OBJECTS:generate_uicr_lib>
35+
)
36+
else()
37+
set_property(
38+
GLOBAL APPEND
39+
PROPERTY extra_post_build_commands COMMAND ${uicrgen_command}
40+
)
41+
endif()
42+
endif()

soc/nordic/common/uicr/Kconfig

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config NRF_HALTIUM_GENERATE_UICR
5+
bool "Generate UICR file"
6+
depends on SOC_NRF54H20_CPUAPP
7+
depends on SOC_NRF54H20_IRON
8+
default y
9+
help
10+
Generate UICR HEX file.
11+
12+
if NRF_HALTIUM_GENERATE_UICR
13+
14+
config NRF_HALTIUM_UICR_PERIPHCONF
15+
bool "Initialize global domain peripherals"
16+
default y
17+
depends on NRF_PERIPHCONF_SECTION
18+
help
19+
Generates a blob containing static global domain peripheral initialization
20+
values extracted from the build artifacts, and configures UICR.PERIPHCONF
21+
to point at the blob. The initialization values are then loaded ahead of
22+
ahead of the application boot.
23+
24+
config NRF_HALTIUM_UICR_INCLUDE_IN_IMAGE
25+
bool "Include UICR data in the final binary"
26+
default y
27+
help
28+
Include static values for the UICR and PERIPHCONF areas in the
29+
final binary image.
30+
31+
endif
32+
33+
config NRF_PERIPHCONF_SECTION
34+
bool "Populate global peripheral initialization section"
35+
default y if SOC_NRF54H20_CPUAPP
36+
depends on SOC_NRF54H20_IRON
37+
depends on LINKER_DEVNULL_SUPPORT
38+
imply LINKER_DEVNULL_MEMORY
39+
help
40+
Include static global domain peripheral initialization values from the
41+
build in a dedicated section in the devnull region.

0 commit comments

Comments
 (0)