Skip to content

Commit e16e630

Browse files
[nrf fromlist] soc: nordic: nrf54h: generate PERIPHCONF macros based on devicetree
Upstream PR #: 95915 Add a script that makes the build system able 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 that were broken by that move now 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 0ed780b commit e16e630

File tree

6 files changed

+2182
-0
lines changed

6 files changed

+2182
-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_PERIPHCONF_GENERATE_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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ 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_PERIPHCONF_GENERATE_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+
depends on NRF_PLATFORM_HALTIUM
18+
help
19+
Generate a C file containing PERIPHCONF entries based on the
20+
device configuration in the devicetree.

0 commit comments

Comments
 (0)