]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
dde3b70d SG |
2 | /* |
3 | * Copyright (c) 2004-2008 Texas Instruments | |
4 | * | |
5 | * (C) Copyright 2002 | |
6 | * Gary Jennejohn, DENX Software Engineering, <[email protected]> | |
dde3b70d SG |
7 | */ |
8 | ||
bf433afd | 9 | #include <config.h> |
980d6a55 | 10 | #include <asm/psci.h> |
bf433afd | 11 | |
dde3b70d SG |
12 | OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") |
13 | OUTPUT_ARCH(arm) | |
14 | ENTRY(_start) | |
15 | SECTIONS | |
16 | { | |
c1352119 | 17 | #ifndef CONFIG_CMDLINE |
99e2fbcb | 18 | /DISCARD/ : { *(__u_boot_list_2_cmd_*) } |
c1352119 | 19 | #endif |
c5e954ec | 20 | #if defined(CONFIG_ARMV7_SECURE_BASE) && defined(CONFIG_ARMV7_NONSEC) |
d47cb0b6 | 21 | /* |
c5e954ec WD |
22 | * If CONFIG_ARMV7_SECURE_BASE is true, secure code will not |
23 | * bundle with u-boot, and code offsets are fixed. Secure zone | |
24 | * only needs to be copied from the loading address to | |
25 | * CONFIG_ARMV7_SECURE_BASE, which is the linking and running | |
26 | * address for secure code. | |
d47cb0b6 | 27 | * |
c5e954ec WD |
28 | * If CONFIG_ARMV7_SECURE_BASE is undefined, the secure zone will |
29 | * be included in u-boot address space, and some absolute address | |
30 | * were used in secure code. The absolute addresses of the secure | |
31 | * code also needs to be relocated along with the accompanying u-boot | |
32 | * code. | |
33 | * | |
34 | * So DISCARD is only for CONFIG_ARMV7_SECURE_BASE. | |
d47cb0b6 PF |
35 | */ |
36 | /DISCARD/ : { *(.rel._secure*) } | |
c5e954ec | 37 | #endif |
dde3b70d SG |
38 | . = 0x00000000; |
39 | ||
40 | . = ALIGN(4); | |
41 | .text : | |
42 | { | |
d026dec8 | 43 | *(.__image_copy_start) |
41623c91 | 44 | *(.vectors) |
b68d6712 | 45 | CPUDIR/start.o (.text*) |
7e21fbca AG |
46 | } |
47 | ||
48 | /* This needs to come before *(.text*) */ | |
49 | .__efi_runtime_start : { | |
50 | *(.__efi_runtime_start) | |
51 | } | |
52 | ||
53 | .efi_runtime : { | |
54 | *(.text.efi_runtime*) | |
55 | *(.rodata.efi_runtime*) | |
56 | *(.data.efi_runtime*) | |
57 | } | |
58 | ||
59 | .__efi_runtime_stop : { | |
60 | *(.__efi_runtime_stop) | |
61 | } | |
62 | ||
63 | .text_rest : | |
64 | { | |
b68d6712 | 65 | *(.text*) |
dde3b70d SG |
66 | } |
67 | ||
104d6fb6 | 68 | #ifdef CONFIG_ARMV7_NONSEC |
bf433afd | 69 | |
a1274cc9 | 70 | /* Align the secure section only if we're going to use it in situ */ |
792b2047 | 71 | .__secure_start |
a1274cc9 CYT |
72 | #ifndef CONFIG_ARMV7_SECURE_BASE |
73 | ALIGN(CONSTANT(COMMONPAGESIZE)) | |
74 | #endif | |
792b2047 | 75 | : { |
a1274cc9 CYT |
76 | KEEP(*(.__secure_start)) |
77 | } | |
78 | ||
bf433afd MZ |
79 | #ifndef CONFIG_ARMV7_SECURE_BASE |
80 | #define CONFIG_ARMV7_SECURE_BASE | |
b56e06d3 | 81 | #define __ARMV7_PSCI_STACK_IN_RAM |
bf433afd MZ |
82 | #endif |
83 | ||
bf433afd MZ |
84 | .secure_text CONFIG_ARMV7_SECURE_BASE : |
85 | AT(ADDR(.__secure_start) + SIZEOF(.__secure_start)) | |
86 | { | |
87 | *(._secure.text) | |
88 | } | |
89 | ||
a5aa7ff3 CYT |
90 | .secure_data : AT(LOADADDR(.secure_text) + SIZEOF(.secure_text)) |
91 | { | |
92 | *(._secure.data) | |
93 | } | |
94 | ||
2fe1281c | 95 | #ifdef CONFIG_ARMV7_PSCI |
a5aa7ff3 | 96 | .secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data), |
980d6a55 | 97 | CONSTANT(COMMONPAGESIZE)) (NOLOAD) : |
b56e06d3 | 98 | #ifdef __ARMV7_PSCI_STACK_IN_RAM |
980d6a55 CYT |
99 | AT(ADDR(.secure_stack)) |
100 | #else | |
a5aa7ff3 | 101 | AT(LOADADDR(.secure_data) + SIZEOF(.secure_data)) |
980d6a55 CYT |
102 | #endif |
103 | { | |
104 | KEEP(*(.__secure_stack_start)) | |
2fe1281c | 105 | |
980d6a55 CYT |
106 | /* Skip addreses for stack */ |
107 | . = . + CONFIG_ARMV7_PSCI_NR_CPUS * ARM_PSCI_STACK_SIZE; | |
2fe1281c | 108 | |
980d6a55 CYT |
109 | /* Align end of stack section to page boundary */ |
110 | . = ALIGN(CONSTANT(COMMONPAGESIZE)); | |
111 | ||
112 | KEEP(*(.__secure_stack_end)) | |
3eff6818 CYT |
113 | |
114 | #ifdef CONFIG_ARMV7_SECURE_MAX_SIZE | |
115 | /* | |
116 | * We are not checking (__secure_end - __secure_start) here, | |
117 | * as these are the load addresses, and do not include the | |
118 | * stack section. Instead, use the end of the stack section | |
119 | * and the start of the text section. | |
120 | */ | |
121 | ASSERT((. - ADDR(.secure_text)) <= CONFIG_ARMV7_SECURE_MAX_SIZE, | |
122 | "Error: secure section exceeds secure memory size"); | |
123 | #endif | |
980d6a55 CYT |
124 | } |
125 | ||
126 | #ifndef __ARMV7_PSCI_STACK_IN_RAM | |
127 | /* Reset VMA but don't allocate space if we have secure SRAM */ | |
128 | . = LOADADDR(.secure_stack); | |
2fe1281c MY |
129 | #endif |
130 | ||
b56e06d3 CYT |
131 | #endif |
132 | ||
980d6a55 | 133 | .__secure_end : AT(ADDR(.__secure_end)) { |
bf433afd MZ |
134 | *(.__secure_end) |
135 | LONG(0x1d1071c); /* Must output something to reset LMA */ | |
136 | } | |
137 | #endif | |
138 | ||
dde3b70d SG |
139 | . = ALIGN(4); |
140 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } | |
141 | ||
142 | . = ALIGN(4); | |
143 | .data : { | |
b68d6712 | 144 | *(.data*) |
dde3b70d SG |
145 | } |
146 | ||
147 | . = ALIGN(4); | |
148 | ||
149 | . = .; | |
dde3b70d | 150 | |
55675142 | 151 | . = ALIGN(4); |
99e2fbcb AS |
152 | __u_boot_list : { |
153 | KEEP(*(SORT(__u_boot_list*))); | |
55675142 MV |
154 | } |
155 | ||
dde3b70d SG |
156 | . = ALIGN(4); |
157 | ||
50149ea3 AG |
158 | .efi_runtime_rel_start : |
159 | { | |
160 | *(.__efi_runtime_rel_start) | |
161 | } | |
162 | ||
163 | .efi_runtime_rel : { | |
7e21fbca AG |
164 | *(.rel*.efi_runtime) |
165 | *(.rel*.efi_runtime.*) | |
50149ea3 AG |
166 | } |
167 | ||
168 | .efi_runtime_rel_stop : | |
169 | { | |
170 | *(.__efi_runtime_rel_stop) | |
171 | } | |
172 | ||
83ebd4a6 | 173 | . = ALIGN(4); |
50149ea3 | 174 | |
d026dec8 AA |
175 | .image_copy_end : |
176 | { | |
177 | *(.__image_copy_end) | |
178 | } | |
dde3b70d | 179 | |
47bd65ef AA |
180 | .rel_dyn_start : |
181 | { | |
182 | *(.__rel_dyn_start) | |
183 | } | |
184 | ||
dde3b70d | 185 | .rel.dyn : { |
dde3b70d | 186 | *(.rel*) |
47bd65ef AA |
187 | } |
188 | ||
189 | .rel_dyn_end : | |
190 | { | |
191 | *(.__rel_dyn_end) | |
dde3b70d SG |
192 | } |
193 | ||
d0b5d9da AA |
194 | .end : |
195 | { | |
196 | *(.__end) | |
197 | } | |
198 | ||
199 | _image_binary_end = .; | |
dde3b70d SG |
200 | |
201 | /* | |
202 | * Deprecated: this MMU section is used by pxa at present but | |
203 | * should not be used by new boards/CPUs. | |
204 | */ | |
205 | . = ALIGN(4096); | |
206 | .mmutable : { | |
207 | *(.mmutable) | |
208 | } | |
209 | ||
f84a7b8f AA |
210 | /* |
211 | * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c | |
212 | * __bss_base and __bss_limit are for linker only (overlay ordering) | |
213 | */ | |
214 | ||
3ebd1cbc AA |
215 | .bss_start __rel_dyn_start (OVERLAY) : { |
216 | KEEP(*(.__bss_start)); | |
f84a7b8f | 217 | __bss_base = .; |
3ebd1cbc AA |
218 | } |
219 | ||
f84a7b8f | 220 | .bss __bss_base (OVERLAY) : { |
b68d6712 | 221 | *(.bss*) |
dde3b70d | 222 | . = ALIGN(4); |
f84a7b8f | 223 | __bss_limit = .; |
3ebd1cbc | 224 | } |
0ce033d2 | 225 | |
f84a7b8f AA |
226 | .bss_end __bss_limit (OVERLAY) : { |
227 | KEEP(*(.__bss_end)); | |
dde3b70d SG |
228 | } |
229 | ||
d0b5d9da | 230 | .dynsym _image_binary_end : { *(.dynsym) } |
47ed5dd0 AA |
231 | .dynbss : { *(.dynbss) } |
232 | .dynstr : { *(.dynstr*) } | |
233 | .dynamic : { *(.dynamic*) } | |
234 | .plt : { *(.plt*) } | |
235 | .interp : { *(.interp*) } | |
2c67e0e7 | 236 | .gnu.hash : { *(.gnu.hash) } |
47ed5dd0 AA |
237 | .gnu : { *(.gnu*) } |
238 | .ARM.exidx : { *(.ARM.exidx*) } | |
b02bfc4d | 239 | .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } |
dde3b70d | 240 | } |