Skip to content

Commit 6ca9758

Browse files
nordicjmrlubos
authored andcommitted
[nrf fromtree] boards: nordic: Use dts for non-secure partitions
Replaces using an odd mix of Kconfig dts for partition offsets with just use dts for non-secure board targets Signed-off-by: Jamie McCrae <[email protected]> (cherry picked from commit e68f8e3)
1 parent 806fa89 commit 6ca9758

File tree

6 files changed

+18
-138
lines changed

6 files changed

+18
-138
lines changed

boards/nordic/nrf5340dk/Kconfig.defconfig

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2019-2020 Nordic Semiconductor ASA
44
# SPDX-License-Identifier: Apache-2.0
55

6-
if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
6+
if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
77

88
# Code Partition:
99
#
@@ -29,29 +29,19 @@ if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
2929
# For the non-secure version of the board, the firmware image SRAM is
3030
# always restricted to the allocated non-secure SRAM partition.
3131
#
32-
# Workaround for not being able to have commas in macro arguments
33-
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
34-
DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition
3532

3633
if BOARD_NRF5340DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE
3734

38-
config FLASH_LOAD_SIZE
39-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
35+
# Workaround for not being able to have commas in macro arguments
36+
DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition
4037

4138
config SRAM_SIZE
4239
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K)
4340

4441
endif # BOARD_NRF5340DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE
4542

46-
if BOARD_NRF5340DK_NRF5340_CPUAPP_NS
47-
48-
config FLASH_LOAD_OFFSET
49-
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
50-
51-
config FLASH_LOAD_SIZE
52-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
53-
54-
endif # BOARD_NRF5340DK_NRF5340_CPUAPP_NS
43+
config BOARD_NRF5340DK
44+
select USE_DT_CODE_PARTITION if BOARD_NRF5340DK_NRF5340_CPUAPP_NS
5545

5646
config BT_HCI_IPC
5747
default y if BT
@@ -60,8 +50,4 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD
6050
int
6151
default 4096 if BT_HCI_IPC
6252

63-
endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
64-
65-
if BOARD_NRF5340DK_NRF5340_CPUNET
66-
67-
endif # BOARD_NRF5340DK_NRF5340_CPUNET
53+
endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS

boards/nordic/nrf54l15dk/Kconfig.defconfig

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright (c) 2024 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Workaround for not being able to have commas in macro arguments
5-
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
6-
DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition
7-
84
if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \
95
BOARD_NRF54L15DK_NRF54L15_CPUAPP
106

@@ -17,15 +13,13 @@ endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP ||
1713

1814
if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS
1915

16+
config BOARD_NRF54L15DK
17+
select USE_DT_CODE_PARTITION if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || \
18+
BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS
19+
2020
config BT_CTLR
2121
default BT
2222

23-
config FLASH_LOAD_OFFSET
24-
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
25-
26-
config FLASH_LOAD_SIZE
27-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
28-
2923
# By default, if we build for a Non-Secure version of the board,
3024
# enable building with TF-M as the Secure Execution Environment.
3125
config BUILD_WITH_TFM

boards/nordic/nrf9131ek/Kconfig.defconfig

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,5 @@
33
# Copyright (c) 2023 Nordic Semiconductor ASA
44
# SPDX-License-Identifier: Apache-2.0
55

6-
if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS
7-
8-
# For the secure version of the board the firmware is linked at the beginning
9-
# of the flash, or into the code-partition defined in DT if it is intended to
10-
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
11-
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
12-
# be restricted to the size of its code partition.
13-
# For the non-secure version of the board, the firmware
14-
# must be linked into the code-partition (non-secure) defined in DT, regardless.
15-
# Apply this configuration below by setting the Kconfig symbols used by
16-
# the linker according to the information extracted from DT partitions.
17-
18-
# Workaround for not being able to have commas in macro arguments
19-
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
20-
21-
config FLASH_LOAD_SIZE
22-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
23-
depends on BOARD_NRF9131EK_NRF9131 && TRUSTED_EXECUTION_SECURE
24-
25-
if BOARD_NRF9131EK_NRF9131_NS
26-
27-
config FLASH_LOAD_OFFSET
28-
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
29-
30-
config FLASH_LOAD_SIZE
31-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
32-
33-
endif # BOARD_NRF9131EK_NRF9131_NS
34-
35-
endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS
6+
config BOARD_NRF9131EK
7+
select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS

