2 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
7 #include <platform_def.h>
8 #include <xlat_tables_defs.h>
10 OUTPUT_FORMAT(elf32-littlearm)
12 ENTRY(sp_min_vector_table)
15 RAM (rwx): ORIGIN = BL32_BASE, LENGTH = BL32_LIMIT - BL32_BASE
22 ASSERT(. == ALIGN(PAGE_SIZE),
23 "BL32_BASE address is not aligned on a page boundary.")
25 #if SEPARATE_CODE_AND_RODATA
39 /* Ensure 4-byte alignment for descriptors and ensure inclusion */
41 __RT_SVC_DESCS_START__ = .;
43 __RT_SVC_DESCS_END__ = .;
46 * Ensure 4-byte alignment for cpu_ops so that its fields are also
47 * aligned. Also ensure cpu_ops inclusion.
50 __CPU_OPS_START__ = .;
54 /* Place pubsub sections for events */
56 #include <pubsub_events.h>
68 /* Ensure 4-byte alignment for descriptors and ensure inclusion */
70 __RT_SVC_DESCS_START__ = .;
72 __RT_SVC_DESCS_END__ = .;
75 * Ensure 4-byte alignment for cpu_ops so that its fields are also
76 * aligned. Also ensure cpu_ops inclusion.
79 __CPU_OPS_START__ = .;
83 /* Place pubsub sections for events */
85 #include <pubsub_events.h>
88 __RO_END_UNALIGNED__ = .;
91 * Memory page(s) mapped to this section will be marked as
92 * read-only, executable. No RW data from the next section must
93 * creep in. Ensure the rest of the current memory block is unused.
100 ASSERT(__CPU_OPS_END__ > __CPU_OPS_START__,
101 "cpu_ops not defined for this platform.")
103 * Define a linker symbol to mark start of the RW memory area for this
115 __STACKS_START__ = .;
116 *(tzfw_normal_stacks)
121 * The .bss section gets initialised to 0 at runtime.
122 * Its base address should be 8-byte aligned for better performance of the
123 * zero-initialization code.
125 .bss (NOLOAD) : ALIGN(8) {
129 #if !USE_COHERENT_MEM
131 * Bakery locks are stored in normal .bss memory
133 * Each lock's data is spread across multiple cache lines, one per CPU,
134 * but multiple locks can share the same cache line.
135 * The compiler will allocate enough memory for one CPU's bakery locks,
136 * the remaining cache lines are allocated by the linker script
138 . = ALIGN(CACHE_WRITEBACK_GRANULE);
139 __BAKERY_LOCK_START__ = .;
141 . = ALIGN(CACHE_WRITEBACK_GRANULE);
142 __PERCPU_BAKERY_LOCK_SIZE__ = ABSOLUTE(. - __BAKERY_LOCK_START__);
143 . = . + (__PERCPU_BAKERY_LOCK_SIZE__ * (PLATFORM_CORE_COUNT - 1));
144 __BAKERY_LOCK_END__ = .;
145 #ifdef PLAT_PERCPU_BAKERY_LOCK_SIZE
146 ASSERT(__PERCPU_BAKERY_LOCK_SIZE__ == PLAT_PERCPU_BAKERY_LOCK_SIZE,
147 "PLAT_PERCPU_BAKERY_LOCK_SIZE does not match bakery lock requirements");
153 * Time-stamps are stored in normal .bss memory
155 * The compiler will allocate enough memory for one CPU's time-stamps,
156 * the remaining memory for other CPU's is allocated by the
159 . = ALIGN(CACHE_WRITEBACK_GRANULE);
160 __PMF_TIMESTAMP_START__ = .;
161 KEEP(*(pmf_timestamp_array))
162 . = ALIGN(CACHE_WRITEBACK_GRANULE);
163 __PMF_PERCPU_TIMESTAMP_END__ = .;
164 __PERCPU_TIMESTAMP_SIZE__ = ABSOLUTE(. - __PMF_TIMESTAMP_START__);
165 . = . + (__PERCPU_TIMESTAMP_SIZE__ * (PLATFORM_CORE_COUNT - 1));
166 __PMF_TIMESTAMP_END__ = .;
167 #endif /* ENABLE_PMF */
173 * The xlat_table section is for full, aligned page tables (4K).
174 * Removing them from .bss avoids forcing 4K alignment on
175 * the .bss section and eliminates the unecessary zero init
177 xlat_table (NOLOAD) : {
181 __BSS_SIZE__ = SIZEOF(.bss);
185 * The base address of the coherent memory section must be page-aligned (4K)
186 * to guarantee that the coherent data are stored on their own pages and
187 * are not mixed with normal data. This is required to set up the correct
188 * memory attributes for the coherent data page tables.
190 coherent_ram (NOLOAD) : ALIGN(PAGE_SIZE) {
191 __COHERENT_RAM_START__ = .;
193 * Bakery locks are stored in coherent memory
195 * Each lock's data is contiguous and fully allocated by the compiler
199 __COHERENT_RAM_END_UNALIGNED__ = .;
201 * Memory page(s) mapped to this section will be marked
202 * as device memory. No other unexpected data must creep in.
203 * Ensure the rest of the current memory page is unused.
206 __COHERENT_RAM_END__ = .;
209 __COHERENT_RAM_UNALIGNED_SIZE__ =
210 __COHERENT_RAM_END_UNALIGNED__ - __COHERENT_RAM_START__;
214 * Define a linker symbol to mark end of the RW memory area for this