Commit c8aeb41e authored by Sudan Landge's avatar Sudan Landge Committed by Benjamin Cabé
Browse files

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: default avatarSudan Landge <sudan.landge@arm.com>
parent 47f5d1b8
Loading
Loading
Loading
Loading
+11 −1
Changes for boards/arm/mps3/Kconfig.defconfig: 11 added lines, 1 removed line.
Original line number Diff line number Diff line
# Copyright (c) 2018-2021 Linaro Limited
# Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
# Copyright 2024-2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
# SPDX-License-Identifier: Apache-2.0

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

endif # SERIAL

if ROMSTART_RELOCATION_ROM && (BOARD_MPS3_CORSTONE310_AN555 || BOARD_MPS3_CORSTONE310_FVP)

config ROMSTART_REGION_ADDRESS
	default $(dt_nodelabel_reg_addr_hex,itcm)

config ROMSTART_REGION_SIZE
	default $(dt_nodelabel_reg_size_hex,itcm,0,k)

endif

endif
+4 −0
Changes for boards/arm/mps3/board.cmake: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ elseif(CONFIG_BOARD_MPS3_CORSTONE310_FVP OR CONFIG_BOARD_MPS3_CORSTONE310_FVP_NS
    set(ARMFVP_FLAGS
      # default is '0x11000000' but should match cpu<i>.INITSVTOR which is 0.
      -C mps3_board.sse300.iotss3_systemcontrol.INITSVTOR_RST=0
      # default is 0x8, this change is needed since we split flash into itcm
      # and sram and it reduces the number of available mpu regions causing a
      # few MPU tests to fail.
      -C cpu0.MPU_S=16
    )
  endif()
endif()
+3 −3
Changes for boards/arm/mps3/mps3_corstone310_an555.dts: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
/*
 * Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
 * Copyright 2024-2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
 *
 * SPDX-License-Identifier: Apache-2.0
 */
@@ -20,8 +20,8 @@
	chosen {
		zephyr,console = &uart0;
		zephyr,shell-uart = &uart0;
		zephyr,sram = &dtcm;
		zephyr,flash = &itcm;
		zephyr,sram = &sram;
		zephyr,flash = &isram;
	};

	cpus {
+3 −1
Changes for boards/arm/mps3/mps3_corstone310_an555_defconfig: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
# Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
# Copyright 2024-2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
# SPDX-License-Identifier: Apache-2.0

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

# Build a Secure firmware image
CONFIG_TRUSTED_EXECUTION_SECURE=y
# ROMSTART_REGION address and size are defined in Kconfig.defconfig
CONFIG_ROMSTART_RELOCATION_ROM=y
+3 −3
Changes for boards/arm/mps3/mps3_corstone310_fvp.dts: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
/*
 * Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
 * Copyright 2024-2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
 *
 * SPDX-License-Identifier: Apache-2.0
 */
@@ -20,8 +20,8 @@
	chosen {
		zephyr,console = &uart0;
		zephyr,shell-uart = &uart0;
		zephyr,sram = &dtcm;
		zephyr,flash = &itcm;
		zephyr,sram = &sram;
		zephyr,flash = &isram;
	};

	cpus {
Loading