1 | /*===============================================================*\ |
---|
2 | | Project: RTEMS generic mcf548x BSP | |
---|
3 | +-----------------------------------------------------------------+ |
---|
4 | | File: linkcmd.m5484FireEngine.flash | |
---|
5 | +-----------------------------------------------------------------+ |
---|
6 | | The file contains the linker directives for the generic MCF548x | |
---|
7 | | BSP to be used with an m5484FireEngine EVB to load and execute | |
---|
8 | | code in the boot FLASH. | |
---|
9 | +-----------------------------------------------------------------+ |
---|
10 | | Copyright (c) 2007 | |
---|
11 | | Embedded Brains GmbH | |
---|
12 | | Obere Lagerstr. 30 | |
---|
13 | | D-82178 Puchheim | |
---|
14 | | Germany | |
---|
15 | | rtems@embedded-brains.de | |
---|
16 | +-----------------------------------------------------------------+ |
---|
17 | | | |
---|
18 | | Parts of the code has been derived from the "dBUG source code" | |
---|
19 | | package Freescale is providing for M548X EVBs. The usage of | |
---|
20 | | the modified or unmodified code and it's integration into the | |
---|
21 | | generic mcf548x BSP has been done according to the Freescale | |
---|
22 | | license terms. | |
---|
23 | | | |
---|
24 | | The Freescale license terms can be reviewed in the file | |
---|
25 | | | |
---|
26 | | Freescale_license.txt | |
---|
27 | | | |
---|
28 | +-----------------------------------------------------------------+ |
---|
29 | | | |
---|
30 | | The generic mcf548x BSP has been developed on the basic | |
---|
31 | | structures and modules of the av5282 BSP. | |
---|
32 | | | |
---|
33 | +-----------------------------------------------------------------+ |
---|
34 | | | |
---|
35 | | The license and distribution terms for this file may be | |
---|
36 | | found in the file LICENSE in this distribution or at | |
---|
37 | | | |
---|
38 | | http://www.rtems.com/license/LICENSE. | |
---|
39 | | | |
---|
40 | +-----------------------------------------------------------------+ |
---|
41 | | | |
---|
42 | | date history ID | |
---|
43 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
---|
44 | | 12.11.07 1.0 ras | |
---|
45 | | | |
---|
46 | \*===============================================================*/ |
---|
47 | |
---|
48 | /* |
---|
49 | * Location and size of on-chip devices |
---|
50 | */ |
---|
51 | _SdramBase = DEFINED(_SdramBase) ? _SdramBase : 0x00000000; |
---|
52 | _SdramSize = DEFINED(_SdramSize) ? _SdramSize : (64 * 1024 * 1024); |
---|
53 | _SysSramBase = DEFINED(_SysSramBase) ? _SysSramBase : __MBAR + 0x00010000; |
---|
54 | _SysSramSize = DEFINED(_SysSramSize) ? _SysSramSize : (32 * 1024); |
---|
55 | _McdapiBase = DEFINED(_McdapiBase) ? _McdapiBase : _SysSramBase; |
---|
56 | _McdapiSize = DEFINED(_McdapiSize) ? _McdapiSize : (12 * 1024); |
---|
57 | _CoreSramBase0 = DEFINED(_CoreSramBase0) ? _CoreSramBase0 : 0x20000000; |
---|
58 | _CoreSramBase1 = DEFINED(_CoreSramBase1) ? _CoreSramBase1 : 0x20001000; |
---|
59 | _CoreSramSize0 = DEFINED(_CoreSramSize0) ? _CoreSramSize0 : (4 * 1024); |
---|
60 | _CoreSramSize1 = DEFINED(_CoreSramSize1) ? _CoreSramSize1 : (4 * 1024); |
---|
61 | _BootFlashBase = DEFINED(_BootFlashBase) ? _BootFlashBase : 0xFF800000; |
---|
62 | _BootFlashSize = DEFINED(_BootFlashSize) ? _BootFlashSize : (2 * 1024 * 1024); |
---|
63 | _CodeFlashBase = DEFINED(_CodeFlashBase) ? _CodeFlashBase : 0xE0000000; |
---|
64 | _CodeFlashSize = DEFINED(_CodeFlashSize) ? _CodeFlashSize : (16 * 1024 * 1024); |
---|
65 | |
---|
66 | _VectorRam = DEFINED(_VectorRam) ? _VectorRam : _SdramBase; |
---|
67 | _DataRam = DEFINED(_DataRam) ? _DataRam : _data_dest_start; |
---|
68 | _DataRom = DEFINED(_DataRom) ? _DataRom : _data_src_start; |
---|
69 | _DataEnd = DEFINED(_DataEnd) ? _DataEnd : _data_dest_end; |
---|
70 | _BssStart = DEFINED(_BssStart) ? _BssStart : _clear_start; |
---|
71 | _BssEnd = DEFINED(_BssEnd) ? _BssEnd : _clear_end; |
---|
72 | _SpInit = DEFINED(_SpInit) ? _SpInit : _EndInitStackSpace; |
---|
73 | _InitPc = DEFINED(_InitPc) ? _InitPc : _SdramBase + 0x400; |
---|
74 | |
---|
75 | _InitStackSize = DEFINED(StackSize) ? StackSize : 0x2000; /* 8 kB */ |
---|
76 | _TopRamReserved = DEFINED(_TopRamReserved) ? _TopRamReserved : 0; |
---|
77 | |
---|
78 | _RamBase = DEFINED(_SdramBase) ? _SdramBase : _SdramBase; |
---|
79 | _RamSize = DEFINED(_SdramSize) ? _SdramSize : _SdramSize; |
---|
80 | _VBR = DEFINED(_VBR) ? _VBR : _RamBase; |
---|
81 | |
---|
82 | __MBAR = DEFINED(__MBAR) ? __MBAR : 0x10000000; |
---|
83 | |
---|
84 | ENTRY(start) |
---|
85 | MEMORY |
---|
86 | { |
---|
87 | sdram : ORIGIN = 0x400 , LENGTH = 64M - 0x400 |
---|
88 | code_flash : ORIGIN = 0xE0000000, LENGTH = 16M |
---|
89 | boot_flash : ORIGIN = 0xFF800000, LENGTH = 2M |
---|
90 | } |
---|
91 | |
---|
92 | SECTIONS |
---|
93 | { |
---|
94 | |
---|
95 | _header_offset = 0; |
---|
96 | |
---|
97 | /* |
---|
98 | * Text, data and bss segments .vectors |
---|
99 | */ |
---|
100 | .vectors : { |
---|
101 | *(.vectors*) |
---|
102 | } >boot_flash |
---|
103 | .text : { |
---|
104 | |
---|
105 | *(.text*) |
---|
106 | *(.ram_code) |
---|
107 | |
---|
108 | /* |
---|
109 | * C++ constructors/destructors |
---|
110 | */ |
---|
111 | *(.gnu.linkonce.t.*) |
---|
112 | |
---|
113 | /* |
---|
114 | * Initialization and finalization code. |
---|
115 | * |
---|
116 | * Various files can provide initialization and finalization |
---|
117 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
118 | * body of these functions are in .init and .fini sections. We |
---|
119 | * accumulate the bodies here, and prepend function prologues |
---|
120 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
121 | * be linked first; crtn.o must be linked last. Because these |
---|
122 | * are wildcards, it doesn't matter if the user does not |
---|
123 | * actually link against crti.o and crtn.o; the linker won't |
---|
124 | * look for a file to match a wildcard. The wildcard also |
---|
125 | * means that it doesn't matter which directory crti.o and |
---|
126 | * crtn.o are in. |
---|
127 | */ |
---|
128 | PROVIDE (_init = .); |
---|
129 | *crti.o(.init) |
---|
130 | *(.init) |
---|
131 | *crtn.o(.init) |
---|
132 | PROVIDE (_fini = .); |
---|
133 | *crti.o(.fini) |
---|
134 | *(.fini) |
---|
135 | *crtn.o(.fini) |
---|
136 | |
---|
137 | /* |
---|
138 | * Special FreeBSD sysctl sections. |
---|
139 | */ |
---|
140 | . = ALIGN (16); |
---|
141 | __start_set_sysctl_set = .; |
---|
142 | *(set_sysctl_*); |
---|
143 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
144 | *(set_domain_*); |
---|
145 | *(set_pseudo_*); |
---|
146 | |
---|
147 | |
---|
148 | /* |
---|
149 | * C++ constructors/destructors |
---|
150 | * |
---|
151 | * gcc uses crtbegin.o to find the start of the constructors |
---|
152 | * and destructors so we make sure it is first. Because this |
---|
153 | * is a wildcard, it doesn't matter if the user does not |
---|
154 | * actually link against crtbegin.o; the linker won't look for |
---|
155 | * a file to match a wildcard. The wildcard also means that |
---|
156 | * it doesn't matter which directory crtbegin.o is in. The |
---|
157 | * constructor and destructor list are terminated in |
---|
158 | * crtend.o. The same comments apply to it. |
---|
159 | */ |
---|
160 | . = ALIGN (16); |
---|
161 | *crtbegin.o(.ctors) |
---|
162 | *(.ctors) |
---|
163 | *crtend.o(.ctors) |
---|
164 | *crtbegin.o(.dtors) |
---|
165 | *(.dtors) |
---|
166 | *crtend.o(.dtors) |
---|
167 | |
---|
168 | /* |
---|
169 | * Exception frame info |
---|
170 | */ |
---|
171 | . = ALIGN (16); |
---|
172 | *(.eh_frame) |
---|
173 | |
---|
174 | /* |
---|
175 | * Read-only data |
---|
176 | */ |
---|
177 | . = ALIGN (16); |
---|
178 | _rodata_start = . ; |
---|
179 | *(.rodata*) |
---|
180 | *(.gnu.linkonce.r*) |
---|
181 | |
---|
182 | . = ALIGN (16); |
---|
183 | |
---|
184 | *(.console_gdb_xfer) |
---|
185 | *(.bootstrap_data) |
---|
186 | . = ALIGN(16); |
---|
187 | _estuff = .; |
---|
188 | PROVIDE (_etext = .); |
---|
189 | } >boot_flash |
---|
190 | |
---|
191 | .data : AT(LOADADDR(.text) + SIZEOF(.text)) { |
---|
192 | /*.data : {*/ |
---|
193 | PROVIDE( _data_dest_start = . ); |
---|
194 | PROVIDE( _copy_start = .); |
---|
195 | *(.data*) |
---|
196 | *(.gnu.linkonce.d*) |
---|
197 | *(.gcc_except_table) |
---|
198 | *(.jcr) |
---|
199 | . = ALIGN (16); |
---|
200 | PROVIDE (_edata = .); |
---|
201 | PROVIDE (_copy_end = .); |
---|
202 | PROVIDE (_data_dest_end = . ); |
---|
203 | } >sdram |
---|
204 | |
---|
205 | _data_src_start = _etext; /*LOADADDR(.data);*/ |
---|
206 | _data_src_end = _data_src_start + SIZEOF(.data); |
---|
207 | |
---|
208 | .bss : { |
---|
209 | PROVIDE (_clear_start = .); |
---|
210 | *(.bss*) |
---|
211 | *(COMMON) |
---|
212 | . = ALIGN (16); |
---|
213 | PROVIDE (end = .); |
---|
214 | PROVIDE (_clear_end = .); |
---|
215 | . = ALIGN (4); |
---|
216 | PROVIDE (_StartInitStackSpace = .); |
---|
217 | /*. = _StartInitStackSpace + _InitStackSize;*/ |
---|
218 | . += _InitStackSize; |
---|
219 | PROVIDE (_EndInitStackSpace = .); |
---|
220 | PROVIDE (_WorkspaceBase = .); |
---|
221 | } >sdram |
---|
222 | /* Stabs debugging sections. */ |
---|
223 | .stab 0 : { *(.stab) } |
---|
224 | .stabstr 0 : { *(.stabstr) } |
---|
225 | .stab.excl 0 : { *(.stab.excl) } |
---|
226 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
227 | .stab.index 0 : { *(.stab.index) } |
---|
228 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
229 | .comment 0 : { *(.comment) } |
---|
230 | |
---|
231 | PROVIDE (end_of_all = .); |
---|
232 | } |
---|