8ba00a212ade7d8018e2e2115c1530596191c370
[linux-2.6.git] / arch / m68knommu / kernel / vmlinux.lds.S
1 /*
2  *      vmlinux.lds.S -- master linker script for m68knommu arch
3  *
4  *      (C) Copyright 2002-2004, Greg Ungerer <gerg@snapgear.com>
5  *
6  *      This ends up looking compilcated, because of the number of
7  *      address variations for ram and rom/flash layouts. The real
8  *      work of the linker script is all at the end, and reasonably
9  *      strait forward.
10  */
11
12 #include <linux/config.h>
13 #include <asm-generic/vmlinux.lds.h>
14
15 /*
16  *      Original Palm pilot (same for Xcopilot).
17  *      There is really only a rom target for this.
18  */
19 #ifdef CONFIG_PILOT3
20 #define ROMVEC_START    0x10c00000
21 #define ROMVEC_LENGTH   0x10400
22 #define ROM_START       0x10c10400
23 #define ROM_LENGTH      0xfec00
24 #define ROM_END         0x10d00000
25 #define RAMVEC_START    0x00000000
26 #define RAMVEC_LENGTH   0x400
27 #define RAM_START       0x10000400
28 #define RAM_LENGTH      0xffc00
29 #define RAM_END         0x10100000
30 #define _ramend _ram_end_notused
31 #define DATA_ADDR       RAM_START
32 #endif
33
34 /*
35  *      Same setup on both the uCsimm and uCdimm.
36  */
37 #if defined(CONFIG_UCSIMM) || defined(CONFIG_UCDIMM)
38 #ifdef CONFIG_RAMKERNEL
39 #define ROMVEC_START    0x10c10000
40 #define ROMVEC_LENGTH   0x400
41 #define ROM_START       0x10c10400
42 #define ROM_LENGTH      0x1efc00
43 #define ROM_END         0x10e00000
44 #define RAMVEC_START    0x00000000
45 #define RAMVEC_LENGTH   0x400
46 #define RAM_START       0x00020400
47 #define RAM_LENGTH      0x7dfc00
48 #define RAM_END         0x00800000
49 #endif
50 #ifdef CONFIG_ROMKERNEL
51 #define ROMVEC_START    0x10c10000
52 #define ROMVEC_LENGTH   0x400
53 #define ROM_START       0x10c10400
54 #define ROM_LENGTH      0x1efc00
55 #define ROM_END         0x10e00000
56 #define RAMVEC_START    0x00000000
57 #define RAMVEC_LENGTH   0x400
58 #define RAM_START       0x00020000
59 #define RAM_LENGTH      0x600000
60 #define RAM_END         0x00800000
61 #endif
62 #ifdef CONFIG_HIMEMKERNEL
63 #define ROMVEC_START    0x00600000
64 #define ROMVEC_LENGTH   0x400
65 #define ROM_START       0x00600400
66 #define ROM_LENGTH      0x1efc00
67 #define ROM_END         0x007f0000
68 #define RAMVEC_START    0x00000000
69 #define RAMVEC_LENGTH   0x400
70 #define RAM_START       0x00020000
71 #define RAM_LENGTH      0x5e0000
72 #define RAM_END         0x00600000
73 #endif
74 #endif
75
76 #ifdef CONFIG_DRAGEN2
77 #define RAM_START       0x10000
78 #define RAM_LENGTH      0x7f0000
79 #endif
80
81 #ifdef CONFIG_UCQUICC
82 #define ROMVEC_START    0x00000000
83 #define ROMVEC_LENGTH   0x404
84 #define ROM_START       0x00000404
85 #define ROM_LENGTH      0x1ff6fc
86 #define ROM_END         0x00200000
87 #define RAMVEC_START    0x00200000
88 #define RAMVEC_LENGTH   0x404
89 #define RAM_START       0x00200404
90 #define RAM_LENGTH      0x1ff6fc
91 #define RAM_END         0x00400000
92 #endif
93
94 /*
95  *      The standard Arnewsh 5206 board only has 1MiB of ram. Not normally
96  *      enough to be useful. Assume the user has fitted something larger,
97  *      at least 4MiB in size. No point in not letting the kernel completely
98  *      link, it will be obvious if it is too big when they go to load it.
99  */
100 #if defined(CONFIG_ARN5206)
101 #define RAM_START       0x10000
102 #define RAM_LENGTH      0x3f0000
103 #endif
104
105 /*
106  *      The Motorola 5206eLITE board only has 1MiB of static RAM.
107  */
108 #if defined(CONFIG_ELITE)
109 #define RAM_START       0x30020000
110 #define RAM_END         0xe0000
111 #endif
112
113 /*
114  *      All the Motorola eval boards have the same basic arrangement.
115  *      The end of RAM will vary depending on how much ram is fitted,
116  *      but this isn't important here, we assume at least 4MiB.
117  */
118 #if defined(CONFIG_M5206eC3) || defined(CONFIG_M5249C3) || \
119     defined(CONFIG_M5272C3) || defined(CONFIG_M5307C3) || \
120     defined(CONFIG_ARN5307) || defined(CONFIG_M5407C3) || \
121     defined(CONFIG_M5271EVB) || defined(CONFIG_M5275EVB)
122 #define RAM_START       0x20000
123 #define RAM_LENGTH      0x3e0000
124 #endif
125
126 /*
127  *   The senTec COBRA5272 board has nearly the same
128  *   memory layout as the M5272C3.
129  *   We assume 16MB ram.
130  */
131 #if defined(CONFIG_COBRA5272)
132 #define RAM_START   0x20000
133 #define RAM_LENGTH  0xfe0000
134 #endif
135
136 #if defined(CONFIG_M5282EVB)
137 #define RAM_START       0x10000
138 #define RAM_LENGTH      0x3f0000
139 #endif
140
141 /*
142  *   The senTec COBRA5282 board has the same
143  *   memory layout as the M5282EVB.
144  */
145 #if defined(CONFIG_COBRA5282)
146 #define  RAM_START   0x10000
147 #define  RAM_LENGTH  0x3f0000
148 #endif
149
150 /*
151  *      These flash boot boards use all of ram for operation. Again the
152  *      actual memory size is not important here, assume at least 4MiB.
153  *      They currently have no support for running in flash.
154  */
155 #if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
156     defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \
157     defined(CONFIG_HW_FEITH)
158 #define RAM_START       0x400
159 #define RAM_LENGTH      0x3ffc00
160 #endif
161
162 /*
163  *      Sneha Boards mimimun memmory
164  *      The end of RAM will vary depending on how much ram is fitted,
165  *      but this isn't important here, we assume at least 4MiB.
166  */
167 #if defined(CONFIG_CPU16B)   
168 #define RAM_START       0x20000
169 #define RAM_LENGTH      0x3e0000
170 #endif
171
172
173 #if defined(CONFIG_RAMKERNEL)
174 #define TEXT            ram
175 #define DATA            ram
176 #define INIT            ram
177 #define BSS             ram
178 #endif
179 #if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
180 #define TEXT            rom
181 #define DATA            ram
182 #define INIT            ram
183 #define BSS             ram
184 #endif
185
186 #ifndef DATA_ADDR
187 #define DATA_ADDR
188 #endif
189
190
191 OUTPUT_ARCH(m68k)
192 ENTRY(_start)
193
194 MEMORY {
195 #ifdef RAMVEC_START
196         ramvec  : ORIGIN = RAMVEC_START, LENGTH = RAMVEC_LENGTH
197 #endif
198         ram     : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
199 #ifdef RAM_END
200         eram    : ORIGIN = RAM_END, LENGTH = 0
201 #endif
202 #ifdef ROM_START
203         romvec  : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
204         rom     : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
205         erom    : ORIGIN = ROM_END, LENGTH = 0
206 #endif
207 }
208
209 jiffies = jiffies_64 + 4;
210
211 SECTIONS {
212
213 #ifdef ROMVEC_START
214         . = ROMVEC_START ;
215         .romvec : {
216                 __rom_start = . ;
217                 _romvec = .;
218                 *(.data.initvect)
219         } > romvec
220 #endif
221
222         .text : {
223                 _stext = . ;
224                 *(.text)
225                 SCHED_TEXT
226                 *(.text.lock)
227
228                 . = ALIGN(16);          /* Exception table              */
229                 __start___ex_table = .;
230                 *(__ex_table)
231                 __stop___ex_table = .;
232
233                 *(.rodata) *(.rodata.*)
234                 *(__vermagic)           /* Kernel version magic */
235                 *(.rodata1)
236                 *(.rodata.str1.1)
237
238                 /* Kernel symbol table: Normal symbols */
239                 . = ALIGN(4);
240                 __start___ksymtab = .;
241                 *(__ksymtab)
242                 __stop___ksymtab = .;
243
244                 /* Kernel symbol table: GPL-only symbols */
245                 __start___ksymtab_gpl = .;
246                 *(__ksymtab_gpl)
247                 __stop___ksymtab_gpl = .;
248
249                 /* Kernel symbol table: Normal symbols */
250                 __start___kcrctab = .;
251                 *(__kcrctab)
252                 __stop___kcrctab = .;
253
254                 /* Kernel symbol table: GPL-only symbols */
255                 __start___kcrctab_gpl = .;
256                 *(__kcrctab_gpl)
257                 __stop___kcrctab_gpl = .;
258
259                 /* Kernel symbol table: strings */
260                 *(__ksymtab_strings)
261
262                 /* Built-in module parameters */
263                 __start___param = .;
264                 *(__param)
265                 __stop___param = .;
266
267                 . = ALIGN(4) ;
268                 _etext = . ;
269         } > TEXT
270
271 #ifdef ROM_END
272         . = ROM_END ;
273         .erom : {
274                 __rom_end = . ;
275         } > erom
276 #endif
277 #ifdef RAMVEC_START
278         . = RAMVEC_START ;
279         .ramvec : {
280                 __ramvec = .;
281         } > ramvec
282 #endif
283
284         .data DATA_ADDR : {
285                 . = ALIGN(4);
286                 _sdata = . ;
287                 *(.data)
288                 . = ALIGN(8192) ;
289                 *(.data.init_task)
290                 _edata = . ;
291         } > DATA
292
293         .init : {
294                 . = ALIGN(4096);
295                 __init_begin = .;
296                 _sinittext = .;
297                 *(.init.text)
298                 _einittext = .;
299                 *(.init.data)
300                 . = ALIGN(16);
301                 __setup_start = .;
302                 *(.init.setup)
303                 __setup_end = .;
304                 __initcall_start = .;
305                 *(.initcall1.init)
306                 *(.initcall2.init)
307                 *(.initcall3.init)
308                 *(.initcall4.init)
309                 *(.initcall5.init)
310                 *(.initcall6.init)
311                 *(.initcall7.init)
312                 __initcall_end = .;
313                 __con_initcall_start = .;
314                 *(.con_initcall.init)
315                 __con_initcall_end = .;
316                 __security_initcall_start = .;
317                 *(.security_initcall.init)
318                 __security_initcall_end = .;
319                 . = ALIGN(4);
320                 __initramfs_start = .;
321                 *(.init.ramfs)
322                 __initramfs_end = .;
323                 . = ALIGN(4096);
324                 __init_end = .;
325         } > INIT
326
327         /DISCARD/ : {
328                 *(.exit.text)
329                 *(.exit.data)
330                 *(.exitcall.exit)
331         }
332
333         .bss : {
334                 . = ALIGN(4);
335                 _sbss = . ;
336                 *(.bss)
337                 *(COMMON)
338                 . = ALIGN(4) ;
339                 _ebss = . ;
340         } > BSS
341
342 #ifdef RAM_END
343         . = RAM_END ;
344         .eram : {
345                 __ramend = . ;
346                 _ramend = . ;
347         } > eram
348 #endif
349 }
350