summaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/kernel/vmlinux.lds.S
blob: a331cc90797c2c959dcf50876aa738915886e46c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
/*
 *	vmlinux.lds.S -- master linker script for m68knommu arch
 *
 *	(C) Copyright 2002-2004, Greg Ungerer <gerg@snapgear.com>
 *
 *	This ends up looking compilcated, because of the number of
 *	address variations for ram and rom/flash layouts. The real
 *	work of the linker script is all at the end, and reasonably
 *	strait forward.
 */

#include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>

/*
 *	Original Palm pilot (same for Xcopilot).
 *	There is really only a rom target for this.
 */
#ifdef CONFIG_PILOT3
#define	ROMVEC_START	0x10c00000
#define	ROMVEC_LENGTH	0x10400
#define	ROM_START	0x10c10400
#define	ROM_LENGTH	0xfec00
#define	ROM_END		0x10d00000
#define	RAMVEC_START	0x00000000
#define	RAMVEC_LENGTH	0x400
#define	RAM_START	0x10000400
#define	RAM_LENGTH	0xffc00
#define	RAM_END		0x10100000
#define _ramend	_ram_end_notused
#define	DATA_ADDR	RAM_START
#endif

/*
 *	Same setup on both the uCsimm and uCdimm.
 */
#if defined(CONFIG_UCSIMM) || defined(CONFIG_UCDIMM)
#ifdef CONFIG_RAMKERNEL
#define	ROMVEC_START	0x10c10000
#define	ROMVEC_LENGTH	0x400
#define	ROM_START	0x10c10400
#define	ROM_LENGTH	0x1efc00
#define	ROM_END		0x10e00000
#define	RAMVEC_START	0x00000000
#define	RAMVEC_LENGTH	0x400
#define	RAM_START	0x00020400
#define	RAM_LENGTH	0x7dfc00
#define	RAM_END		0x00800000
#endif
#ifdef CONFIG_ROMKERNEL
#define	ROMVEC_START	0x10c10000
#define	ROMVEC_LENGTH	0x400
#define	ROM_START	0x10c10400
#define	ROM_LENGTH	0x1efc00
#define	ROM_END		0x10e00000
#define	RAMVEC_START	0x00000000
#define	RAMVEC_LENGTH	0x400
#define	RAM_START	0x00020000
#define	RAM_LENGTH	0x600000
#define	RAM_END		0x00800000
#endif
#ifdef CONFIG_HIMEMKERNEL
#define	ROMVEC_START	0x00600000
#define	ROMVEC_LENGTH	0x400
#define	ROM_START	0x00600400
#define	ROM_LENGTH	0x1efc00
#define	ROM_END		0x007f0000
#define	RAMVEC_START	0x00000000
#define	RAMVEC_LENGTH	0x400
#define	RAM_START	0x00020000
#define	RAM_LENGTH	0x5e0000
#define	RAM_END		0x00600000
#endif
#endif

#ifdef CONFIG_DRAGEN2
#define	RAM_START	0x10000
#define	RAM_LENGTH	0x7f0000
#endif

#ifdef CONFIG_UCQUICC
#define	ROMVEC_START	0x00000000
#define	ROMVEC_LENGTH	0x404
#define	ROM_START	0x00000404
#define	ROM_LENGTH	0x1ff6fc
#define	ROM_END		0x00200000
#define	RAMVEC_START	0x00200000
#define	RAMVEC_LENGTH	0x404
#define	RAM_START	0x00200404
#define	RAM_LENGTH	0x1ff6fc
#define	RAM_END		0x00400000
#endif

/*
 *	The standard Arnewsh 5206 board only has 1MiB of ram. Not normally
 *	enough to be useful. Assume the user has fitted something larger,
 *	at least 4MiB in size. No point in not letting the kernel completely
 *	link, it will be obvious if it is too big when they go to load it.
 */
#if defined(CONFIG_ARN5206)
#define	RAM_START	0x10000
#define	RAM_LENGTH	0x3f0000
#endif

