From 680babc96f3502a64dc10a6076533b1681a81474 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Wed, 10 Apr 2024 12:34:07 +0200 Subject: [PATCH] soc: nordic: add `vpr_launcher` in sysbuild `SB_CONFIG_VPR_LAUNCHER` can now be used in building a VPR target, to enable automatic building of image that will launch the VPR. Signed-off-by: Marcin Szymczyk --- soc/nordic/Kconfig.sysbuild | 4 ++++ soc/nordic/common/vpr/Kconfig.sysbuild | 11 +++++++++ soc/nordic/sysbuild.cmake | 31 ++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 soc/nordic/Kconfig.sysbuild create mode 100644 soc/nordic/common/vpr/Kconfig.sysbuild create mode 100644 soc/nordic/sysbuild.cmake diff --git a/soc/nordic/Kconfig.sysbuild b/soc/nordic/Kconfig.sysbuild new file mode 100644 index 000000000000..f146dac821e1 --- /dev/null +++ b/soc/nordic/Kconfig.sysbuild @@ -0,0 +1,4 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +rsource "common/vpr/Kconfig.sysbuild" diff --git a/soc/nordic/common/vpr/Kconfig.sysbuild b/soc/nordic/common/vpr/Kconfig.sysbuild new file mode 100644 index 000000000000..84fbad22f26e --- /dev/null +++ b/soc/nordic/common/vpr/Kconfig.sysbuild @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config VPR_LAUNCHER + bool "VPR launcher" + default y + depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54L15_ENGA_CPUFLPR) + help + Include VPR launcher in build. + VPR launcher is a minimal sample built for an ARM core that starts given VPR core. + It is based on samples/basic/minimal with an appropriate snippet. diff --git a/soc/nordic/sysbuild.cmake b/soc/nordic/sysbuild.cmake new file mode 100644 index 000000000000..03db1a5ad18e --- /dev/null +++ b/soc/nordic/sysbuild.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if(SB_CONFIG_VPR_LAUNCHER) + set(launcher_core "cpuapp") + string(REPLACE "/" ";" launcher_quals ${BOARD_QUALIFIERS}) + list(LENGTH launcher_quals launcher_quals_len) + list(GET launcher_quals 1 launcher_soc) + list(GET launcher_quals 2 launcher_vpr) + + string(REPLACE "cpu" "" launcher_vpr ${launcher_vpr}) + + if(launcher_quals_len EQUAL 4) + list(GET launcher_quals 3 launcher_variant) + set(launcher_vpr ${launcher_vpr}-${launcher_variant}) + endif() + + string(CONCAT launcher_board ${BOARD} "/" ${launcher_soc} "/" ${launcher_core}) + + set(image "vpr_launcher") + + ExternalZephyrProject_Add( + APPLICATION ${image} + SOURCE_DIR ${ZEPHYR_BASE}/samples/basic/minimal + BOARD ${launcher_board} + ) + + string(CONCAT launcher_snippet "nordic-" ${launcher_vpr}) + + sysbuild_cache_set(VAR ${image}_SNIPPET APPEND REMOVE_DUPLICATES ${launcher_snippet}) +endif()