Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert PRs #31115 and #31224 #31437

Closed
wants to merge 7 commits into from
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
1 change: 0 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@
/subsys/fs/fuse_fs_access.c @vanwinkeljan
/subsys/fs/littlefs_fs.c @pabigot
/subsys/fs/nvs/ @Laczen
/subsys/ipc/ @ioannisg
/subsys/logging/ @nordic-krch
/subsys/logging/log_backend_net.c @nordic-krch @jukkar
/subsys/lorawan/ @Mani-Sadhasivam
Expand Down
38 changes: 1 addition & 37 deletions boards/arm/nrf5340dk_nrf5340/Kconfig
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
# nRF5340 (P)DK board configuration

# Copyright (c) 2019 - 2021 Nordic Semiconductor ASA
# Copyright (c) 2019 - 2020 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
Expand Down
17 changes: 16 additions & 1 deletion boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2021 Nordic Semiconductor ASA.
* Copyright (c) 2019-2020 Nordic Semiconductor ASA.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -12,6 +12,13 @@

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. */
Expand Down Expand Up @@ -76,6 +83,14 @@ 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;
Expand Down
18 changes: 14 additions & 4 deletions drivers/bluetooth/hci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,26 @@ config BT_RPMSG_NRF53
bool "nRF53 configuration of RPMsg"
default y if SOC_NRF5340_CPUAPP
depends on BT_RPMSG
select RPMSG_SERVICE
select IPM
select IPM_NRFX
select IPM_MSG_CH_1_ENABLE
select IPM_MSG_CH_0_ENABLE
select IPM_MSG_CH_0_TX
select IPM_MSG_CH_1_RX
select OPENAMP
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
config BT_RPMSG_NRF53_RX_STACK_SIZE
int "RPMsg stack size for RX thread"
default 1024

config BT_RPMSG_NRF53_RX_PRIO
int "RPMsg RX thread priority"
default 8

endif # BT_RPMSG_NRF53

Expand Down
23 changes: 3 additions & 20 deletions drivers/bluetooth/hci/rpmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

int bt_rpmsg_platform_init(void);
int bt_rpmsg_platform_send(struct net_buf *buf);
int bt_rpmsg_platform_endpoint_is_bound(void);

static bool is_hci_event_discardable(const uint8_t *evt_data)
{
Expand Down Expand Up @@ -235,10 +234,7 @@ static int bt_rpmsg_open(void)
{
BT_DBG("");

while (!bt_rpmsg_platform_endpoint_is_bound()) {
k_sleep(K_MSEC(1));
}
return 0;
return bt_rpmsg_platform_init();
}

static const struct bt_hci_driver drv = {
Expand All @@ -255,20 +251,7 @@ static int bt_rpmsg_init(const struct device *unused)
{
ARG_UNUSED(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);
}

return err;
return bt_hci_driver_register(&drv);
}

SYS_INIT(bt_rpmsg_init, POST_KERNEL, CONFIG_RPMSG_SERVICE_EP_REG_PRIORITY);
SYS_INIT(bt_rpmsg_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
Loading