boards/nordic/nrf9151dk/Kconfig.defconfig

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,8 @@
55

66
if BOARD_NRF9151DK_NRF9151 || BOARD_NRF9151DK_NRF9151_NS
77

8-
# For the secure version of the board the firmware is linked at the beginning
9-
# of the flash, or into the code-partition defined in DT if it is intended to
10-
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
11-
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
12-
# be restricted to the size of its code partition.
13-
# For the non-secure version of the board, the firmware
14-
# must be linked into the code-partition (non-secure) defined in DT, regardless.
15-
# Apply this configuration below by setting the Kconfig symbols used by
16-
# the linker according to the information extracted from DT partitions.
17-
18-
# Workaround for not being able to have commas in macro arguments
19-
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
20-
21-
config FLASH_LOAD_SIZE
22-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
23-
depends on BOARD_NRF9151DK_NRF9151 && TRUSTED_EXECUTION_SECURE
24-
25-
if BOARD_NRF9151DK_NRF9151_NS
26-
27-
config FLASH_LOAD_OFFSET
28-
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
29-
30-
config FLASH_LOAD_SIZE
31-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
32-
33-
endif # BOARD_NRF9151DK_NRF9151_NS
8+
config BOARD_NRF9151DK
9+
select USE_DT_CODE_PARTITION if BOARD_NRF9151DK_NRF9151_NS
3410

3511
config BT_HCI_VS
3612
default y if BT

boards/nordic/nrf9160dk/Kconfig.defconfig

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,8 @@
55

66
if BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160_NS
77

8-
# For the secure version of the board the firmware is linked at the beginning
9-
# of the flash, or into the code-partition defined in DT if it is intended to
10-
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
11-
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
12-
# be restricted to the size of its code partition.
13-
# For the non-secure version of the board, the firmware
14-
# must be linked into the code-partition (non-secure) defined in DT, regardless.
15-
# Apply this configuration below by setting the Kconfig symbols used by
16-
# the linker according to the information extracted from DT partitions.
17-
18-
# Workaround for not being able to have commas in macro arguments
19-
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
20-
21-
config FLASH_LOAD_SIZE
22-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
23-
depends on BOARD_NRF9160DK_NRF9160 && TRUSTED_EXECUTION_SECURE
24-
25-
if BOARD_NRF9160DK_NRF9160_NS
26-
27-
config FLASH_LOAD_OFFSET
28-
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
29-
30-
config FLASH_LOAD_SIZE
31-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
32-
33-
endif # BOARD_NRF9160DK_NRF9160_NS
8+
config BOARD_NRF9160DK
9+
select USE_DT_CODE_PARTITION if BOARD_NRF9160DK_NRF9160_NS
3410

3511
config BT_HCI_VS
3612
default y if BT

boards/nordic/nrf9161dk/Kconfig.defconfig

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,8 @@
55

66
if BOARD_NRF9161DK_NRF9161 || BOARD_NRF9161DK_NRF9161_NS
77

8-
# For the secure version of the board the firmware is linked at the beginning
9-
# of the flash, or into the code-partition defined in DT if it is intended to
10-
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
11-
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
12-
# be restricted to the size of its code partition.
13-
# For the non-secure version of the board, the firmware
14-
# must be linked into the code-partition (non-secure) defined in DT, regardless.
15-
# Apply this configuration below by setting the Kconfig symbols used by
16-
# the linker according to the information extracted from DT partitions.
17-
18-
# Workaround for not being able to have commas in macro arguments
19-
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
20-
21-
config FLASH_LOAD_SIZE
22-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
23-
depends on BOARD_NRF9161DK_NRF9161 && TRUSTED_EXECUTION_SECURE
24-
25-
if BOARD_NRF9161DK_NRF9161_NS
26-
27-
config FLASH_LOAD_OFFSET
28-
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
29-
30-
config FLASH_LOAD_SIZE
31-
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
32-
33-
endif # BOARD_NRF9161DK_NRF9161_NS
8+
config BOARD_NRF9161DK
9+
select USE_DT_CODE_PARTITION if BOARD_NRF9161DK_NRF9161_NS
3410

3511
config BT_HCI_VS
3612
default y if BT

0 commit comments

Comments
 (0)