Skip to content

Commit

Permalink
[nrf noup] boards: Add non-secure target for nrf54L15dk
Browse files Browse the repository at this point in the history
This adds the nrf54l15dk/nrf54l15/cpuapp/ns board variant to
sdk-zephyr. It allows to build nRF54l15dk with TF-M in nRF Connect SDK.

This is done as a noup as the out-of-tree board extension feature is
not available. When zephyrproject-rtos/zephyr#69548 is completed this
commit can be reverted and the variant be placed in sdk-nrf.

Signed-off-by: Tomi Fontanilles <[email protected]>
(cherry picked from commit 6b4c840)
  • Loading branch information
tomi-font authored and carlescufi committed Nov 22, 2024
1 parent 0f77131 commit 787a64f
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 1 deletion.
34 changes: 34 additions & 0 deletions boards/nordic/nrf54l15dk/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# nRF54L15 DK board configuration

# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS

config NRF_MPC_REGION_SIZE
hex
default 0x1000
help
Region size for the Memory Protection Controller (MPC) in bytes.

config NRF_TRUSTZONE_FLASH_REGION_SIZE
hex
default NRF_MPC_REGION_SIZE
help
This defines the flash region size from the TRUSTZONE perspective.
It is used when configuring the TRUSTZONE and when setting alignments
requirements for the partitions.
This abstraction allows us to configure TRUSTZONE without depending
on peripheral specific symbols.

config NRF_TRUSTZONE_RAM_REGION_SIZE
hex
default NRF_MPC_REGION_SIZE
help
This defines the RAM region size from the TRUSTZONE perspective.
It is used when configuring the TRUSTZONE and when setting alignments
requirements for the partitions.
This abstraction allows us to configure TRUSTZONE without depending
on peripheral specific symbols.

endif #BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
18 changes: 18 additions & 0 deletions boards/nordic/nrf54l15dk/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,21 @@ config ROM_START_OFFSET

endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \
# BOARD_NRF54L15DK_NRF54L15_CPUAPP

if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS

config BT_CTLR
default BT

# By default, if we build for a Non-Secure version of the board,
# enable building with TF-M as the Secure Execution Environment.
config BUILD_WITH_TFM
default y if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS

# By default, if we build with TF-M, instruct build system to
# flash the combined TF-M (Secure) & Zephyr (Non Secure) image
config TFM_FLASH_MERGED_BINARY
default y
depends on BUILD_WITH_TFM

endif #BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
2 changes: 1 addition & 1 deletion boards/nordic/nrf54l15dk/Kconfig.nrf54l15dk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
config BOARD_NRF54L15DK
select SOC_NRF54L05_CPUAPP if BOARD_NRF54L15DK_NRF54L05_CPUAPP
select SOC_NRF54L10_CPUAPP if BOARD_NRF54L15DK_NRF54L10_CPUAPP
select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15DK_NRF54L15_CPUAPP
select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15DK_NRF54L15_CPUAPP || BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
select SOC_NRF54L15_CPUFLPR if BOARD_NRF54L15DK_NRF54L15_CPUFLPR || \
BOARD_NRF54L15DK_NRF54L15_CPUFLPR_XIP
8 changes: 8 additions & 0 deletions boards/nordic/nrf54l15dk/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@ elseif(CONFIG_SOC_NRF54L05_CPUFLPR OR CONFIG_SOC_NRF54L10_CPUFLPR OR
board_runner_args(jlink "--speed=4000")
endif()

if(BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS)
set(TFM_PUBLIC_KEY_FORMAT "full")
endif()

if(CONFIG_TFM_FLASH_MERGED_BINARY)
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
endif()

include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
2 changes: 2 additions & 0 deletions boards/nordic/nrf54l15dk/board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ board:
variants:
- name: xip
cpucluster: cpuflpr
- name: ns
cpucluster: cpuapp
31 changes: 31 additions & 0 deletions boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#define USE_NON_SECURE_ADDRESS_MAP 1

#include "nrf54l15_cpuapp_common.dtsi"

/ {
compatible = "nordic,nrf54l15dk_nrf54l15-cpuapp";
model = "Nordic nRF54L15 DK nRF54L15 Application MCU";

chosen {
zephyr,code-partition = &slot0_partition;
zephyr,sram = &cpuapp_sram;
};
};

&uart30 {
/* Disable so that TF-M can use this UART */
status = "disabled";

current-speed = <115200>;
pinctrl-0 = <&uart30_default>;
pinctrl-1 = <&uart30_sleep>;
pinctrl-names = "default", "sleep";
};
22 changes: 22 additions & 0 deletions boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

identifier: nrf54l15dk/nrf54l15/cpuapp/ns
name: nRF54l15-DK-nRF54l15-Application-Non-Secure
type: mcu
arch: arm
toolchain:
- gnuarmemb
- xtools
- zephyr
ram: 256
flash: 1524
supported:
- adc
- gpio
- i2c
- spi
- counter
- watchdog
- adc
- i2s
31 changes: 31 additions & 0 deletions boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

# Enable MPU
CONFIG_ARM_MPU=y

# Enable hardware stack protection
CONFIG_HW_STACK_PROTECTION=y

CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y

# Enable TrustZone-M
CONFIG_ARM_TRUSTZONE_M=y

# This Board implies building Non-Secure firmware
CONFIG_TRUSTED_EXECUTION_NONSECURE=y

# Don't enable the cache in the non-secure image as it is a
# secure-only peripheral on 54l
CONFIG_CACHE_MANAGEMENT=n
CONFIG_EXTERNAL_CACHE=n

CONFIG_UART_CONSOLE=y
CONFIG_CONSOLE=y
CONFIG_SERIAL=y

# Enable GPIO
CONFIG_GPIO=y

# Start SYSCOUNTER on driver init
CONFIG_NRF_GRTC_START_SYSCOUNTER=y

0 comments on commit 787a64f

Please sign in to comment.