Skip to content

Commit c8aeb41

Browse files
wearyzenkartben
authored andcommitted
boards: arm: Enable MPS3 Corstone310 for userspace
What is the change? - MPS3 Corstone310 can now be used with userspace application. This is done by dividing flash into ITCM+ISRAM and using a bigger SRAM. Why do we need this change? - ITCM and DTCM for MPS3 Corstone310 are small (32KB) to build with userspace. So we need bigger flash and sram. We can use the bigger ISRAM as flash but, Cortex-M expects vector table to be in 1st few bytes of ITCM. So to build for userspace we distribute FLASH between ITCM and ISRAM while using SRAM as sram. Signed-off-by: Sudan Landge <[email protected]>
1 parent 47f5d1b commit c8aeb41

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

boards/arm/mps3/Kconfig.defconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2018-2021 Linaro Limited
2-
# Copyright 2024 Arm Limited and/or its affiliates <[email protected]>
2+
# Copyright 2024-2025 Arm Limited and/or its affiliates <[email protected]>
33
# SPDX-License-Identifier: Apache-2.0
44

55
if BOARD_MPS3_CORSTONE300_AN547 || BOARD_MPS3_CORSTONE300_AN552 || BOARD_MPS3_CORSTONE300_FVP || BOARD_MPS3_CORSTONE310_AN555 || BOARD_MPS3_CORSTONE310_FVP
@@ -19,4 +19,14 @@ config UART_INTERRUPT_DRIVEN
1919

2020
endif # SERIAL
2121

22+
if ROMSTART_RELOCATION_ROM && (BOARD_MPS3_CORSTONE310_AN555 || BOARD_MPS3_CORSTONE310_FVP)
23+
24+
config ROMSTART_REGION_ADDRESS
25+
default $(dt_nodelabel_reg_addr_hex,itcm)
26+
27+
config ROMSTART_REGION_SIZE
28+
default $(dt_nodelabel_reg_size_hex,itcm,0,k)
29+
30+
endif
31+
2232
endif

boards/arm/mps3/board.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ elseif(CONFIG_BOARD_MPS3_CORSTONE310_FVP OR CONFIG_BOARD_MPS3_CORSTONE310_FVP_NS
3737
set(ARMFVP_FLAGS
3838
# default is '0x11000000' but should match cpu<i>.INITSVTOR which is 0.
3939
-C mps3_board.sse300.iotss3_systemcontrol.INITSVTOR_RST=0
40+
# default is 0x8, this change is needed since we split flash into itcm
41+
# and sram and it reduces the number of available mpu regions causing a
42+
# few MPU tests to fail.
43+
-C cpu0.MPU_S=16
4044
)
4145
endif()
4246
endif()

boards/arm/mps3/mps3_corstone310_an555.dts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Arm Limited and/or its affiliates <[email protected]>
2+
* Copyright 2024-2025 Arm Limited and/or its affiliates <[email protected]>
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -20,8 +20,8 @@
2020
chosen {
2121
zephyr,console = &uart0;
2222
zephyr,shell-uart = &uart0;
23-
zephyr,sram = &dtcm;
24-
zephyr,flash = &itcm;
23+
zephyr,sram = &sram;
24+
zephyr,flash = &isram;
2525
};
2626

2727
cpus {

boards/arm/mps3/mps3_corstone310_an555_defconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Arm Limited and/or its affiliates <[email protected]>
1+
# Copyright 2024-2025 Arm Limited and/or its affiliates <[email protected]>
22
# SPDX-License-Identifier: Apache-2.0
33

44
CONFIG_RUNTIME_NMI=y
@@ -15,3 +15,5 @@ CONFIG_SERIAL=y
1515

1616
# Build a Secure firmware image
1717
CONFIG_TRUSTED_EXECUTION_SECURE=y
18+
# ROMSTART_REGION address and size are defined in Kconfig.defconfig
19+
CONFIG_ROMSTART_RELOCATION_ROM=y

boards/arm/mps3/mps3_corstone310_fvp.dts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Arm Limited and/or its affiliates <[email protected]>
2+
* Copyright 2024-2025 Arm Limited and/or its affiliates <[email protected]>
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -20,8 +20,8 @@
2020
chosen {
2121
zephyr,console = &uart0;
2222
zephyr,shell-uart = &uart0;
23-
zephyr,sram = &dtcm;
24-
zephyr,flash = &itcm;
23+
zephyr,sram = &sram;
24+
zephyr,flash = &isram;
2525
};
2626

2727
cpus {

boards/arm/mps3/mps3_corstone310_fvp_defconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Arm Limited and/or its affiliates <[email protected]>
1+
# Copyright 2024-2025 Arm Limited and/or its affiliates <[email protected]>
22
# SPDX-License-Identifier: Apache-2.0
33

44
CONFIG_RUNTIME_NMI=y
@@ -15,3 +15,5 @@ CONFIG_SERIAL=y
1515

1616
# Build a Secure firmware image
1717
CONFIG_TRUSTED_EXECUTION_SECURE=y
18+
# ROMSTART_REGION address and size are defined in Kconfig.defconfig
19+
CONFIG_ROMSTART_RELOCATION_ROM=y

0 commit comments

Comments
 (0)