Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ config QEMU_UEFI_BOOT
This option indicates that QEMU will use UEFI bootable method
to boot up.

config BOARD_SUPPORT_REMOTE_ENDPOINT
bool "Board supports remote endpoint"
help
When enabled the BOARD_REMOTE variable is expected to contain the
remote endpoint as board name.

# There might not be any board options, hence the optional source
osource "$(BOARD_DIR)/Kconfig"
endmenu
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/bl5340_dvk/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ if(CONFIG_BOARD_BL5340_DVK_CPUNET)
board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000")
endif()

if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT AND CONFIG_BOARD_BL5340_DVK_CPUAPP)
set(BOARD_REMOTE "bl5340_dvk_cpunet")
endif()

include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
4 changes: 4 additions & 0 deletions boards/arm/lpcxpresso54114/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ elseif(CONFIG_BOARD_LPCXPRESSO54114_M0)
board_runner_args(jlink "--device=LPC54114J256_M0" "--reset-after-load")
endif()

if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT AND CONFIG_BOARD_LPCXPRESSO54114_M4)
set(BOARD_REMOTE "lpcxpresso54114_m0")
endif()

include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
4 changes: 4 additions & 0 deletions boards/arm/lpcxpresso55s69/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ endif()

board_runner_args(pyocd "--target=lpc55s69")

if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT AND CONFIG_BOARD_LPCXPRESSO55S69_CPU0)
set(BOARD_REMOTE "lpcxpresso55s69_cpu1")
endif()

include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
5 changes: 5 additions & 0 deletions boards/arm/mps2_an521/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ elseif (CONFIG_SOC_MPS2_AN521_CPU1)
set(QEMU_KERNEL_OPTION "-device;loader,file=${CPU0_BINARY_DIR}/zephyr.elf")
set(QEMU_EXTRA_FLAGS "-device;loader,file=${CMAKE_CURRENT_BINARY_DIR}/zephyr/zephyr.elf")
endif()

if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT AND CONFIG_BOARD_MPS2_AN521_CPU0)
set(BOARD_REMOTE "mps2_an521_remote")
set(QEMU_EXTRA_FLAGS "-device;loader,file=${REMOTE_ZEPHYR_DIR}/zephyr.elf")
endif()
4 changes: 4 additions & 0 deletions boards/arm/nrf5340dk_nrf5340/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET)
board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000")
endif()

if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT AND CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP)
set(BOARD_REMOTE "nrf5340dk_nrf5340_cpunet")
endif()

include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
4 changes: 4 additions & 0 deletions boards/arm/v2m_musca_b1/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ board_set_flasher_ifnset(pyocd)

board_runner_args(pyocd "--target=musca_b1")

if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT AND CONFIG_BOARD_MUSCA_B1)
set(BOARD_REMOTE "v2m_musca_b1_ns")
endif()

include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
34 changes: 15 additions & 19 deletions samples/drivers/mbox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,25 @@ cmake_minimum_required(VERSION 3.20.0)

set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/mbox_ipc_remote-prefix/src/mbox_ipc_remote-build/zephyr)

if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpuapp")
set(BOARD_REMOTE "nrf5340dk_nrf5340_cpunet")
else()
message(FATAL_ERROR "${BOARD} is not supported for this sample")
endif()

message(INFO " ${BOARD} compile as Main in this sample")

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(mbox_ipc)

enable_language(C ASM)

target_sources(app PRIVATE src/main.c)

include(ExternalProject)

ExternalProject_Add(
mbox_ipc_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
# NB: Do we need to pass on more CMake variables?
BUILD_ALWAYS True
)
if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT)

include(ExternalProject)

ExternalProject_Add(
mbox_ipc_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
# NB: Do we need to pass on more CMake variables?
BUILD_ALWAYS True
)

endif()
1 change: 1 addition & 0 deletions samples/drivers/mbox/prj.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
CONFIG_PRINTK=y
CONFIG_MBOX=y
CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT=y
6 changes: 0 additions & 6 deletions samples/drivers/mbox/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

