diff --git a/boards/arm/bl5340_dvk/Kconfig b/boards/arm/bl5340_dvk/Kconfig index 6079bcd7e5c..55209815679 100644 --- a/boards/arm/bl5340_dvk/Kconfig +++ b/boards/arm/bl5340_dvk/Kconfig @@ -7,6 +7,9 @@ config IPM_NRFX default IPM +config MBOX_NRFX_IPC + default MBOX + config RPMSG_SERVICE_DUAL_IPM_SUPPORT default RPMSG_SERVICE diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig index 0c9a6a7143e..b9b23a85612 100644 --- a/boards/arm/nrf5340dk_nrf5340/Kconfig +++ b/boards/arm/nrf5340dk_nrf5340/Kconfig @@ -6,6 +6,9 @@ config IPM_NRFX default IPM +config MBOX_NRFX_IPC + default MBOX + config RPMSG_SERVICE_DUAL_IPM_SUPPORT default RPMSG_SERVICE diff --git a/boards/arm/thingy53_nrf5340/Kconfig b/boards/arm/thingy53_nrf5340/Kconfig index 74b496e2dc3..7aaa62182f9 100644 --- a/boards/arm/thingy53_nrf5340/Kconfig +++ b/boards/arm/thingy53_nrf5340/Kconfig @@ -12,6 +12,9 @@ config THINGY53_INIT_PRIORITY config IPM_NRFX default IPM +config MBOX_NRFX_IPC + default MBOX + config RPMSG_SERVICE_DUAL_IPM_SUPPORT default RPMSG_SERVICE diff --git a/drivers/bluetooth/hci/CMakeLists.txt b/drivers/bluetooth/hci/CMakeLists.txt index 09775db855b..a24128b624b 100644 --- a/drivers/bluetooth/hci/CMakeLists.txt +++ b/drivers/bluetooth/hci/CMakeLists.txt @@ -4,7 +4,6 @@ zephyr_library_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c) zephyr_library_sources_ifdef(CONFIG_BT_H4 h4.c) zephyr_library_sources_ifdef(CONFIG_BT_H5 h5.c) zephyr_library_sources_ifdef(CONFIG_BT_RPMSG rpmsg.c) -zephyr_library_sources_ifdef(CONFIG_BT_RPMSG_NRF53 rpmsg_nrf53.c) zephyr_library_sources_ifdef(CONFIG_BT_SPI spi.c) zephyr_library_sources_ifdef(CONFIG_BT_STM32_IPM ipm_stm32wb.c) zephyr_library_sources_ifdef(CONFIG_BT_USERCHAN userchan.c) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 8987f75045d..63f0b170820 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -33,10 +33,20 @@ config BT_H5 config BT_RPMSG bool "HCI using RPMsg" + select IPC_SERVICE + select MBOX help Bluetooth HCI driver for communication with another CPU using RPMsg framework. +if BT_RPMSG + +choice IPC_SERVICE_BACKEND + default IPC_SERVICE_BACKEND_RPMSG +endchoice + +endif # BT_RPMSG + config BT_SPI bool "SPI HCI" depends on SPI @@ -102,27 +112,10 @@ config BT_STM32_IPM_RX_STACK_SIZE depends on BT_STM32_IPM default 512 -config BT_RPMSG_NRF53 - bool "nRF53 configuration of RPMsg" - default y if SOC_NRF5340_CPUAPP - depends on BT_RPMSG - select RPMSG_SERVICE - help - Enable RPMsg configuration for nRF53. Two channels of the IPM driver - are used in the HCI driver: channel 0 for TX and channel 1 for RX. - -if BT_RPMSG_NRF53 - -choice RPMSG_SERVICE_MODE - default RPMSG_SERVICE_MODE_MASTER -endchoice - -endif # BT_RPMSG_NRF53 - config BT_DRIVER_QUIRK_NO_AUTO_DLE bool "Host auto-initiated Data Length Update quirk" depends on BT_AUTO_DATA_LEN_UPDATE - default y if BT_RPMSG_NRF53 || BT_ESP32 + default y if BT_RPMSG || BT_ESP32 help Enable the quirk wherein BT Host stack will auto-initiate Data Length Update procedure for new connections for controllers that do not diff --git a/drivers/bluetooth/hci/rpmsg.c b/drivers/bluetooth/hci/rpmsg.c index 281a77d90e9..7f6710f4288 100644 --- a/drivers/bluetooth/hci/rpmsg.c +++ b/drivers/bluetooth/hci/rpmsg.c @@ -11,6 +11,9 @@ #include #include +#include +#include + #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) #define LOG_MODULE_NAME bt_hci_driver #include "common/log.h" @@ -21,9 +24,10 @@ #define RPMSG_EVT 0x04 #define RPMSG_ISO 0x05 -int bt_rpmsg_platform_init(void); -int bt_rpmsg_platform_send(struct net_buf *buf); -int bt_rpmsg_platform_endpoint_is_bound(void); +#define IPC_BOUND_TIMEOUT_IN_MS K_MSEC(1000) + +static struct ipc_ept hci_ept; +static K_SEM_DEFINE(ipc_bound_sem, 0, 1); static bool is_hci_event_discardable(const uint8_t *evt_data) { @@ -50,7 +54,7 @@ static bool is_hci_event_discardable(const uint8_t *evt_data) } } -static struct net_buf *bt_rpmsg_evt_recv(uint8_t *data, size_t remaining) +static struct net_buf *bt_rpmsg_evt_recv(const uint8_t *data, size_t remaining) { bool discardable; struct bt_hci_evt_hdr hdr; @@ -99,7 +103,7 @@ static struct net_buf *bt_rpmsg_evt_recv(uint8_t *data, size_t remaining) return buf; } -static struct net_buf *bt_rpmsg_acl_recv(uint8_t *data, size_t remaining) +static struct net_buf *bt_rpmsg_acl_recv(const uint8_t *data, size_t remaining) { struct bt_hci_acl_hdr hdr; struct net_buf *buf; @@ -142,7 +146,7 @@ static struct net_buf *bt_rpmsg_acl_recv(uint8_t *data, size_t remaining) return buf; } -static struct net_buf *bt_rpmsg_iso_recv(uint8_t *data, size_t remaining) +static struct net_buf *bt_rpmsg_iso_recv(const uint8_t *data, size_t remaining) { struct bt_hci_iso_hdr hdr; struct net_buf *buf; @@ -185,7 +189,7 @@ static struct net_buf *bt_rpmsg_iso_recv(uint8_t *data, size_t remaining) return buf; } -void bt_rpmsg_rx(uint8_t *data, size_t len) +static void bt_rpmsg_rx(const uint8_t *data, size_t len) { uint8_t pkt_indicator; struct net_buf *buf = NULL; @@ -247,7 +251,7 @@ static int bt_rpmsg_send(struct net_buf *buf) net_buf_push_u8(buf, pkt_indicator); BT_HEXDUMP_DBG(buf->data, buf->len, "Final HCI buffer:"); - err = bt_rpmsg_platform_send(buf); + err = ipc_service_send(&hci_ept, buf->data, buf->len); if (err < 0) { BT_ERR("Failed to send (err %d)", err); } @@ -257,13 +261,49 @@ done: return 0; } +static void hci_ept_bound(void *priv) +{ + k_sem_give(&ipc_bound_sem); +} + +static void hci_ept_recv(const void *data, size_t len, void *priv) +{ + bt_rpmsg_rx(data, len); +} + +static struct ipc_ept_cfg hci_ept_cfg = { + .name = "nrf_bt_hci", + .cb = { + .bound = hci_ept_bound, + .received = hci_ept_recv, + }, +}; + static int bt_rpmsg_open(void) { + int err; + const struct device *hci_ipc_instance = DEVICE_DT_GET(DT_NODELABEL(ipc0)); + BT_DBG(""); - while (!bt_rpmsg_platform_endpoint_is_bound()) { - k_sleep(K_MSEC(1)); + err = ipc_service_open_instance(hci_ipc_instance); + if (err && (err != -EALREADY)) { + BT_ERR("IPC service instance initialization failed: %d\n", err); + return err; } + + err = ipc_service_register_endpoint(hci_ipc_instance, &hci_ept, &hci_ept_cfg); + if (err) { + BT_ERR("Registering endpoint failed with %d", err); + return err; + } + + err = k_sem_take(&ipc_bound_sem, IPC_BOUND_TIMEOUT_IN_MS); + if (err) { + BT_ERR("Endpoint binding failed with %d", err); + return err; + } + return 0; } @@ -283,12 +323,6 @@ static int bt_rpmsg_init(const struct device *unused) int err; - err = bt_rpmsg_platform_init(); - if (err < 0) { - BT_ERR("Failed to initialize BT RPMSG (err %d)", err); - return err; - } - err = bt_hci_driver_register(&drv); if (err < 0) { BT_ERR("Failed to register BT HIC driver (err %d)", err); @@ -297,4 +331,4 @@ static int bt_rpmsg_init(const struct device *unused) return err; } -SYS_INIT(bt_rpmsg_init, POST_KERNEL, CONFIG_RPMSG_SERVICE_EP_REG_PRIORITY); +SYS_INIT(bt_rpmsg_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/drivers/bluetooth/hci/rpmsg_nrf53.c b/drivers/bluetooth/hci/rpmsg_nrf53.c deleted file mode 100644 index 4f07c92f507..00000000000 --- a/drivers/bluetooth/hci/rpmsg_nrf53.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include - -#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) -#define LOG_MODULE_NAME bt_hci_driver_nrf53 -#include "common/log.h" - -void bt_rpmsg_rx(uint8_t *data, size_t len); - -static K_SEM_DEFINE(ready_sem, 0, 1); -static K_SEM_DEFINE(rx_sem, 0, 1); - -BUILD_ASSERT(CONFIG_HEAP_MEM_POOL_SIZE >= 1024, - "Not enough heap memory for RPMsg queue allocation"); - -static int endpoint_id; - -static int endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, - uint32_t src, void *priv) -{ - BT_DBG("Received message of %u bytes.", len); - BT_HEXDUMP_DBG((uint8_t *)data, len, "Data:"); - - bt_rpmsg_rx(data, len); - - return RPMSG_SUCCESS; -} - -int bt_rpmsg_platform_init(void) -{ - int err; - - err = rpmsg_service_register_endpoint("nrf_bt_hci", endpoint_cb); - - if (err < 0) { - LOG_ERR("Registering endpoint failed with %d", err); - return RPMSG_ERR_INIT; - } - - endpoint_id = err; - - return RPMSG_SUCCESS; -} - -int bt_rpmsg_platform_send(struct net_buf *buf) -{ - return rpmsg_service_send(endpoint_id, buf->data, buf->len); -} - -int bt_rpmsg_platform_endpoint_is_bound(void) -{ - return rpmsg_service_endpoint_is_bound(endpoint_id); -} diff --git a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi index 2fcf20733a6..7a07fa95c38 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi @@ -378,12 +378,23 @@ i2s0: i2s@28000 { label = "I2S_0"; }; -ipc: ipc@2a000 { - compatible = "nordic,nrf-ipc"; - reg = <0x2a000 0x1000>; - interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; +ipc0: ipc0 { + compatible = "zephyr,ipc-openamp-static-vrings"; + memory-region = <&sram0_shared>; + mboxes = <&mbox 0>, <&mbox 1>; + mbox-names = "tx", "rx"; + role = "host"; + status = "okay"; +}; + +mbox: mbox@2a000 { + compatible = "nordic,mbox-nrf-ipc"; + reg = <0x2a000 0x1000>; + tx-mask = <0x0000ffff>; + rx-mask = <0x0000ffff>; + interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; + #mbox-cells = <1>; status = "okay"; - label = "IPC"; }; qspi: qspi@2b000 { diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 16d6af82610..2000b852290 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -142,12 +142,23 @@ label = "RTC_0"; }; - ipc: ipc@41012000 { - compatible = "nordic,nrf-ipc"; - reg = <0x41012000 0x1000>; - interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>; + ipc0: ipc0 { + compatible = "zephyr,ipc-openamp-static-vrings"; + memory-region = <&sram0_shared>; + mboxes = <&mbox 0>, <&mbox 1>; + mbox-names = "rx", "tx"; + role = "remote"; + status = "okay"; + }; + + mbox: mbox@41012000 { + compatible = "nordic,mbox-nrf-ipc"; + reg = <0x41012000 0x1000>; + tx-mask = <0x0000ffff>; + rx-mask = <0x0000ffff>; + interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>; + #mbox-cells = <1>; status = "okay"; - label = "IPC"; }; i2c0: i2c@41013000 { diff --git a/samples/bluetooth/hci_rpmsg/prj.conf b/samples/bluetooth/hci_rpmsg/prj.conf index ef920304223..e0442620a6b 100644 --- a/samples/bluetooth/hci_rpmsg/prj.conf +++ b/samples/bluetooth/hci_rpmsg/prj.conf @@ -1,5 +1,6 @@ -CONFIG_RPMSG_SERVICE=y -CONFIG_RPMSG_SERVICE_MODE_REMOTE=y +CONFIG_IPC_SERVICE=y +CONFIG_IPC_SERVICE_BACKEND_RPMSG=y +CONFIG_MBOX=y CONFIG_HEAP_MEM_POOL_SIZE=8192 diff --git a/samples/bluetooth/hci_rpmsg/src/main.c b/samples/bluetooth/hci_rpmsg/src/main.c index 6fc4c5242b3..a84099ffd1a 100644 --- a/samples/bluetooth/hci_rpmsg/src/main.c +++ b/samples/bluetooth/hci_rpmsg/src/main.c @@ -9,18 +9,12 @@ #include #include +#include #include -#include #include #include -#include -#include -#include -#include -#include - -#include +#include #include #include @@ -33,11 +27,12 @@ #define LOG_MODULE_NAME hci_rpmsg #include "common/log.h" -static int endpoint_id; +static struct ipc_ept hci_ept; static K_THREAD_STACK_DEFINE(tx_thread_stack, CONFIG_BT_HCI_TX_STACK_SIZE); static struct k_thread tx_thread_data; static K_FIFO_DEFINE(tx_queue); +static K_SEM_DEFINE(ipc_bound_sem, 0, 1); #define HCI_RPMSG_CMD 0x01 #define HCI_RPMSG_ACL 0x02 @@ -223,7 +218,7 @@ static int hci_rpmsg_send(struct net_buf *buf) net_buf_push_u8(buf, pkt_indicator); LOG_HEXDUMP_DBG(buf->data, buf->len, "Final HCI buffer:"); - rpmsg_service_send(endpoint_id, buf->data, buf->len); + ipc_service_send(&hci_ept, buf->data, buf->len); net_buf_unref(buf); @@ -237,18 +232,29 @@ void bt_ctlr_assert_handle(char *file, uint32_t line) } #endif /* CONFIG_BT_CTLR_ASSERT_HANDLER */ -int endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, uint32_t src, - void *priv) +static void hci_ept_bound(void *priv) +{ + k_sem_give(&ipc_bound_sem); +} + +static void hci_ept_recv(const void *data, size_t len, void *priv) { LOG_INF("Received message of %u bytes.", len); hci_rpmsg_rx((uint8_t *) data, len); - - return RPMSG_SUCCESS; } +static struct ipc_ept_cfg hci_ept_cfg = { + .name = "nrf_bt_hci", + .cb = { + .bound = hci_ept_bound, + .received = hci_ept_recv, + }, +}; + void main(void) { int err; + const struct device *hci_ipc_instance = DEVICE_DT_GET(DT_NODELABEL(ipc0)); /* incoming events and data from the controller */ static K_FIFO_DEFINE(rx_queue); @@ -266,6 +272,19 @@ void main(void) NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT); k_thread_name_set(&tx_thread_data, "HCI rpmsg TX"); + /* Initialize IPC service instance and register endpoint. */ + err = ipc_service_open_instance(hci_ipc_instance); + if (err) { + LOG_ERR("IPC service instance initialization failed: %d\n", err); + } + + err = ipc_service_register_endpoint(hci_ipc_instance, &hci_ept, &hci_ept_cfg); + if (err) { + LOG_ERR("Registering endpoint failed with %d", err); + } + + k_sem_take(&ipc_bound_sem, K_FOREVER); + while (1) { struct net_buf *buf; @@ -276,22 +295,3 @@ void main(void) } } } - -/* Make sure we register endpoint before RPMsg Service is initialized. */ -int register_endpoint(const struct device *arg) -{ - int status; - - status = rpmsg_service_register_endpoint("nrf_bt_hci", endpoint_cb); - - if (status < 0) { - LOG_ERR("Registering endpoint failed with %d", status); - return status; - } - - endpoint_id = status; - - return 0; -} - -SYS_INIT(register_endpoint, POST_KERNEL, CONFIG_RPMSG_SERVICE_EP_REG_PRIORITY); diff --git a/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay index 16ff388d4c8..c59c5e12023 100644 --- a/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -9,6 +9,12 @@ /delete-property/ zephyr,ipc_shm; }; + soc { + peripheral@50000000 { + /delete-node/ ipc0; + }; + }; + reserved-memory { /delete-node/ memory@20070000; @@ -21,22 +27,6 @@ }; }; - soc { - peripheral@50000000 { - /delete-node/ ipc@2a000; - - mbox: mbox@2a000 { - compatible = "nordic,mbox-nrf-ipc"; - reg = <0x2a000 0x1000>; - tx-mask = <0x0000ffff>; - rx-mask = <0x0000ffff>; - interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - status = "okay"; - }; - }; - }; - ipc0: ipc0 { compatible = "zephyr,ipc-openamp-static-vrings"; memory-region = <&sram_ipc0>; diff --git a/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/nrf5340dk_nrf5340_cpunet.overlay index 6dd4fd195bb..130529a132a 100644 --- a/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/nrf5340dk_nrf5340_cpunet.overlay +++ b/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -9,6 +9,10 @@ /delete-property/ zephyr,ipc_shm; }; + soc { + /delete-node/ ipc0; + }; + reserved-memory { /delete-node/ memory@20070000; @@ -21,20 +25,6 @@ }; }; - soc { - /delete-node/ ipc@41012000; - - mbox: mbox@41012000 { - compatible = "nordic,mbox-nrf-ipc"; - reg = <0x41012000 0x1000>; - tx-mask = <0x0000ffff>; - rx-mask = <0x0000ffff>; - interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - status = "okay"; - }; - }; - ipc0: ipc0 { compatible = "zephyr,ipc-openamp-static-vrings"; memory-region = <&sram_ipc0>; diff --git a/samples/subsys/ipc/openamp_performance/CMakeLists.txt b/samples/subsys/ipc/openamp_performance/CMakeLists.txt index 6a30384f3e8..3494b9d3ad6 100644 --- a/samples/subsys/ipc/openamp_performance/CMakeLists.txt +++ b/samples/subsys/ipc/openamp_performance/CMakeLists.txt @@ -30,7 +30,6 @@ ExternalProject_Add( 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 diff --git a/samples/subsys/ipc/openamp_performance/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/ipc/openamp_performance/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 00000000000..a021c59013c --- /dev/null +++ b/samples/subsys/ipc/openamp_performance/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + soc { + peripheral@50000000 { + /delete-node/ ipc@2a000; + + ipc: ipc@2a000 { + compatible = "nordic,nrf-ipc"; + reg = <0x2a000 0x1000>; + interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; + status = "okay"; + label = "IPC"; + }; + }; + }; +}; diff --git a/samples/subsys/ipc/openamp_performance/remote/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/subsys/ipc/openamp_performance/remote/boards/nrf5340dk_nrf5340_cpunet.overlay new file mode 100644 index 00000000000..20aa90cbd62 --- /dev/null +++ b/samples/subsys/ipc/openamp_performance/remote/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + soc { + /delete-node/ ipc@41012000; + + ipc: ipc@41012000 { + compatible = "nordic,nrf-ipc"; + reg = <0x41012000 0x1000>; + interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>; + status = "okay"; + label = "IPC"; + }; + }; +}; diff --git a/samples/subsys/ipc/rpmsg_service/CMakeLists.txt b/samples/subsys/ipc/rpmsg_service/CMakeLists.txt index ab263ab7005..69cec368a70 100644 --- a/samples/subsys/ipc/rpmsg_service/CMakeLists.txt +++ b/samples/subsys/ipc/rpmsg_service/CMakeLists.txt @@ -38,7 +38,6 @@ ExternalProject_Add( 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 diff --git a/samples/subsys/ipc/rpmsg_service/boards/bl5340_dvk_cpuapp.overlay b/samples/subsys/ipc/rpmsg_service/boards/bl5340_dvk_cpuapp.overlay new file mode 100644 index 00000000000..a021c59013c --- /dev/null +++ b/samples/subsys/ipc/rpmsg_service/boards/bl5340_dvk_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + soc { + peripheral@50000000 { + /delete-node/ ipc@2a000; + + ipc: ipc@2a000 { + compatible = "nordic,nrf-ipc"; + reg = <0x2a000 0x1000>; + interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; + status = "okay"; + label = "IPC"; + }; + }; + }; +}; diff --git a/samples/subsys/ipc/rpmsg_service/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/ipc/rpmsg_service/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 00000000000..a021c59013c --- /dev/null +++ b/samples/subsys/ipc/rpmsg_service/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + soc { + peripheral@50000000 { + /delete-node/ ipc@2a000; + + ipc: ipc@2a000 { + compatible = "nordic,nrf-ipc"; + reg = <0x2a000 0x1000>; + interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; + status = "okay"; + label = "IPC"; + }; + }; + }; +}; diff --git a/samples/subsys/ipc/rpmsg_service/remote/boards/bl5340_dvk_cpunet.overlay b/samples/subsys/ipc/rpmsg_service/remote/boards/bl5340_dvk_cpunet.overlay new file mode 100644 index 00000000000..20aa90cbd62 --- /dev/null +++ b/samples/subsys/ipc/rpmsg_service/remote/boards/bl5340_dvk_cpunet.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + soc { + /delete-node/ ipc@41012000; + + ipc: ipc@41012000 { + compatible = "nordic,nrf-ipc"; + reg = <0x41012000 0x1000>; + interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>; + status = "okay"; + label = "IPC"; + }; + }; +}; diff --git a/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_remote.overlay b/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_remote.overlay new file mode 100644 index 00000000000..553736d6461 --- /dev/null +++ b/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_remote.overlay @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + /* + * shared memory reserved for the inter-processor communication + */ + zephyr,ipc_shm = &sramx; + zephyr,ipc = &mhu0; + }; + + sramx: memory@28180000 { + compatible = "mmio-sram"; + reg = <0x28180000 0x8000>; + }; +}; diff --git a/samples/subsys/ipc/rpmsg_service/remote/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/subsys/ipc/rpmsg_service/remote/boards/nrf5340dk_nrf5340_cpunet.overlay new file mode 100644 index 00000000000..20aa90cbd62 --- /dev/null +++ b/samples/subsys/ipc/rpmsg_service/remote/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + soc { + /delete-node/ ipc@41012000; + + ipc: ipc@41012000 { + compatible = "nordic,nrf-ipc"; + reg = <0x41012000 0x1000>; + interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>; + status = "okay"; + label = "IPC"; + }; + }; +}; diff --git a/samples/subsys/ipc/rpmsg_service/remote/boards/v2m_musca_b1_ns.overlay b/samples/subsys/ipc/rpmsg_service/remote/boards/v2m_musca_b1_ns.overlay new file mode 100644 index 00000000000..db9e67d7db7 --- /dev/null +++ b/samples/subsys/ipc/rpmsg_service/remote/boards/v2m_musca_b1_ns.overlay @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + /* + * shared memory reserved for the inter-processor communication + */ + zephyr,ipc_shm = &sramx; + zephyr,ipc = &mhu0; + }; + + sramx: memory@20060000 { + compatible = "mmio-sram"; + reg = <0x20060000 0x8000>; + }; +}; diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 67653dba8da..ce7927ab53c 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -232,7 +232,7 @@ config NRF53_SYNC_RTC default y if LOG && !LOG_MODE_MINIMAL depends on NRF_RTC_TIMER select NRFX_DPPI - select IPM if !MBOX + select MBOX if !IPM if NRF53_SYNC_RTC