Skip to content

Commit b351710

Browse files
soc: nordic: nrf54h: generate PERIPHCONF macros based on devicetree
Add a script that is used by the build system to generate macros for populating the PERIPHCONF (global domain peripheral configuration), based on nodes and properties found in the devicetree. The script does the same job as nrf-regtool did when building for nrf54h20 before the move to using IronSide SE, and should make it so all samples and tests function correctly without workarounds or manual steps. The script will also be used on nrf9280, therefore it is placed in the common uicr directory. Signed-off-by: Jonathan Nilsen <[email protected]>
1 parent 386427c commit b351710

File tree

6 files changed

+2103
-0
lines changed

6 files changed

+2103
-0
lines changed

soc/nordic/common/uicr/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44
if(CONFIG_NRF_PERIPHCONF_SECTION)
55
zephyr_linker_sources(SECTIONS uicr.ld)
66
endif()
7+
8+
if(CONFIG_NRF_HALTIUM_GENERATE_PERIPHCONF_ENTRIES)
9+
set(periphconf_entries_c_file ${PROJECT_BINARY_DIR}/periphconf_entries_generated.c)
10+
execute_process(
11+
COMMAND
12+
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/gen_periphconf_entries.py
13+
--soc ${CONFIG_SOC}
14+
--in-edt-pickle ${EDT_PICKLE}
15+
--out-periphconf-source ${periphconf_entries_c_file}
16+
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
17+
COMMAND_ERROR_IS_FATAL ANY
18+
)
19+
zephyr_sources(${periphconf_entries_c_file})
20+
message(STATUS "Generated ${periphconf_entries_c_file} from ${EDT_PICKLE}")
21+
endif()

soc/nordic/common/uicr/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ config NRF_PERIPHCONF_SECTION
99
help
1010
Include static global domain peripheral initialization values from the
1111
build in a dedicated section in the devnull region.
12+
13+
config NRF_HALTIUM_GENERATE_PERIPHCONF_ENTRIES
14+
bool "Generate PERIPHCONF entries source file"
15+
default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD
16+
depends on NRF_PERIPHCONF_SECTION
17+
help
18+
Generate a C file containing PERIPHCONF entries based on the
19+
device configuration in the devicetree.

0 commit comments

Comments
 (0)