From 9f1ea0f8c7fbc6ba9095082a6b4fbcb33326789d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Mi=C5=9B?= Date: Mon, 18 Jan 2021 12:39:02 +0100 Subject: [PATCH] boards: nrf5340dk: Configure RPMsg Service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds Kconfig entries to nRF5340-DK description that automatically configure RPMsg Service if it is enabled for the build. Co-authored-by: Piotr Szkotak Signed-off-by: Hubert Miś --- boards/arm/nrf5340dk_nrf5340/Kconfig | 38 ++++++++++++++++++- .../nrf5340dk_nrf5340/nrf5340_cpunet_reset.c | 17 +-------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig index f2cf86257b9..f7ab2d18a44 100644 --- a/boards/arm/nrf5340dk_nrf5340/Kconfig +++ b/boards/arm/nrf5340dk_nrf5340/Kconfig @@ -1,8 +1,44 @@ # nRF5340 (P)DK board configuration -# Copyright (c) 2019 - 2020 Nordic Semiconductor ASA +# Copyright (c) 2019 - 2021 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +config IPM_NRFX + default IPM + +config RPMSG_SERVICE_DUAL_IPM_SUPPORT + default RPMSG_SERVICE + +if RPMSG_SERVICE_DUAL_IPM_SUPPORT + +config IPM_MSG_CH_0_ENABLE + default y + +config IPM_MSG_CH_1_ENABLE + default y + +config RPMSG_SERVICE_IPM_TX_NAME + default "IPM_0" if RPMSG_SERVICE_MODE_MASTER + default "IPM_1" if RPMSG_SERVICE_MODE_REMOTE + +config RPMSG_SERVICE_IPM_RX_NAME + default "IPM_1" if RPMSG_SERVICE_MODE_MASTER + default "IPM_0" if RPMSG_SERVICE_MODE_REMOTE + +config IPM_MSG_CH_0_TX + default RPMSG_SERVICE_MODE_MASTER + +config IPM_MSG_CH_0_RX + default RPMSG_SERVICE_MODE_REMOTE + +config IPM_MSG_CH_1_TX + default RPMSG_SERVICE_MODE_REMOTE + +config IPM_MSG_CH_1_RX + default RPMSG_SERVICE_MODE_MASTER + +endif # RPMSG_SERVICE_DUAL_IPM_SUPPORT + if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPPNS || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPPNS config BOARD_ENABLE_DCDC_APP diff --git a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c index 28da9938d15..8cff522478a 100644 --- a/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c +++ b/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Nordic Semiconductor ASA. + * Copyright (c) 2019-2021 Nordic Semiconductor ASA. * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,13 +12,6 @@ LOG_MODULE_REGISTER(nrf5340pdk_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL); -/* Shared memory definitions */ -#if DT_HAS_CHOSEN(zephyr_ipc_shm) -#define SHM_NODE DT_CHOSEN(zephyr_ipc_shm) -#define SHM_BASE_ADDRESS DT_REG_ADDR(SHM_NODE) -#define SHM_SIZE DT_REG_SIZE(SHM_NODE) -#endif - #if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) /* This should come from DTS, possibly an overlay. */ @@ -83,14 +76,6 @@ static int remoteproc_mgr_boot(const struct device *dev) * this case do the remainder of actions to properly configure and * boot the Network MCU. */ -#if defined(SHM_BASE_ADDRESS) && (SHM_BASE_ADDRESS != 0) - - /* Initialize inter-processor shared memory block to zero. It is - * assumed that the application image has access to the shared - * memory at this point (see #24147). - */ - memset((void *) SHM_BASE_ADDRESS, 0, SHM_SIZE); -#endif /* Release the Network MCU, 'Release force off signal' */ NRF_RESET->NETWORK.FORCEOFF = RESET_NETWORK_FORCEOFF_FORCEOFF_Release;