Skip to content

Commit f9d56f5

Browse files
committed
[nrf fromtree] soc: nordic: Add snapshot region support in UICR
Add snapshot region support in UICR. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no> (cherry picked from commit 28dfa43)
1 parent 63a4e27 commit f9d56f5

3 files changed

Lines changed: 69 additions & 0 deletions

File tree

soc/nordic/common/uicr/Kconfig.gen_uicr

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,4 +404,36 @@ config GEN_UICR_POLICY_MPCCONF_STAGE_VALUE
404404
default 0x1730C77F if GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL
405405
default 0
406406

407+
config GEN_UICR_SNAPSHOT_REGIONS
408+
bool "UICR.SNAPSHOT.REGIONS"
409+
depends on SOC_SERIES_NRF54H
410+
help
411+
When enabled, the UICR generator will configure the snapshot regions
412+
specified in Kconfig.
413+
414+
if GEN_UICR_SNAPSHOT_REGIONS
415+
416+
index = 0
417+
rsource "Kconfig.template.gen_uicr_snapshot_region"
418+
419+
index = 1
420+
rsource "Kconfig.template.gen_uicr_snapshot_region"
421+
422+
index = 2
423+
rsource "Kconfig.template.gen_uicr_snapshot_region"
424+
425+
index = 3
426+
rsource "Kconfig.template.gen_uicr_snapshot_region"
427+
428+
index = 4
429+
rsource "Kconfig.template.gen_uicr_snapshot_region"
430+
431+
index = 5
432+
rsource "Kconfig.template.gen_uicr_snapshot_region"
433+
434+
index = 6
435+
rsource "Kconfig.template.gen_uicr_snapshot_region"
436+
437+
endif # GEN_UICR_SNAPSHOT_REGIONS
438+
407439
endmenu
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2026 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config GEN_UICR_SNAPSHOT_REGION_$(index)
5+
bool "UICR.SNAPSHOT region"
6+
depends on GEN_UICR_SNAPSHOT_REGIONS
7+
help
8+
When enabled, configures a UICR.SNAPSHOT region.
9+
10+
config GEN_UICR_SNAPSHOT_REGION_$(index)_ADDRESS
11+
hex "UICR.SNAPSHOT region start address"
12+
range 0x0e030000 0x0e1ff000
13+
depends on GEN_UICR_SNAPSHOT_REGION_$(index)
14+
help
15+
UICR.SNAPSHOT region start address. Must be aligned to a 1 KB boundary.
16+
17+
config GEN_UICR_SNAPSHOT_REGION_$(index)_SIZE_BYTES
18+
int "UICR.SNAPSHOT region size in bytes"
19+
range 1024 1048576
20+
depends on GEN_UICR_SNAPSHOT_REGION_$(index)
21+
help
22+
Size of the snapshot region in bytes. Must be a multiple of 1024.

soc/nordic/common/uicr/gen_uicr/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ set(eraseprotect_args)
8888
set(approtect_args)
8989
set(protectedmem_args)
9090
set(periphconf_args)
91+
set(snapshot_args)
9192
set(mpcconf_args)
9293
set(wdtstart_args)
9394
set(periphconf_elfs)
@@ -364,6 +365,19 @@ if(CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_MPCCONF_S
364365
list(APPEND policy_args --policy-mpcconf-stage ${CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_VALUE})
365366
endif()
366367

368+
# Handle SNAPSHOT configuration (indices 0..6 match Kconfig.template.gen_uicr_snapshot_region)
369+
if(CONFIG_GEN_UICR_SNAPSHOT_REGIONS)
370+
foreach(snapshot_region_idx RANGE 0 6)
371+
if(CONFIG_GEN_UICR_SNAPSHOT_REGION_${snapshot_region_idx})
372+
list(APPEND snapshot_args
373+
--snapshot-region
374+
${CONFIG_GEN_UICR_SNAPSHOT_REGION_${snapshot_region_idx}_ADDRESS}
375+
${CONFIG_GEN_UICR_SNAPSHOT_REGION_${snapshot_region_idx}_SIZE_BYTES}
376+
)
377+
endif()
378+
endforeach()
379+
endif()
380+
367381
set(periphconf_check_base_cmd
368382
${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE}
369383
${PYTHON_EXECUTABLE} ${IRONSIDE_SUPPORT_DIR}/se/tool/ironside/__main__.py
@@ -448,6 +462,7 @@ add_custom_command(
448462
${protectedmem_args}
449463
${secondary_args}
450464
${policy_args}
465+
${snapshot_args}
451466
${periphconf_validate_build_command}
452467
${secondary_periphconf_validate_build_command}
453468
DEPENDS ${gen_uicr_depends}

0 commit comments

Comments
 (0)