1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11OUTPUT_ARCH(microblaze)
12ENTRY(microblaze_start)
13
14#include <asm/page.h>
15#include <asm-generic/vmlinux.lds.h>
16#include <asm/thread_info.h>
17
18#ifdef __MICROBLAZEEL__
19jiffies = jiffies_64;
20#else
21jiffies = jiffies_64 + 4;
22#endif
23
24SECTIONS {
25	. = CONFIG_KERNEL_START;
26	microblaze_start = CONFIG_KERNEL_BASE_ADDR;
27	.text : AT(ADDR(.text) - LOAD_OFFSET) {
28		_text = . ;
29		_stext = . ;
30		HEAD_TEXT
31		TEXT_TEXT
32		*(.fixup)
33		EXIT_TEXT
34		EXIT_CALL
35		SCHED_TEXT
36		LOCK_TEXT
37		KPROBES_TEXT
38		IRQENTRY_TEXT
39		. = ALIGN (4) ;
40		_etext = . ;
41	}
42
43	. = ALIGN (4) ;
44	__fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
45		_fdt_start = . ;		/* place for fdt blob */
46		*(__fdt_blob) ;			/* Any link-placed DTB */
47	        . = _fdt_start + 0x8000;	/* Pad up to 32kbyte */
48		_fdt_end = . ;
49	}
50
51	. = ALIGN(16);
52	RODATA
53	EXCEPTION_TABLE(16)
54	NOTES
55
56	/*
57	 * sdata2 section can go anywhere, but must be word aligned
58	 * and SDA2_BASE must point to the middle of it
59	 */
60	.sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
61		_ssrw = .;
62		. = ALIGN(PAGE_SIZE); /* page aligned when MMU used */
63		*(.sdata2)
64	. = ALIGN(8);
65	_essrw = .;
66	_ssrw_size = _essrw - _ssrw;
67	_KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
68	}
69
70	_sdata = . ;
71	RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
72	_edata = . ;
73
74	/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
75	. = ALIGN(8);
76	.sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
77		_ssro = .;
78		*(.sdata)
79	}
80
81	.sbss :	AT(ADDR(.sbss) - LOAD_OFFSET) {
82		_ssbss = .;
83		*(.sbss)
84		_esbss = .;
85		_essro = .;
86		_ssro_size = _essro - _ssro ;
87		_KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
88	}
89
90	. = ALIGN(PAGE_SIZE);
91	__init_begin = .;
92
93	INIT_TEXT_SECTION(PAGE_SIZE)
94
95	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
96		INIT_DATA
97	}
98
99	. = ALIGN(4);
100	.init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
101		__ivt_start = .;
102		*(.init.ivt)
103		__ivt_end = .;
104	}
105
106	.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
107		INIT_SETUP(0)
108	}
109
110	.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
111		INIT_CALLS
112	}
113
114	.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
115		CON_INITCALL
116	}
117
118	SECURITY_INIT
119
120	__init_end_before_initramfs = .;
121
122	.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
123		INIT_RAM_FS
124	}
125
126	__init_end = .;
127
128	.bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
129		/* page aligned when MMU used */
130		__bss_start = . ;
131			*(.bss*)
132			*(COMMON)
133		. = ALIGN (4) ;
134		__bss_stop = . ;
135	}
136	. = ALIGN(PAGE_SIZE);
137	_end = .;
138
139	DISCARDS
140}
141