cmake_minimum_required(VERSION 3.20.0)

if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpunet")
message(INFO " ${BOARD} compile as remote in this sample")
else()
message(FATAL_ERROR "${BOARD} is not supported for this sample")
endif()

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(mbox_ipc_remote)

Expand Down
38 changes: 16 additions & 22 deletions samples/subsys/ipc/ipc_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,26 @@ cmake_minimum_required(VERSION 3.20.0)

set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/ipc_service_remote-prefix/src/ipc_service_remote-build/zephyr)

if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpuapp")
set(BOARD_REMOTE "nrf5340dk_nrf5340_cpunet")
elseif("${BOARD}" STREQUAL "bl5340_dvk_cpuapp")
set(BOARD_REMOTE "bl5340_dvk_cpunet")
else()
message(FATAL_ERROR "${BOARD} is not supported for this sample")
endif()

message(INFO " ${BOARD} compile as Master in this sample")

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ipc_service)

enable_language(C ASM)

target_sources(app PRIVATE src/main.c)

include(ExternalProject)

ExternalProject_Add(
ipc_service_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
CMAKE_CACHE_ARGS -DDTC_OVERLAY_FILE:STRING=${DTC_OVERLAY_FILE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
# NB: Do we need to pass on more CMake variables?
BUILD_ALWAYS True
)
if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT)

include(ExternalProject)

ExternalProject_Add(
ipc_service_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
CMAKE_CACHE_ARGS -DDTC_OVERLAY_FILE:STRING=${DTC_OVERLAY_FILE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
# NB: Do we need to pass on more CMake variables?
BUILD_ALWAYS True
)

endif()
2 changes: 2 additions & 0 deletions samples/subsys/ipc/ipc_service/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ CONFIG_IPC_SERVICE_BACKEND_RPMSG_MI_NUM_INSTANCES=2

CONFIG_LOG=y
CONFIG_IPC_SERVICE_LOG_LEVEL_INF=y

CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT=y
7 changes: 0 additions & 7 deletions samples/subsys/ipc/ipc_service/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@

cmake_minimum_required(VERSION 3.20.0)

if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpunet"
OR "${BOARD}" STREQUAL "bl5340_dvk_cpunet")
message(INFO " ${BOARD} compile as slave in this sample")
else()
message(FATAL_ERROR "${BOARD} is not supported for this sample")
endif()

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ipc_service_remote)

Expand Down
41 changes: 18 additions & 23 deletions samples/subsys/ipc/ipm_mcux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
cmake_minimum_required(VERSION 3.20.0)
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/ipm_mcux_remote-prefix/src/ipm_mcux_remote-build/zephyr)

if("${BOARD}" STREQUAL "lpcxpresso54114_m4")
set(BOARD_REMOTE "lpcxpresso54114_m0")
elseif("${BOARD}" STREQUAL "lpcxpresso55s69_cpu0")
set(BOARD_REMOTE "lpcxpresso55s69_cpu1")
else()
message(FATAL_ERROR "${BOARD} was not supported for this sample")
endif()
cmake_minimum_required(VERSION 3.20.0)

message(INFO " ${BOARD} compile as Master in this sample")
set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/ipm_mcux_remote-prefix/src/ipm_mcux_remote-build/zephyr)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ipm_mcux)
Expand All @@ -23,18 +14,22 @@ enable_language(C ASM)

target_sources(app PRIVATE src/main_master.c)

include(ExternalProject)
if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT)

include(ExternalProject)