/*
 *	The Motorola 5206eLITE board only has 1MiB of static RAM.
 */
#if defined(CONFIG_ELITE)
#define	RAM_START	0x30020000
#define	RAM_LENGTH	0xe0000
#endif

/*
 *	All the Motorola eval boards have the same basic arrangement.
 *	The end of RAM will vary depending on how much ram is fitted,
 *	but this isn't important here, we assume at least 4MiB.
 */
#if defined(CONFIG_M5206eC3) || defined(CONFIG_M5249C3) || \
    defined(CONFIG_M5272C3) || defined(CONFIG_M5307C3) || \
    defined(CONFIG_ARN5307) || defined(CONFIG_M5407C3) || \
    defined(CONFIG_M5271EVB) || defined(CONFIG_M5275EVB) || \
    defined(CONFIG_M5235EVB)
#define	RAM_START	0x20000
#define	RAM_LENGTH	0x3e0000
#endif

/*
 *	The Freescale 5208EVB board has 32MB of RAM.
 */
#if defined(CONFIG_M5208EVB)
#define	RAM_START	0x40020000
#define	RAM_LENGTH	0x01fe0000
#endif

/*
 *	The senTec COBRA5272 board has nearly the same memory layout as 
 *	the M5272C3. We assume 16MiB ram.
 */
#if defined(CONFIG_COBRA5272)
#define RAM_START   0x20000
#define RAM_LENGTH  0xfe0000
#endif

#if defined(CONFIG_M5282EVB)
#define	RAM_START	0x10000
#define	RAM_LENGTH	0x3f0000
#endif

/*
 *	The senTec COBRA5282 board has the same memory layout as the M5282EVB.
 */
#if defined(CONFIG_COBRA5282)
#define  RAM_START   0x10000
#define  RAM_LENGTH  0x3f0000
#endif


/*
 *	The EMAC SoM-5282EM module.
 */
#if defined(CONFIG_SOM5282EM)
#define  RAM_START   0x10000
#define  RAM_LENGTH  0xff0000
#endif


/*
 *	These flash boot boards use all of ram for operation. Again the
 *	actual memory size is not important here, assume at least 4MiB.
 *	They currently have no support for running in flash.
 */
#if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
    defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \
    defined(CONFIG_HW_FEITH)
#define	RAM_START	0x400
#define	RAM_LENGTH	0x3ffc00
#endif

/*
 *	Sneha Boards mimimun memory
 *	The end of RAM will vary depending on how much ram is fitted,
 *	but this isn't important here, we assume at least 4MiB.
 */
#if defined(CONFIG_CPU16B)   
#define	RAM_START	0x20000
#define	RAM_LENGTH	0x3e0000
#endif

#if defined(CONFIG_MOD5272)
#define RAM_START	0x02000000
#define RAM_LENGTH	0x00800000
#define RAMVEC_START	0x20000000
#define RAMVEC_LENGTH	0x00000400
#endif

#if defined(CONFIG_RAMKERNEL)
#define	TEXT		ram
#define	DATA		ram
#define	INIT		ram
#define	BSS		ram
#endif
#if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
#define	TEXT		rom
#define	DATA		ram
#define	INIT		ram
#define	BSS		ram
#endif

#ifndef DATA_ADDR
#define	DATA_ADDR
#endif


OUTPUT_ARCH(m68k)
ENTRY(_start)

MEMORY {
#ifdef RAMVEC_START
	ramvec	: ORIGIN = RAMVEC_START, LENGTH = RAMVEC_LENGTH
#endif
	ram	: ORIGIN = RAM_START, LENGTH = RAM_LENGTH
#ifdef RAM_END
	eram	: ORIGIN = RAM_END, LENGTH = 0
#endif
#ifdef ROM_START
	romvec	: ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
	rom	: ORIGIN = ROM_START, LENGTH = ROM_LENGTH
	erom	: ORIGIN = ROM_END, LENGTH = 0
#endif
}

