-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
nRF54L15: Add initial TF-M support #14463
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6ec3947
manifest: Update tf-m
Vge0rge 2e6c8da
manifest: update Zephyr
Vge0rge 540eeb8
nRF54L15: Add TF-M support
SebastianBoe 6304239
nrf_security: cracen: Fix macro guard
Vge0rge be3aa95
nrf_security: cracen: Always access the PSA key ID
Vge0rge b973613
nrf_security: cracen: Change KEY_ID definitions to support TF-M
Vge0rge d73e3ed
nrf_security: cracen: Disable KMU support for TF-M
Vge0rge 8307098
cracen: spake2p: Removed unused include
Vge0rge 30b5ca2
nrf_security: cracen: Remove builtin keys in NS
Vge0rge f642e22
soc: arm: nordic: Add dtsi files for nRF54L15 NS
Vge0rge 7d12d29
samples: tfm_hello_world: Remove LFXO config
Vge0rge e2adef1
samples: tfm_hello_world: Adapt to nRF54L15
Vge0rge 43b5397
modules: tf-m: Fix minor unused variable issue
Vge0rge c8916e8
nrf_security: cracen: Allow NULL output
Vge0rge b10afbb
samples: crypto: Add PSA_WANT_KEY_TYPE for HKDF+HMAC
Vge0rge 118eb8f
modules: tf-m: Remove non-volatile seed option
Vge0rge 43d37f5
samples: crypto: Add support for nRF54L15 with TF-M
Vge0rge 79303ce
samples: tfm_hello_world: Set downgrade prevetion
Vge0rge 50bb0ce
modules: tf-m: Increase stack size for RSA keys
Vge0rge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2022 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
|
||
if SOC_NRF54L15_ENGA_CPUAPP | ||
|
||
config BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS | ||
bool "nRF54L15 DK nRF54L15 Application MCU non-secure" | ||
|
||
endif # SOC_NRF54L15_CPUAPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
|
||
if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS | ||
|
||
config BOARD | ||
default "nrf54l15pdk_nrf54l15_cpuapp" | ||
|
||
# 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_NRF54L15PDK_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 | ||
bool | ||
default y | ||
depends on BUILD_WITH_TFM | ||
|
||
# TODO: Remove the options bellow when (NCSDK-25023) is done | ||
config NRF_SPU_FLASH_REGION_SIZE | ||
hex | ||
default 0x4000 | ||
# This option does not apply to 54, but we pretend the HW has this limitation | ||
# for now for easier porting. NCSDK-25023 | ||
help | ||
FLASH region size for the NRF_SPU peripheral. For nrf54 the | ||
region size is configurable per-region so this option does | ||
not apply. | ||
|
||
config NRF_SPU_FLASH_REGION_ALIGNMENT | ||
hex | ||
default 0x4000 | ||
# This option does not apply to 54, but we pretend the HW has this limitation | ||
# for now for easier porting. NCSDK-25023 | ||
help | ||
FLASH region size for the NRF_SPU peripheral. For nrf54 the | ||
region size is configurable per-region so this option does | ||
not apply. | ||
|
||
config NRF_SPU_RAM_REGION_SIZE | ||
hex | ||
default 0x2000 | ||
# This HW limitation does not apply to 54, but we pretend | ||
# it does for now for easier porting. NCSDK-25023 | ||
help | ||
RAM region size for the NRF_SPU peripheral. For nrf54 the | ||
region size is configurable per-region so this option does | ||
not apply. | ||
|
||
|
||
config NRF_SPU_RAM_REGION_ALIGNMENT | ||
hex | ||
default 0x1000 | ||
help | ||
RAM regions must be aligned to this value due to SPU HW | ||
limitations. | ||
|
||
endif #BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
|
||
if(CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS) | ||
board_runner_args(jlink "--device=cortex-m33" "--speed=4000") | ||
endif() | ||
|
||
if(BOARD_NRF54L15PDK_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/nrfjprog.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) |
22 changes: 22 additions & 0 deletions
22
boards/arm/nrf54l15pdk_nrf54l15/nrf54l15pdk_nrf54l15_cpuapp.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: nrf54l15pdk_nrf54l15_cpuapp_ns | ||
name: nRF54l15-PDK-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 |
38 changes: 38 additions & 0 deletions
38
boards/arm/nrf54l15pdk_nrf54l15/nrf54l15pdk_nrf54l15_cpuapp_ns-pinctrl.dtsi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
&pinctrl { | ||
uart20_default: uart20_default { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 1, 4)>, | ||
<NRF_PSEL(UART_RX, 1, 5)>; | ||
}; | ||
}; | ||
|
||
uart20_sleep: uart20_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 1, 4)>, | ||
<NRF_PSEL(UART_RX, 1, 5)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
|
||
uart30_default: uart30_default { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 0, 0)>, | ||
<NRF_PSEL(UART_RX, 0, 1)>; | ||
}; | ||
}; | ||
|
||
uart30_sleep: uart30_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 0, 0)>, | ||
<NRF_PSEL(UART_RX, 0, 1)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
|
||
}; |
97 changes: 97 additions & 0 deletions
97
boards/arm/nrf54l15pdk_nrf54l15/nrf54l15pdk_nrf54l15_cpuapp_ns.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/dts-v1/; | ||
#include <nordic/nrf54l15_cpuapp_ns.dtsi> | ||
#include "nrf54l15pdk_nrf54l15_cpuapp_ns-pinctrl.dtsi" | ||
|
||
/ { | ||
chosen { | ||
zephyr,console = &uart20; | ||
/* TODO: NCSDK-24862: We don't support configuring RRAM and SRAM | ||
* regions in the DTS file yet. The partition manager configures | ||
* these regions now. | ||
*/ | ||
zephyr,shell-uart = &uart20; | ||
zephyr,flash = &rram0; | ||
zephyr,sram = &sram0; | ||
}; | ||
|
||
leds { | ||
compatible = "gpio-leds"; | ||
led0: led_0 { | ||
gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 0"; | ||
}; | ||
led1: led_1 { | ||
gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 1"; | ||
}; | ||
led2: led_2 { | ||
gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 2"; | ||
}; | ||
led3: led_3 { | ||
gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 3"; | ||
}; | ||
}; | ||
|
||
buttons { | ||
compatible = "gpio-keys"; | ||
button0: button_0 { | ||
gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
label = "Push button 0"; | ||
zephyr,code = <INPUT_KEY_0>; | ||
}; | ||
button1: button_1 { | ||
gpios = <&gpio1 10 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
label = "Push button 1"; | ||
zephyr,code = <INPUT_KEY_1>; | ||
}; | ||
button2: button_2 { | ||
gpios = <&gpio2 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
label = "Push button 2"; | ||
zephyr,code = <INPUT_KEY_2>; | ||
}; | ||
button3: button_3 { | ||
gpios = <&gpio2 10 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
label = "Push button 3"; | ||
zephyr,code = <INPUT_KEY_3>; | ||
}; | ||
}; | ||
|
||
aliases { | ||
led0 = &led0; | ||
led1 = &led1; | ||
led2 = &led2; | ||
led3 = &led3; | ||
sw0 = &button0; | ||
sw1 = &button1; | ||
sw2 = &button2; | ||
sw3 = &button3; | ||
}; | ||
}; | ||
|
||
&uart20 { | ||
status = "okay"; | ||
current-speed = <115200>; | ||
pinctrl-0 = <&uart20_default>; | ||
pinctrl-1 = <&uart20_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
}; | ||
|
||
&uart30 { | ||
status = "okay"; | ||
current-speed = <115200>; | ||
pinctrl-0 = <&uart30_default>; | ||
pinctrl-1 = <&uart30_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
}; | ||
|
||
&grtc { | ||
status = "okay"; | ||
}; |
41 changes: 41 additions & 0 deletions
41
boards/arm/nrf54l15pdk_nrf54l15/nrf54l15pdk_nrf54l15_cpuapp_ns_defconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
|
||
CONFIG_SOC_SERIES_NRF54LX=y | ||
CONFIG_SOC_NRF54L15_ENGA_CPUAPP=y | ||
CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS=y | ||
|
||
# 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 | ||
|
||
# NCSDK-22600: Protected storage depends on BUILTIN_KEYS | ||
CONFIG_TFM_PARTITION_PROTECTED_STORAGE=n | ||
|
||
# NCSDK-22600: Built-in keys are not supported yet. | ||
CONFIG_TFM_CRYPTO_BUILTIN_KEYS=n | ||
|
||
# Start SYSCOUNTER on driver init | ||
CONFIG_NRF_GRTC_START_SYSCOUNTER=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <arm/armv8-m.dtsi> | ||
#include <nordic/nrf_common.dtsi> | ||
#include <nordic/nrf54l_common.dtsi> | ||
|
||
/ { | ||
cpus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
cpu: cpu@0 { | ||
clock-frequency = <DT_FREQ_M(128)>; | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-m33f"; | ||
reg = <0>; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
itm: itm@e0000000 { | ||
compatible = "arm,armv8m-itm"; | ||
reg = <0xe0000000 0x1000>; | ||
swo-ref-frequency = <DT_FREQ_M(128)>; | ||
}; | ||
}; | ||
}; | ||
|
||
clocks { | ||
lfxo: lfxo { | ||
compatible = "nordic,nrf-lfxo"; | ||
#clock-cells = <0>; | ||
clock-frequency = <32768>; | ||
}; | ||
|
||
hfxo: hfxo { | ||
compatible = "nordic,nrf-hfxo"; | ||
#clock-cells = <0>; | ||
clock-frequency = <DT_FREQ_M(32)>; | ||
}; | ||
}; | ||
|
||
soc { | ||
ficr: ficr@ffc000 { | ||
compatible = "nordic,nrf-ficr"; | ||
reg = <0xffc000 0x1000>; | ||
#nordic,ficr-cells = <1>; | ||
}; | ||
|
||
sram0: memory@20000000 { | ||
compatible = "mmio-sram"; | ||
reg = <0x20000000 DT_SIZE_K(256)>; | ||
}; | ||
|
||
peripheral@40000000 { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
ranges = <0x0 0x40000000 0x10000000>; | ||
|
||
/* Common nRF54L15 peripheral description */ | ||
#include "nrf54l15_cpuapp_peripherals_ns.dtsi" | ||
}; | ||
}; | ||
}; | ||
|
||
&nvic { | ||
arm,num-irq-priority-bits = <3>; | ||
}; | ||
|
||
&rram_controller { | ||
rram0: rram@0 { | ||
/* | ||
* "1524 KB non-volatile memory (RRAM) and 256 KB RAM" | ||
* -- Product Specification | ||
* NB: 1524 = 1.5 * 1024 - 12 | ||
*/ | ||
reg = <0x0 DT_SIZE_K(1524)>; | ||
}; | ||
}; | ||
|
||
/* Disable by default to use GRTC */ | ||
&systick { | ||
status = "disabled"; | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The leds, buttons, and aliases, is there any way of sharing this code with the secure board?
I believe that for nrf53 this code is shared in a file called *_common.dtsi.
This DT code changes quite a lot and will be expensive to maintain, as it is also not well tested, resulting in user bug reports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that should be in a common file to make our future us more happy, but I'm also fine with creating a follow-up Jira task on this instead of fixing it in this big PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully agree that this is the correct approach but I decided not to put that in scope of this PR.
I created a follow up task: NCSDK-26632 which covers that exact part.