Skip to content

Commit

Permalink
bluetooth: rpc: add nrf53 cpunet enable code
Browse files Browse the repository at this point in the history
Added the code for enabling nRF53 network core in the Bluetooth
RPC configuration. The change is required as the newly introduced
Kconfig - CONFIG_SOC_NRF53_CPUNET_ENABLE - for enabling the network
core at the SoC level cannot be enabled in projects that use the
CONFIG_BT Kconfig.

Ref: NCSDK-29186

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
  • Loading branch information
kapi-no authored and bjarki-andreasen committed Sep 30, 2024
1 parent 6a745bf commit c78d98b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions subsys/bluetooth/rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ target_include_directories(subsys_bluetooth_rpc INTERFACE ${CMAKE_CURRENT_SOURCE
add_subdirectory(common)
add_subdirectory_ifdef(CONFIG_BT_RPC_CLIENT client)
add_subdirectory_ifdef(CONFIG_BT_RPC_HOST host)
add_subdirectory(soc)
7 changes: 7 additions & 0 deletions subsys/bluetooth/rpc/soc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

zephyr_library_sources_ifdef(CONFIG_SOC_NRF5340_CPUAPP nrf53_cpunet_enable.c)
37 changes: 37 additions & 0 deletions subsys/bluetooth/rpc/soc/nrf53_cpunet_enable.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <nrf53_cpunet_mgmt.h>

#include <zephyr/kernel.h>
#include <zephyr/init.h>

#include <hal/nrf_spu.h>

static int nrf53_cpunet_init(void)
{
#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)
/* Retain nRF5340 Network MCU in Secure domain (bus
* accesses by Network MCU will have Secure attribute set).
*/
nrf_spu_extdomain_set((NRF_SPU_Type *)DT_REG_ADDR(DT_NODELABEL(spu)), 0, true, false);
#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) */

#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE)
/*
* Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies
* building also a Non-Secure image. The Non-Secure image will, in
* this case do the remainder of actions to properly configure and
* boot the Network MCU.
*/

nrf53_cpunet_enable(true);
#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */

return 0;
}

SYS_INIT(nrf53_cpunet_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

0 comments on commit c78d98b

Please sign in to comment.