ExternalProject_Add(
ipm_mcux_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
CMAKE_CACHE_ARGS -DDTC_OVERLAY_FILE:STRING=${DTC_OVERLAY_FILE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
BUILD_ALWAYS True
)
ExternalProject_Add(
ipm_mcux_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
CMAKE_CACHE_ARGS -DDTC_OVERLAY_FILE:STRING=${DTC_OVERLAY_FILE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
BUILD_ALWAYS True
)

add_dependencies(second_core_inc_target ipm_mcux_remote)
add_dependencies(second_core_inc_target ipm_mcux_remote)

target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

endif()
1 change: 1 addition & 0 deletions samples/subsys/ipc/ipm_mcux/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CONFIG_SECOND_CORE_MCUX=y
CONFIG_SECOND_IMAGE_MCUX="${ZEPHYR_BINARY_DIR}/../ipm_mcux_remote-prefix/src/ipm_mcux_remote-build/zephyr/${KERNEL_BIN_NAME}"
CONFIG_TIMESLICE_SIZE=1
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT=y
8 changes: 1 addition & 7 deletions samples/subsys/ipc/ipm_mcux/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
cmake_minimum_required(VERSION 3.20.0)
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

if(("${BOARD}" STREQUAL "lpcxpresso54114_m0")
OR "${BOARD}" STREQUAL "lpcxpresso55s69_cpu1")
message(INFO " ${BOARD} compiles as remote in this sample")
else()
message(FATAL_ERROR "${BOARD} was not supported for this sample")
endif()
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ipm_mcux_remote)
Expand Down
46 changes: 18 additions & 28 deletions samples/subsys/ipc/openamp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
cmake_minimum_required(VERSION 3.20.0)
# Copyright (c) 2018 Nordic Semiconductor ASA
# Copyright (c) 2019 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/openamp_remote-prefix/src/openamp_remote-build/zephyr)

if("${BOARD}" STREQUAL "lpcxpresso54114_m4")
set(BOARD_REMOTE "lpcxpresso54114_m0")
elseif("${BOARD}" STREQUAL "lpcxpresso55s69_cpu0")
set(BOARD_REMOTE "lpcxpresso55s69_cpu1")
elseif("${BOARD}" STREQUAL "mps2_an521")
set(QEMU_EXTRA_FLAGS "-device;loader,file=${REMOTE_ZEPHYR_DIR}/zephyr.elf")
set(BOARD_REMOTE "mps2_an521_remote")
elseif("${BOARD}" STREQUAL "v2m_musca_b1")
set(BOARD_REMOTE "v2m_musca_b1_ns")
else()
message(FATAL_ERROR "${BOARD} was not supported for this sample")
endif()
cmake_minimum_required(VERSION 3.20.0)

message(INFO " ${BOARD} compile as Master in this sample")
set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/openamp_remote-prefix/src/openamp_remote-build/zephyr)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(openamp)
Expand All @@ -29,17 +15,21 @@ enable_language(C ASM)

target_sources(app PRIVATE src/main.c)

include(ExternalProject)
if(CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT)

include(ExternalProject)

ExternalProject_Add(
openamp_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
CMAKE_CACHE_ARGS -DDTC_OVERLAY_FILE:STRING=${DTC_OVERLAY_FILE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
# NB: Do we need to pass on more CMake variables?
BUILD_ALWAYS True
)
ExternalProject_Add(
openamp_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
CMAKE_CACHE_ARGS -DDTC_OVERLAY_FILE:STRING=${DTC_OVERLAY_FILE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
# NB: Do we need to pass on more CMake variables?
BUILD_ALWAYS True
)

target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

endif()
1 change: 1 addition & 0 deletions samples/subsys/ipc/openamp/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CONFIG_MAIN_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_OPENAMP=y
CONFIG_OPENAMP_SLAVE=n
CONFIG_BOARD_SUPPORT_REMOTE_ENDPOINT=y
10 changes: 1 addition & 9 deletions samples/subsys/ipc/openamp/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
cmake_minimum_required(VERSION 3.20.0)
# Copyright (c) 2018 Nordic Semiconductor ASA
# Copyright (c) 2019 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

if(("${BOARD}" STREQUAL "lpcxpresso54114_m0")
OR "${BOARD}" STREQUAL "lpcxpresso55s69_cpu1"
OR "${BOARD}" STREQUAL "mps2_an521_remote"
OR "${BOARD}" STREQUAL "v2m_musca_b1_ns")
message(INFO " ${BOARD} compiles as remote in this sample")
else()
message(FATAL_ERROR "${BOARD} was not supported for this sample")
endif()
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(openamp_remote)
Expand Down
Loading