Skip to content

Commit

Permalink
treewide: Remove child/parent image support
Browse files Browse the repository at this point in the history
Removes support for child/parent image

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
nordicjm committed Dec 5, 2024
1 parent d8069dd commit ee39911
Show file tree
Hide file tree
Showing 45 changed files with 40 additions and 3,725 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ endforeach()
include(cmake/extensions.cmake)
include(cmake/version.cmake)
include(cmake/version_app.cmake)
include(cmake/multi_image.cmake)
include(cmake/sdp.cmake)

zephyr_include_directories(include)
Expand Down
6 changes: 0 additions & 6 deletions Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ endif # BUILD_WITH_TFM

menu "Nordic nRF Connect"

# Hides child parent configuration options
config HIDE_CHILD_PARENT_CONFIG
bool
default y if "$(HIDE_CHILD_PARENT_CONFIG)" = "True"
default n

# Override configuration from zephyr which sets this to 0x200 if MCUboot is
# enabled (CONFIG_BOOTLOADER_MCUBOOT), since NCS use partition_manager to
# get this offset intsead.
Expand Down
3 changes: 0 additions & 3 deletions boards/nordic/thingy91x/Kconfig.defconfig.nrf5340
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ config SECURE_BOOT
config BOOTLOADER_MCUBOOT
default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

config ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS
default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

config NRF53_UPGRADE_NETWORK_CORE
default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

Expand Down
87 changes: 6 additions & 81 deletions cmake/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,6 @@ function(get_board_without_ns_suffix board_in board_out)
endif()
endfunction()

# Add an overlay file to a child image.
# This can be used by a parent image to set overlay of Kconfig configuration or devicetree
# in its child images. This function must be called before 'add_child_image(image)'
# to have effect.
#
# Parameters:
# 'image' - child image name
# 'overlay_file' - overlay to be added to child image
# 'overlay_type' - 'OVERLAY_CONFIG' or 'DTC_OVERLAY_FILE'
function(add_overlay image overlay_file overlay_type)
set(old_overlays ${${image}_${overlay_type}})
string(FIND "${old_overlays}" "${overlay_file}" found)
if (${found} EQUAL -1)
set(${image}_${overlay_type} "${old_overlays};${overlay_file}" CACHE STRING
"Extra config fragments for ${image} child image" FORCE
)
endif()
endfunction()

# Convenience macro to add configuration overlays to child image.
macro(add_overlay_config image overlay_file)
add_overlay(${image} ${overlay_file} EXTRA_CONF_FILE)
endmacro()

# Convenience macro to add device tree overlays to child image.
macro(add_overlay_dts image overlay_file)
add_overlay(${image} ${overlay_file} EXTRA_DTC_OVERLAY_FILE)
endmacro()

# Add a partition manager configuration file to the build.
# Note that is only one image is included in the build,
# you must set CONFIG_PM_SINGLE_IMAGE=y for the partition manager
Expand Down Expand Up @@ -353,59 +324,13 @@ function(set_shared)
set(multi_args "PROPERTY")
cmake_parse_arguments(SHARE "${flags}" "${single_args}" "${multi_args}" ${ARGN})

if(SYSBUILD)
# Sysbuild can read the cache directly, no reason for an extra share file.
list(POP_FRONT SHARE_PROPERTY listname)
if(SHARE_APPEND)
list(APPEND ${listname} ${SHARE_PROPERTY})
list(REMOVE_DUPLICATES ${listname})
set(SHARE_PROPERTY ${${listname}})
endif()
set(${listname} "${SHARE_PROPERTY}" CACHE INTERNAL "shared var")
return()
endif()

check_arguments_required("set_shared" SHARE IMAGE FILE)

check_arguments_exclusive("set_shared" SHARE FILE IMAGE PROPERTY APPEND)
check_arguments_exclusive("set_shared" SHARE IMAGE FILE)


set(prop_target ${IMAGE_NAME}_shared_property_target)
if(NOT TARGET ${prop_target})
add_custom_target(${prop_target})
endif()

if(DEFINED SHARE_IMAGE)
# When using IMAGE, then PROPERTY is also required.
check_arguments_required("set_shared" SHARE PROPERTY)

set(share_prop_target ${SHARE_IMAGE}_shared_property_target)

if(SHARE_APPEND)
set(SHARE_APPEND APPEND)
else()
set(SHARE_APPEND)
endif()

get_property(string_targets TARGET ${prop_target} PROPERTY image_targets)
if(NOT "add_custom_target(${share_prop_target})" IN_LIST string_targets)
set_property(
TARGET ${prop_target} APPEND PROPERTY
image_targets "add_custom_target(${share_prop_target})"
)
endif()

set_property(TARGET ${prop_target} APPEND_STRING PROPERTY shared_vars
"set_property(TARGET ${share_prop_target} ${SHARE_APPEND} PROPERTY ${SHARE_PROPERTY})\n"
)
endif()

if(DEFINED SHARE_FILE)
set_property(TARGET ${prop_target} APPEND_STRING PROPERTY shared_vars
"include(${SHARE_FILE})\n"
)
list(POP_FRONT SHARE_PROPERTY listname)
if(SHARE_APPEND)
list(APPEND ${listname} ${SHARE_PROPERTY})
list(REMOVE_DUPLICATES ${listname})
set(SHARE_PROPERTY ${${listname}})
endif()
set(${listname} "${SHARE_PROPERTY}" CACHE INTERNAL "shared var")
endfunction()

# generate_shared(IMAGE <img> FILE <file>)
Expand Down
Loading

0 comments on commit ee39911

Please sign in to comment.