From 3df6375cca5834a4aa73d34b95ca4464751c07f7 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Thu, 16 Sep 2021 09:42:22 +0000 Subject: [PATCH] MP1 startup support, not complete. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14774 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- .../compilers/GCC/ld/STM32MP15yx_RAM.ld | 87 +++++++++++++++++++ .../compilers/GCC/mk/startup_stm32mp15x.mk | 18 ++++ 2 files changed, 105 insertions(+) create mode 100644 os/common/startup/ARMCMx/compilers/GCC/ld/STM32MP15yx_RAM.ld create mode 100644 os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32mp15x.mk diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32MP15yx_RAM.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32MP15yx_RAM.ld new file mode 100644 index 000000000..dfd915116 --- /dev/null +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32MP15yx_RAM.ld @@ -0,0 +1,87 @@ +/* + ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32MP15yx memory setup. + * NOTE: Vectors in RETRAM, M4 application in SRAM1..SRAM4 combined, SYSRAM + * not used. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 0 + flash1 (rx) : org = 0x00000000, len = 0 + flash2 (rx) : org = 0x00000000, len = 0 + flash3 (rx) : org = 0x00000000, len = 0 + flash4 (rx) : org = 0x00000000, len = 0 + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x00000000, len = 64k /* RETRAM */ + ram1 (wx) : org = 0x10000000, len = 128k /* SRAM1 */ + ram2 (wx) : org = 0x10020000, len = 128k /* SRAM2 */ + ram3 (wx) : org = 0x10040000, len = 64k /* SRAM3 */ + ram4 (wx) : org = 0x10050000, len = 64k /* SRAM4 */ + ram5 (wx) : org = 0x10000000, len = 384k /* SRAM1+SRAM2+SRAM3+SRAM4 */ + ram6 (wx) : org = 0x2FFC0000, len = 256k /* SYSRAM */ + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", ram0); +REGION_ALIAS("VECTORS_FLASH_LMA", ram0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", ram5); +REGION_ALIAS("XTORS_FLASH_LMA", ram5); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", ram5); +REGION_ALIAS("TEXT_FLASH_LMA", ram5); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", ram5); +REGION_ALIAS("RODATA_FLASH_LMA", ram5); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", ram5); +REGION_ALIAS("VARIOUS_FLASH_LMA", ram5); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", ram5); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram5); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram5); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", ram5); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram5); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram5); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32mp15x.mk b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32mp15x.mk new file mode 100644 index 000000000..efa5b7aa1 --- /dev/null +++ b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32mp15x.mk @@ -0,0 +1,18 @@ +# List of the ChibiOS generic STM32MP15x startup and CMSIS files. +STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c + +STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ + $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S + +STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ + $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ + $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32MP15x \ + $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ + $(CHIBIOS)/os/common/ext/ST/STM32MP15x + +STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld + +# Shared variables +ALLXASMSRC += $(STARTUPASM) +ALLCSRC += $(STARTUPSRC) +ALLINC += $(STARTUPINC)