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 5cb647c
Show file tree
Hide file tree
Showing 56 changed files with 51 additions and 3,985 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
4 changes: 0 additions & 4 deletions applications/machine_learning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,3 @@ add_subdirectory(common/src/modules)
add_subdirectory(src/events)
add_subdirectory(src/modules)
add_subdirectory(src/util)

if(CONFIG_BT_HCI_IPC AND NOT SYSBUILD)
assert_exists(hci_ipc_CONF_FILE)
endif()
14 changes: 1 addition & 13 deletions applications/nrf_desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,7 @@ add_subdirectory(src/hw_interface)
add_subdirectory(src/modules)
add_subdirectory(src/util)

if(NOT SYSBUILD AND NOT CONFIG_NCS_IS_VARIANT_IMAGE)
if(CONFIG_BOOTLOADER_MCUBOOT)
assert_exists(mcuboot_CONF_FILE)
endif()
if(CONFIG_SECURE_BOOT)
assert_exists(b0_CONF_FILE)
endif()
if(CONFIG_BT_HCI_IPC)
assert_exists(hci_ipc_CONF_FILE)
endif()
endif()

if (CONFIG_IMG_MANAGER)
if(CONFIG_IMG_MANAGER)
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
endif()

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
2 changes: 1 addition & 1 deletion cmake/fw_zip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function(generate_dfu_zip)
message(FATAL_ERROR "Missing required param")
endif()

if(SYSBUILD AND GENZIP_IMAGE)
if(GENZIP_IMAGE)
set(APPNAME ${GENZIP_IMAGE})
sysbuild_get(CONFIG_BUILD_OUTPUT_META IMAGE ${GENZIP_IMAGE} VAR CONFIG_BUILD_OUTPUT_META KCONFIG)
sysbuild_get(CONFIG_BOARD IMAGE ${GENZIP_IMAGE} VAR CONFIG_BOARD KCONFIG)
Expand Down
11 changes: 2 additions & 9 deletions cmake/mesh_dfu_metadata.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
find_package(Python3 REQUIRED)

function(mesh_dfu_metadata)
if(SYSBUILD)
set(metadata_dir ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr)
else()
set(metadata_dir ${PROJECT_BINARY_DIR})
endif()

set(metadata_dir ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr)
set(metadata_depends ${CMAKE_BINARY_DIR}/dfu_application.zip)

add_custom_command(
Expand Down Expand Up @@ -42,6 +37,4 @@ function(mesh_dfu_metadata)
)
endfunction()

if(SYSBUILD)
mesh_dfu_metadata()
endif()
mesh_dfu_metadata()
Loading

0 comments on commit 5cb647c

Please sign in to comment.