Skip to content

Commit b91a4cf

Browse files
committed
suit: Remove SoC name from MCI symbols
Use CMake to select MCI implementation, based on the SoC. Use Kconfig to enable SDFW (common for all nordic platforms) or custom implementation. Refactor one of the tests to allow for such change. Ref: NCSDK-NONE Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 085e5a6 commit b91a4cf

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

subsys/suit/mci/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ target_link_libraries(suit_mci INTERFACE suit_platform_err)
1111
target_link_libraries(suit_mci INTERFACE suit_metadata)
1212

1313
zephyr_library()
14-
zephyr_library_sources_ifdef(CONFIG_SUIT_MCI_IMPL_NRF54H20_SDFW src/suit_mci_nrf54h20.c)
14+
if(CONFIG_SUIT_MCI_IMPL_SDFW)
15+
zephyr_library_sources(src/suit_mci_${CONFIG_SOC}.c)
16+
endif()
1517
zephyr_library_sources(src/suit_generic_ids.c)
1618

1719
zephyr_library_link_libraries(suit_mci)

subsys/suit/mci/Kconfig

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ menuconfig SUIT_MCI
1111

1212
if SUIT_MCI
1313

14+
config SUPPORT_SUIT_MCI_IMPL_SDFW
15+
bool
16+
default y if SOC_SERIES_NRF54HX
17+
1418
choice SUIT_MCI_IMPL
1519
prompt "MCI implementation"
16-
default SUIT_MCI_IMPL_NRF54H20_SDFW if SOC_SERIES_NRF54HX
17-
default SUIT_MCI_IMPL_CUSTOM if !SOC_SERIES_NRF54HX
20+
default SUIT_MCI_IMPL_SDFW if SUPPORT_SUIT_MCI_IMPL_SDFW
21+
default SUIT_MCI_IMPL_CUSTOM
1822

19-
config SUIT_MCI_IMPL_NRF54H20_SDFW
20-
bool "nRF54H20: Secure domain"
23+
config SUIT_MCI_IMPL_SDFW
24+
bool "Secure domain"
2125
depends on SUIT_PLATFORM_VARIANT_SDFW
26+
depends on SUPPORT_SUIT_MCI_IMPL_SDFW
2227

2328
config SUIT_MCI_IMPL_CUSTOM
2429
bool "custom"

tests/subsys/suit/cmake/test_template.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ if (CONFIG_64BIT)
2323
set(bit_arg -b 64)
2424
endif()
2525

26+
set(SUIT_SUBSYS_DIR ${ZEPHYR_NRF_MODULE_DIR}/subsys/suit)
27+
2628
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../common" "${PROJECT_BINARY_DIR}/test_common")
2729
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../mocks" "${PROJECT_BINARY_DIR}/test_mocks")

tests/subsys/suit/component_compatibility_check/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
1111
project(integration_suit_component_compatibility_check)
1212
include(../cmake/test_template.cmake)
1313

14+
target_include_directories(app PRIVATE
15+
${SUIT_SUBSYS_DIR}/mci//include
16+
)
17+
18+
target_sources(app PRIVATE
19+
# Use nRF54H20-specific MCI implementation.
20+
${SUIT_SUBSYS_DIR}/mci/src/suit_mci_nrf54h20.c
21+
${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_component_compatibility.c
22+
)
23+
1424
# Link with the CMake target, that includes SUIT platform internal APIs header
1525
zephyr_library_link_libraries(suit_utils)
16-
zephyr_library_link_libraries(suit_mci)
1726
zephyr_library_link_libraries(suit_storage_interface)
1827
zephyr_library_link_libraries(suit_platform_interface)

tests/subsys/suit/component_compatibility_check/prj.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@ CONFIG_SUIT_MEMPTR_STORAGE=y
1414
# Enable component-compatibility checks
1515
CONFIG_SUIT_PLATFORM=y
1616
CONFIG_SUIT_PLATFORM_VARIANT_SDFW=y
17-
CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y
1817

1918
# Force SUIT storage memory layout to match nRF54H20-specific implementation.
2019
CONFIG_SUIT_STORAGE=y
2120
CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20=y
2221
CONFIG_SUIT_METADATA=y
2322
# nRF54H20 storage uses SHA-256 to protect MPI and NVVs:
2423
CONFIG_SUIT_CRYPTO=y
25-
26-
# Use nRF54H20-specific MCI implementation.
27-
CONFIG_SUIT_MCI=y
28-
CONFIG_SUIT_MCI_IMPL_NRF54H20_SDFW=y
2924
CONFIG_SUIT_EXECUTION_MODE=y
3025

3126
CONFIG_ZCBOR=y

0 commit comments

Comments
 (0)