Skip to content

Commit 7220150

Browse files
mswarowskyjukkar
authored andcommitted
[nrf noup] soc: arm: nRF91: Add SPU Flash/RAM alignment
TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF91 The nRF54L15 doesn't use the SPU for setting the security attributes for flash/RAM regions. In order to avoid having multiple Kconfigs with similar meaning renamed the alignment Kconfig option to something more generic in order to use the same symbol for all the TrustZone enabled devices. Ref: NCSDK-25023 Signed-off-by: Markus Swarowsky <[email protected]> Signed-off-by: Georgios Vasilakis <[email protected]> (cherry picked from commit a562d96)
1 parent ef86bc5 commit 7220150

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

soc/nordic/nrf53/Kconfig

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,31 @@ config NRF_SPU_FLASH_REGION_SIZE
167167
help
168168
FLASH region size for the NRF_SPU peripheral
169169

170-
config NRF_SPU_FLASH_REGION_ALIGNMENT
170+
config NRF_TRUSTZONE_FLASH_REGION_SIZE
171171
hex
172-
default 0x4000
172+
default NRF_SPU_FLASH_REGION_SIZE
173173
help
174-
FLASH regions must be aligned to this value due to SPU HW
175-
limitations.
174+
Define the flash region size from a TrustZone perspective.
175+
This is used when we set the security attributes(S/NSC/NS) of a region
176+
in TrustZone enabled devices.
177+
In practice this option defines the granularity of the security attributes,
178+
i.e. the smallest region that can be set to secure or non-secure.
176179

177180
config NRF_SPU_RAM_REGION_SIZE
178181
hex
179182
default 0x2000
180183
help
181184
RAM region size for the NRF_SPU peripheral
182185

183-
config NRF_SPU_RAM_REGION_ALIGNMENT
186+
config NRF_TRUSTZONE_RAM_REGION_SIZE
184187
hex
185-
default 0x2000
188+
default NRF_SPU_RAM_REGION_SIZE
186189
help
187-
RAM regions must be aligned to this value due to SPU HW
188-
limitations.
190+
Define the RAM region size from a TrustZone perspective.
191+
This is used when we set the security attributes(S/NSC/NS) of a region
192+
in TrustZone enabled devices.
193+
In practice this option defines the granularity of the security attributes,
194+
i.e. the smallest region that can be set to secure or non-secure.
189195

190196
config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340
191197
bool "Forward GPIO pins to network core"

soc/nordic/nrf91/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ config NRF_SPU_FLASH_REGION_SIZE
2424
help
2525
FLASH region size for the NRF_SPU peripheral
2626

27+
config NRF_TRUSTZONE_FLASH_REGION_SIZE
28+
hex
29+
default NRF_SPU_FLASH_REGION_SIZE
30+
help
31+
Define the flash region size from a TrustZone perspective.
32+
This is used when we set the security attributes(S/NSC/NS) of a region
33+
in TrustZone enabled devices.
34+
In practice this option defines the granularity of the security attributes,
35+
i.e. the smallest region that can be set to secure or non-secure.
36+
2737
config NRF_SPU_RAM_REGION_SIZE
2838
hex
2939
default 0x2000
@@ -34,4 +44,14 @@ config NRF_ENABLE_ICACHE
3444
bool "Instruction cache (I-Cache)"
3545
default y
3646

47+
config NRF_TRUSTZONE_RAM_REGION_SIZE
48+
hex
49+
default NRF_SPU_RAM_REGION_SIZE
50+
help
51+
Define the RAM region size from a TrustZone perspective.
52+
This is used when we set the security attributes(S/NSC/NS) of a region
53+
in TrustZone enabled devices.
54+
In practice this option defines the granularity of the security attributes,
55+
i.e. the smallest region that can be set to secure or non-secure.
56+
3757
endif # SOC_SERIES_NRF91X

0 commit comments

Comments
 (0)