Skip to content

Commit

Permalink
sysbuild: Fix minor issues
Browse files Browse the repository at this point in the history
Fixes minor issues from ac93ce8.

Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
  • Loading branch information
MarkusLassila committed Nov 15, 2024
1 parent 7febb9f commit f215eab
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
52 changes: 34 additions & 18 deletions sysbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -491,27 +491,43 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake)
include_sdp()
endif()

foreach(config APPROTECT_USE_UICR APPROTECT_LOCK APPROTECT_USER_HANDLING
SECURE_APPROTECT_USE_UICR SECURE_APPROTECT_USER_HANDLING SECURE_APPROTECT_LOCK)
if(SB_CONFIG_${config})
if(SB_CONFIG_BOOTLOADER_MCUBOOT)
set_config_bool(mcuboot CONFIG_NRF_${config} y)
endif()
if(SB_CONFIG_SECURE_BOOT_APPCORE)
set_config_bool(b0 CONFIG_NRF_${config} y)
endif()
set_config_bool(${DEFAULT_IMAGE} CONFIG_NRF_${config} y)
if(SB_CONFIG_APPROTECT_USE_UICR OR SB_CONFIG_APPROTECT_LOCK OR SB_CONFIG_APPROTECT_USER_HANDLING OR
SB_CONFIG_SECURE_APPROTECT_USE_UICR OR SB_CONFIG_SECURE_APPROTECT_LOCK OR SB_CONFIG_SECURE_APPROTECT_USER_HANDLING)
# Apply APPROTECT configuration to target images
if(SB_CONFIG_APPROTECT_USE_UICR)
set(normal_approtect CONFIG_NRF_APPROTECT_USE_UICR)
elseif(SB_CONFIG_APPROTECT_LOCK)
set(normal_approtect CONFIG_NRF_APPROTECT_LOCK)
elseif(SB_CONFIG_APPROTECT_USER_HANDLING)
set(normal_approtect CONFIG_NRF_APPROTECT_USER_HANDLING)
endif()
endforeach()
if(SB_CONFIG_SUPPORT_NETCORE AND NOT SB_CONFIG_NETCORE_NONE)
foreach(config APPROTECT_USE_UICR APPROTECT_LOCK APPROTECT_USER_HANDLING)
if(SB_CONFIG_${config})
if(SB_CONFIG_SECURE_BOOT_NETCORE)
set_config_bool(b0n CONFIG_NRF_${config} y)
endif()
set_config_bool(${SB_CONFIG_NETCORE_IMAGE_NAME} CONFIG_NRF_${config} y)

if(SB_CONFIG_SECURE_APPROTECT_USE_UICR)
set(secure_approtect CONFIG_NRF_SECURE_APPROTECT_USE_UICR)
elseif(SB_CONFIG_SECURE_APPROTECT_LOCK)
set(secure_approtect CONFIG_NRF_SECURE_APPROTECT_LOCK)
elseif(SB_CONFIG_SECURE_APPROTECT_USER_HANDLING)
set(secure_approtect CONFIG_NRF_SECURE_APPROTECT_USER_HANDLING)
endif()

if(SB_CONFIG_SUPPORT_NETCORE AND NOT SB_CONFIG_NETCORE_NONE)
get_property(network_images GLOBAL PROPERTY PM_${SB_CONFIG_NETCORE_IMAGE_DOMAIN}_IMAGES)
endif()

foreach(image ${IMAGES})
if(secure_approtect AND SB_CONFIG_SUPPORT_NETCORE AND NOT SB_CONFIG_NETCORE_NONE AND ${image} IN_LIST network_images)
# Network core image
set_config_bool(${image} ${normal_approtect} y)
elseif(normal_approtect)
# Application (or other) core image
set_config_bool(${image} ${normal_approtect} y)
set_config_bool(${image} ${secure_approtect} y)
endif()
endforeach()

set(normal_approtect)
set(secure_approtect)
set(network_images)
endif()

endfunction(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake)
Expand Down
3 changes: 1 addition & 2 deletions sysbuild/Kconfig.approtect
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

choice APPROTECT_HANDLING
prompt "APPROTECT handling"
depends on SOC_SERIES_NRF52X || SOC_SERIES_NRF53X || \
SOC_SERIES_NRF91X
depends on SOC_SERIES_NRF52X || SOC_SERIES_NRF53X || SOC_SERIES_NRF91X
default APPROTECT_NO_SYSBUILD
help
Specifies how the SystemInit() function of all the images should
Expand Down

0 comments on commit f215eab

Please sign in to comment.