Commit 4a1834ce authored by Gerard Marull-Paretas's avatar Gerard Marull-Paretas Committed by Fabio Baltieri
Browse files

boards: nrf53: remove redundant cpunet initialization code



This is now handled at SoC level, avoiding code duplicates.

Signed-off-by: default avatarGerard Marull-Paretas <gerard@teslabs.com>
parent 4c84a6f6
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -3,13 +3,8 @@
# SPDX-License-Identifier: Apache-2.0

if((CONFIG_BOARD_BL5340_DVK_NRF5340_CPUAPP OR CONFIG_BOARD_BL5340_DVK_NRF5340_CPUAPP_NS)
   AND CONFIG_BOARD_ENABLE_CPUNET)
  zephyr_library()
  zephyr_library_sources(bl5340_dvk_nrf5340_cpunet_reset.c)

  if(CONFIG_BUILD_WITH_TFM)
   AND CONFIG_BUILD_WITH_TFM)
  zephyr_library_include_directories(
    $<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/api_ns/interface/include
  )
endif()
endif()
+0 −17
Original line number Diff line number Diff line
@@ -21,26 +21,9 @@ config BOARD_ENABLE_DCDC_HV
	select SOC_DCDC_NRF53X_HV
	default y

config BOARD_ENABLE_CPUNET
	bool "NRF53 Network MCU"
	select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \
		$(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER))
	help
	  This option enables releasing the Network 'force off' signal, which
	  as a consequence will power up the Network MCU during system boot.
	  Additionally, the option allocates GPIO pins that will be used by UARTE
	  of the Network MCU.
	  Note: GPIO pin allocation can only be configured by the secure Application
	  MCU firmware, so when this option is used with the non-secure version of
	  the board, the application needs to take into consideration, that the
	  secure firmware image must already have configured GPIO allocation for the
	  Network MCU.
	default y if (BT || NRF_802154_SER_HOST)

config DOMAIN_CPUNET_BOARD
	string
	default "bl5340_dvk/nrf5340/cpunet"
	depends on BOARD_ENABLE_CPUNET
	help
	  The board which will be used for CPUNET domain when creating a multi
	  image application where one or more images should be located on
+0 −61
Original line number Diff line number Diff line
/*
 * Copyright (c) 2019-2021 Nordic Semiconductor ASA.
 * Copyright (c) 2021-2023 Laird Connectivity
 *
 * SPDX-License-Identifier: Apache-2.0
 */

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

#include <soc.h>
#include <hal/nrf_reset.h>

LOG_MODULE_REGISTER(bl5340_dvk_cpuapp, CONFIG_LOG_DEFAULT_LEVEL);

#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP)
#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h>
#else
#define DEBUG_SETUP()
#endif

static void remoteproc_mgr_config(void)
{
#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM)
	/* Route Bluetooth Controller Debug Pins */
	DEBUG_SETUP();
#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) */

#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[0].PERM = 1 << 4;
#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) */
}

static int remoteproc_mgr_boot(void)
{

	/* Secure domain may configure permissions for the Network MCU. */
	remoteproc_mgr_config();

#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.
	 */

	/* Release the Network MCU, 'Release force off signal' */
	nrf_reset_network_force_off(NRF_RESET, false);

	LOG_DBG("Network MCU released.");
#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */

	return 0;
}

SYS_INIT(remoteproc_mgr_boot, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+0 −9
Original line number Diff line number Diff line
@@ -94,15 +94,6 @@ config SOC_SERIES_BSIM_NRF54LX
	help
	  Any NRF54L simulated SOC with BabbleSim, based on the POSIX arch

if BOARD_NRF5340BSIM_NRF5340_CPUAPP

# Replica of the option provided by the BOARD_NRF5340DK_NRF5340_CPUAPP board so samples can be
# reused as is
config BOARD_ENABLE_CPUNET
	bool "NRF53 Network MCU"

endif # BOARD_NRF5340BSIM_NRF5340_CPUNET

if SOC_SERIES_BSIM_NRF53X

# Let's reuse the RTC sync options so applications which use it can be reused as is
+2 −3
Original line number Diff line number Diff line
# Copyright (c) 2021 Nordic Semiconductor ASA.
# SPDX-License-Identifier: Apache-2.0

if((CONFIG_BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS)
    AND CONFIG_BOARD_ENABLE_CPUNET)
if(CONFIG_BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS)
  zephyr_library()
  zephyr_library_sources(nrf5340_audio_dk_cpunet_reset.c)
  zephyr_library_sources(nrf5340_audio_dk_config.c)

  if(CONFIG_BUILD_WITH_TFM)
    zephyr_library_include_directories(
Loading