Skip to content

Commit 117398e

Browse files
committed
[nrf fromlist] soc: nordic: nrf54h: add BICR generation tooling
Add supporting scripts and build-system integration for BICR (Board Information Configuration Registers) generation. Upstream PR #: 81604 Signed-off-by: Gerard Marull-Paretas <[email protected]> (cherry picked from commit 2c4bdd33a0b87e6d5f9c58a59fd3ca554e03366b)
1 parent bf60e88 commit 117398e

File tree

6 files changed

+1158
-0
lines changed

6 files changed

+1158
-0
lines changed

soc/nordic/nrf54h/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_NO_MRAM_LATENCY mram.c)
1818
# for the image correctly
1919
zephyr_linker_sources(SECTIONS SORT_KEY zzz_place_align_at_end align.ld)
2020

21+
add_subdirectory(bicr)
2122
add_subdirectory(gpd)

soc/nordic/nrf54h/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ config SOC_NRF54H20_CPUPPR
6464
config SOC_NRF54H20_CPUFLPR
6565
depends on RISCV_CORE_NORDIC_VPR
6666

67+
rsource "bicr/Kconfig"
6768
rsource "gpd/Kconfig"
6869

6970
config SOC_NRF54H20_NO_MRAM_LATENCY
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
if(CONFIG_SOC_NRF54H20_GENERATE_BICR)
2+
set(bicr_json_file ${BOARD_DIR}/bicr.json)
3+
set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex)
4+
set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd)
5+
6+
if(EXISTS ${bicr_json_file})
7+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${bicr_json_file})
8+
9+
execute_process(
10+
COMMAND
11+
${Python3_EXECUTABLE}
12+
${CMAKE_CURRENT_LIST_DIR}/bicrgen.py
13+
--svd ${svd_file}
14+
--input ${bicr_json_file}
15+
--output ${bicr_hex_file}
16+
WORKING_DIRECTORY ${BOARD_DIR}
17+
COMMAND_ERROR_IS_FATAL ANY
18+
)
19+
message(STATUS "Generated BICR hex file: ${bicr_hex_file}")
20+
endif()
21+
endif()

soc/nordic/nrf54h/bicr/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2024 Nordic Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_NRF54H20_GENERATE_BICR
5+
bool "Generate nRF54H20 BICR file"
6+
depends on SOC_NRF54H20_CPUAPP
7+
default y
8+
help
9+
This option generates a BICR file for the board being used. Board
10+
directory must contain a "bicr.json" file for this option to work.

0 commit comments

Comments
 (0)