jiffies = jiffies_64 + 4;

SECTIONS {

#ifdef ROMVEC_START
	. = ROMVEC_START ;
	.romvec : {
		__rom_start = . ;
		_romvec = .;
		*(.data.initvect)
	} > romvec
#endif

	.text : {
		_stext = . ;
        	*(.text)
		SCHED_TEXT
        	*(.text.lock)

		. = ALIGN(16);          /* Exception table              */
		__start___ex_table = .;
		*(__ex_table)
		__stop___ex_table = .;

		*(.rodata) *(.rodata.*)
		*(__vermagic)		/* Kernel version magic */
		*(.rodata1)
		*(.rodata.str1.1)

		/* Kernel symbol table: Normal symbols */
		. = ALIGN(4);
		__start___ksymtab = .;
		*(__ksymtab)
		__stop___ksymtab = .;

		/* Kernel symbol table: GPL-only symbols */
		__start___ksymtab_gpl = .;
		*(__ksymtab_gpl)
		__stop___ksymtab_gpl = .;

		/* Kernel symbol table: GPL-future symbols */
		__start___ksymtab_gpl_future = .;
		*(__ksymtab_gpl_future)
		__stop___ksymtab_gpl_future = .;

		/* Kernel symbol table: Normal symbols */
		__start___kcrctab = .;
		*(__kcrctab)
		__stop___kcrctab = .;

		/* Kernel symbol table: GPL-only symbols */
		__start___kcrctab_gpl = .;
		*(__kcrctab_gpl)
		__stop___kcrctab_gpl = .;

		/* Kernel symbol table: GPL-future symbols */
		__start___kcrctab_gpl_future = .;
		*(__kcrctab_gpl_future)
		__stop___kcrctab_gpl_future = .;

		/* Kernel symbol table: strings */
		*(__ksymtab_strings)

		/* Built-in module parameters */
		. = ALIGN(4) ;
		__start___param = .;
		*(__param)
		__stop___param = .;

		. = ALIGN(4) ;
		_etext = . ;
	} > TEXT

#ifdef ROM_END
	. = ROM_END ;
	.erom : {
		__rom_end = . ;
	} > erom
#endif
#ifdef RAMVEC_START
	. = RAMVEC_START ;
	.ramvec : {
		__ramvec = .;
	} > ramvec
#endif

	.data DATA_ADDR : {
		. = ALIGN(4);
		_sdata = . ;
		*(.data)
		. = ALIGN(8192) ;
		*(.data.init_task)
		_edata = . ;
	} > DATA

	.init : {
		. = ALIGN(4096);
		__init_begin = .;
		_sinittext = .;
		*(.init.text)
		_einittext = .;
		*(.init.data)
		. = ALIGN(16);
		__setup_start = .;
		*(.init.setup)
		__setup_end = .;
		__initcall_start = .;
		*(.initcall1.init)
		*(.initcall2.init)
		*(.initcall3.init)
		*(.initcall4.init)
		*(.initcall5.init)
		*(.initcall6.init)
		*(.initcall7.init)
		__initcall_end = .;
		__con_initcall_start = .;
		*(.con_initcall.init)
		__con_initcall_end = .;
		__security_initcall_start = .;
		*(.security_initcall.init)
		__security_initcall_end = .;
		. = ALIGN(4);
		__initramfs_start = .;
		*(.init.ramfs)
		__initramfs_end = .;
		. = ALIGN(4096);
		__init_end = .;
	} > INIT

	/DISCARD/ : {
		*(.exit.text)
		*(.exit.data)
		*(.exitcall.exit)
	}

	.bss : {
		. = ALIGN(4);
		_sbss = . ;
		*(.bss)
		*(COMMON)
		. = ALIGN(4) ;
		_ebss = . ;
	} > BSS

#ifdef RAM_END
	. = RAM_END ;
	.eram : {
		__ramend = . ;
		_ramend = . ;
	} > eram
#endif
}