Skip to content

Commit

Permalink
[nrf fromlist] soc: nordic: nrf54h: add BICR generation tooling
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
gmarull committed Nov 28, 2024
1 parent bf60e88 commit 117398e
Show file tree
Hide file tree
Showing 6 changed files with 1,158 additions and 0 deletions.
1 change: 1 addition & 0 deletions soc/nordic/nrf54h/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_NO_MRAM_LATENCY mram.c)
# for the image correctly
zephyr_linker_sources(SECTIONS SORT_KEY zzz_place_align_at_end align.ld)

add_subdirectory(bicr)
add_subdirectory(gpd)
1 change: 1 addition & 0 deletions soc/nordic/nrf54h/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ config SOC_NRF54H20_CPUPPR
config SOC_NRF54H20_CPUFLPR
depends on RISCV_CORE_NORDIC_VPR

rsource "bicr/Kconfig"
rsource "gpd/Kconfig"

config SOC_NRF54H20_NO_MRAM_LATENCY
Expand Down
21 changes: 21 additions & 0 deletions soc/nordic/nrf54h/bicr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if(CONFIG_SOC_NRF54H20_GENERATE_BICR)
set(bicr_json_file ${BOARD_DIR}/bicr.json)
set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex)
set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd)

if(EXISTS ${bicr_json_file})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${bicr_json_file})

execute_process(
COMMAND
${Python3_EXECUTABLE}
${CMAKE_CURRENT_LIST_DIR}/bicrgen.py
--svd ${svd_file}
--input ${bicr_json_file}
--output ${bicr_hex_file}
WORKING_DIRECTORY ${BOARD_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
message(STATUS "Generated BICR hex file: ${bicr_hex_file}")
endif()
endif()
10 changes: 10 additions & 0 deletions soc/nordic/nrf54h/bicr/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0

config SOC_NRF54H20_GENERATE_BICR
bool "Generate nRF54H20 BICR file"
depends on SOC_NRF54H20_CPUAPP
default y
help
This option generates a BICR file for the board being used. Board
directory must contain a "bicr.json" file for this option to work.
Loading

0 comments on commit 117398e

Please sign in to comment.