aboutsummaryrefslogtreecommitdiff
path: root/arch/src/armv7-m/ld.S
diff options
context:
space:
mode:
authorChris Kay <chris.kay@arm.com>2018-09-27 12:08:34 +0100
committerronald-cron-arm <39518861+ronald-cron-arm@users.noreply.github.com>2018-10-08 17:49:02 +0200
commit1298e848970ff6ae4662d3da3c05099fdc81f956 (patch)
tree3252466e6002047fcb8897ae5ae362c78bd6717d /arch/src/armv7-m/ld.S
parent458ca4ec2ed2c646dde5706404c2098076c2e179 (diff)
arm: Move linker script configuration to independent header
This commit moves common linker script configuration options to an independent header file that is now included from both the Arm Compiler and LD linker scripts. Change-Id: I0ad252cfbbb28cc482a9612da0dac87bb8e9f471 Signed-off-by: Chris Kay <chris.kay@arm.com>
Diffstat (limited to 'arch/src/armv7-m/ld.S')
-rw-r--r--arch/src/armv7-m/ld.S79
1 files changed, 1 insertions, 78 deletions
diff --git a/arch/src/armv7-m/ld.S b/arch/src/armv7-m/ld.S
index 79a89296..7a36de0b 100644
--- a/arch/src/armv7-m/ld.S
+++ b/arch/src/armv7-m/ld.S
@@ -6,86 +6,9 @@
*
* Description:
* GNU LD linker script.
- *
- * There are three supported memory layouts for the ARMv7-M architecture:
- *
- * Layout 1 - Single region:
- * - All sections are placed in one contiguous region.
- * - This layout uses only the mem0 memory region.
- * - The memory is considered RXW by the linker, but the sections can be
- * configured later on with different attributes using the MPU.
- * - The main stack is placed at the end of mem0.
- * - This layout is mainly used by second-stage firmware that is loaded directly
- * into a single RAM.
- *
- * Layout 2 - Dual region with relocation:
- * - One region is used for .text and .data (storage).
- * - A second region is used for the remaining sections.
- * - This layout uses memory regions mem0 and mem1 as the first and second
- * regions, respectively.
- * - The main stack is placed at the end of mem1.
- * - This layout is mainly used by ROM firmware which uses part of the RAM for
- * the data sections.
- *
- * Layout 3 - Dual region without relocation
- * - One region is used only for the .text section.
- * - A second region is used for all data sections.
- * - This layout uses memory regions mem0 and mem1 as the first and second
- * regions, respectively.
- * - The main stack is placed at the end of mem1.
- * - The main difference from layout 2 is that there is no relocation of the
- * .data section.
- * - This layout is mainly used by second-stage firmware loaded directly into
- * two RAM regions. One of the RAM regions is attached to the instruction bus,
- * which improves the performance as data and instruction accesses are
- * independent.
- *
- */
-
-#define FWK_MEM_MODE_INVALID 0
-#define FWK_MEM_MODE_SINGLE_REGION 1
-#define FWK_MEM_MODE_DUAL_REGION_RELOCATION 2
-#define FWK_MEM_MODE_DUAL_REGION_NO_RELOCATION 3
-
-#include <fmw_memory.ld.S>
-
-/* Align the stack on an 8-byte boundary as CCR.STKALIGN is enabled */
-#define STACK_ALIGNMENT 8
-
-/* Align the heap on a 4-byte boundary to avoid unaligned accesses */
-#define HEAP_ALIGNMENT 4
-
-/*
- * Input validation
*/
-#ifndef FIRMWARE_MEM_MODE
- #error "FIRMWARE_MEM_MODE has not been configured"
-#endif
-
-#ifndef FIRMWARE_MEM0_BASE
- #error "FIRMWARE_MEM0_BASE has not been configured"
-#endif
-
-#ifndef FIRMWARE_MEM0_SIZE
- #error "FIRMWARE_MEM0_SIZE has not been configured"
-#endif
-
-#if ((FIRMWARE_MEM_MODE != FWK_MEM_MODE_SINGLE_REGION) && \
- (FIRMWARE_MEM_MODE != FWK_MEM_MODE_DUAL_REGION_RELOCATION) && \
- (FIRMWARE_MEM_MODE != FWK_MEM_MODE_DUAL_REGION_NO_RELOCATION))
- #error "FIRMWARE_MEM_MODE has been configured improperly"
-#endif
-
-#if FIRMWARE_MEM_MODE != FWK_MEM_MODE_SINGLE_REGION
- #ifndef FIRMWARE_MEM1_BASE
- #error "FIRMWARE_MEM1_BASE has not been configured"
- #endif
-
- #ifndef FIRMWARE_MEM1_SIZE
- #error "FIRMWARE_MEM1_SIZE has not been configured"
- #endif
-#endif
+#include "scatter.h"
ENTRY(arm_exception_reset)