aboutsummaryrefslogtreecommitdiff
path: root/arch/src/armv7-m/ld.S
diff options
context:
space:
mode:
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)