-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nrf noup] boards: nordic: nrf7002dk: Bring back NS variants
Non-secure variants for nRF7002 DK were removed from upstream in commit 10d4973. Revert these changes downstream, so that the NS variants are still available. Signed-off-by: Andrzej Głąbek <[email protected]>
- Loading branch information
Showing
12 changed files
with
283 additions
and
3 deletions.
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,11 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR | ||
CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR | ||
CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR | ||
CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND | ||
CONFIG_BOARD_ENABLE_CPUNET) | ||
zephyr_library() | ||
zephyr_library_sources(nrf5340_cpunet_reset.c) | ||
endif() |
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
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,76 @@ | ||
# nRF5340 DK nRF5340 board configuration | ||
|
||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_NRF7002DK_NRF5340_CPUAPP || \ | ||
BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ | ||
BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ | ||
BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS | ||
|
||
# By default, if we build for a Non-Secure version of the board, | ||
# force building with TF-M as the Secure Execution Environment. | ||
config BUILD_WITH_TFM | ||
default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ | ||
BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS | ||
|
||
if BUILD_WITH_TFM | ||
|
||
# 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 | ||
|
||
endif # BUILD_WITH_TFM | ||
|
||
# Code Partition: | ||
# | ||
# For the secure version of the board the firmware is linked at the beginning | ||
# of the flash, or into the code-partition defined in DT if it is intended to | ||
# be loaded by MCUboot. If the secure firmware is to be combined with a non- | ||
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always | ||
# be restricted to the size of its code partition. | ||
# | ||
# For the non-secure version of the board, the firmware | ||
# must be linked into the code-partition (non-secure) defined in DT, regardless. | ||
# Apply this configuration below by setting the Kconfig symbols used by | ||
# the linker according to the information extracted from DT partitions. | ||
|
||
# SRAM Partition: | ||
# | ||
# If the secure firmware is to be combined with a non-secure image | ||
# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always | ||
# be restricted to the secure image SRAM partition (sram-secure-partition). | ||
# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram | ||
# may be used by the image. | ||
# | ||
# For the non-secure version of the board, the firmware image SRAM is | ||
# always restricted to the allocated non-secure SRAM partition. | ||
# | ||
# Workaround for not being able to have commas in macro arguments | ||
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition | ||
DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition | ||
|
||
if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ | ||
TRUSTED_EXECUTION_SECURE | ||
|
||
config FLASH_LOAD_SIZE | ||
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) | ||
|
||
config SRAM_SIZE | ||
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) | ||
|
||
endif | ||
|
||
if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS | ||
|
||
config FLASH_LOAD_OFFSET | ||
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) | ||
|
||
config FLASH_LOAD_SIZE | ||
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) | ||
|
||
endif | ||
|
||
endif |
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
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
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
40 changes: 40 additions & 0 deletions
40
boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_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,40 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include <nordic/nrf5340_cpuappns_qkaa.dtsi> | ||
#include "nrf5340_cpuapp_common.dtsi" | ||
|
||
/ { | ||
model = "Nordic NRF5340 DK NRF5340 Application"; | ||
compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; | ||
|
||
chosen { | ||
zephyr,sram = &sram0_ns; | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &slot0_ns_partition; | ||
zephyr,entropy = &psa_rng; | ||
zephyr,wifi = &wlan0; | ||
}; | ||
|
||
psa_rng: psa-rng { | ||
compatible = "zephyr,psa-crypto-rng"; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
&qspi { | ||
nrf70: nrf7001@1 { | ||
compatible = "nordic,nrf7001-qspi"; | ||
status = "okay"; | ||
reg = <1>; | ||
qspi-frequency = <24000000>; | ||
qspi-quad-mode; | ||
|
||
#include "nrf70_common.dtsi" | ||
#include "nrf70_common_coex.dtsi" | ||
}; | ||
}; |
19 changes: 19 additions & 0 deletions
19
boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.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,19 @@ | ||
identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns | ||
name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- gnuarmemb | ||
- xtools | ||
- zephyr | ||
ram: 192 | ||
flash: 192 | ||
supported: | ||
- gpio | ||
- i2c | ||
- pwm | ||
- watchdog | ||
- usbd | ||
- usb_device | ||
- netif:openthread | ||
vendor: nordic |
27 changes: 27 additions & 0 deletions
27
boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_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,27 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# Enable hardware stack protection | ||
CONFIG_HW_STACK_PROTECTION=y | ||
|
||
# Enable TrustZone-M | ||
CONFIG_ARM_TRUSTZONE_M=y | ||
|
||
# This Board implies building Non-Secure firmware | ||
CONFIG_TRUSTED_EXECUTION_NONSECURE=y | ||
|
||
# enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# enable PINCTRL | ||
CONFIG_PINCTRL=y | ||
|
||
# Enable uart driver | ||
CONFIG_SERIAL=y | ||
|
||
# enable console | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=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,41 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include <nordic/nrf5340_cpuappns_qkaa.dtsi> | ||
#include "nrf5340_cpuapp_common.dtsi" | ||
|
||
/ { | ||
model = "Nordic NRF5340 DK NRF5340 Application"; | ||
compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; | ||
|
||
chosen { | ||
zephyr,sram = &sram0_ns_app; | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &slot0_ns_partition; | ||
zephyr,entropy = &psa_rng; | ||
zephyr,wifi = &wlan0; | ||
}; | ||
|
||
psa_rng: psa-rng { | ||
compatible = "zephyr,psa-crypto-rng"; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
&qspi { | ||
nrf70: nrf7002@1 { | ||
compatible = "nordic,nrf7002-qspi"; | ||
status = "okay"; | ||
reg = <1>; | ||
qspi-frequency = <24000000>; | ||
qspi-quad-mode; | ||
|
||
#include "nrf70_common.dtsi" | ||
#include "nrf70_common_coex.dtsi" | ||
#include "nrf70_common_5g.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,19 @@ | ||
identifier: nrf7002dk/nrf5340/cpuapp/ns | ||
name: NRF7002-DK-NRF5340-application-MCU-Non-Secure | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- gnuarmemb | ||
- xtools | ||
- zephyr | ||
ram: 192 | ||
flash: 192 | ||
supported: | ||
- gpio | ||
- i2c | ||
- pwm | ||
- watchdog | ||
- usbd | ||
- usb_device | ||
- netif:openthread | ||
vendor: nordic |
26 changes: 26 additions & 0 deletions
26
boards/nordic/nrf7002dk/nrf7002dk_nrf5340_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,26 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# Enable hardware stack protection | ||
CONFIG_HW_STACK_PROTECTION=y | ||
|
||
# Enable TrustZone-M | ||
CONFIG_ARM_TRUSTZONE_M=y | ||
|
||
# This Board implies building Non-Secure firmware | ||
CONFIG_TRUSTED_EXECUTION_NONSECURE=y | ||
|
||
# enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# enable PINCTRL | ||
CONFIG_PINCTRL=y | ||
|
||
# Enable uart driver | ||
CONFIG_SERIAL=y | ||
|
||
# enable console | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y |