ath9k_htc: Update to upstream's commit d19607454d656cb14d8c16dfbf161eebb542e8fe dated...
[linux-libre-firmware.git] / ath9k_htc / target_firmware / ram-magpie.ld
1 /*
2  * Copyright (c) 2013 Qualcomm Atheros, Inc.
3  *
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted (subject to the limitations in the
8  * disclaimer below) provided that the following conditions are met:
9  *
10  *  * Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  *
13  *  * Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the
16  *    distribution.
17  *
18  *  * Neither the name of Qualcomm Atheros nor the names of its
19  *    contributors may be used to endorse or promote products derived
20  *    from this software without specific prior written permission.
21  *
22  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
23  * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
24  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
25  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  */
36
37 /* Linker script for Magpie RAM-based applications */
38
39 /*
40 Currently, ROM code reserves the first 8KB of RAM for its data/bss.
41 The next 12KB or RAM is used for RAM software's literals and read-only data.
42 After that comes 64KB reserved for RAM software's data and bss.
43 Then 92KB of RAM is reserved for text (code).
44 The last 8KB of RAM is reserved for ROM patches, customer DataSets,
45 and RAM software expansion. (There is also some additional RAM between
46 segments that can be used, if needed.)
47   ROM reserved: 0x00500000..0x00501fff
48   Literals:     0x00502000..0x00504fff
49   Data:         0x00505000..0x00514fff
50   Text:         0x00915000..0x0092bfff
51 TBD: May want to use a 2-pass link approach in order to
52 eliminate fixed boundaries.  Support for physical addressing
53 in Tensilica tools would be helpful, but it's not coming
54 any time soon.
55 */
56
57 /* dram_seg: 0x504000, see target.rom.ld */
58
59 /* ***** */
60 MEMORY
61 {
62  lit_seg :            org = 0x004E8000,   len = 0x1f600
63  iram_seg :           org = 0x00906000,   len = 0xad00
64  dram_seg :           org = 0x00510d00,   len = 0x6000
65  
66 }
67
68 PHDRS
69 {
70   lit_phdr PT_LOAD;
71   dram_phdr PT_LOAD;
72   iram_phdr PT_LOAD;
73 }
74
75 /*  Default entry point:  */
76 ENTRY(app_start)
77
78 SECTIONS
79 {
80   /*
81    * This empty section is used to convince RAM linkage
82    * to share litbase with ROM code.
83    */
84   .lit4 (NOLOAD) :
85   {
86     _rom_literal_start = ABSOLUTE(.);
87     . += 0x19000; /* Reserved virtual space for physical mem gap and ROM */
88     _lit4_start = ABSOLUTE(.);
89     _lit4_end = ABSOLUTE(.);
90     _rom_literal_end = ABSOLUTE(.);
91   } >lit_seg :NONE
92
93   .dport0.rodata :
94   {
95     _dport0_rodata_start = ABSOLUTE(.); /* 0x505000 */
96     *(.dport0.rodata)
97     *(.dport.rodata)
98     _dport0_rodata_end = ABSOLUTE(.);
99   } >lit_seg :lit_phdr
100
101   .dport0.literal :
102   {
103     _dport0_literal_start = ABSOLUTE(.);
104     *(.dport0.literal)
105     *(.dport.literal)
106     _dport0_literal_end = ABSOLUTE(.);
107   } >lit_seg :lit_phdr
108
109   .dram0.rodata :
110   {
111     _dram0_rodata_start = ABSOLUTE(.);
112     *(.dram0.rodata)
113     *(.dram.rodata)
114     _dram0_rodata_end = ABSOLUTE(.);
115   } >lit_seg :lit_phdr
116
117   .rodata :
118   {
119     _rodata_start = ABSOLUTE(.);
120     *(.rodata)
121     *(.rodata.*)
122     *(.gnu.linkonce.r.*)
123     *(.rodata1)
124     __XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
125     *(.xt_except_table)
126     *(.gcc_except_table)
127     *(.gnu.linkonce.e.*)
128     *(.gnu.version_r)
129     . = ALIGN(4);               /* this table MUST be 4-byte aligned */
130     _bss_table_start = ABSOLUTE(.);
131     LONG(_dport0_bss_start)
132     LONG(_dport0_bss_end)
133     LONG(_bss_start)
134     LONG(_bss_end)
135     _bss_table_end = ABSOLUTE(.);
136     _rodata_end = ABSOLUTE(.);
137   } >lit_seg :lit_phdr
138
139   .literals :
140   {
141     _literals_start = ABSOLUTE(.);
142     *(*.lit4)
143     *(.gnu.linkonce.lit4.*)
144     _literals_end = ABSOLUTE(.);
145   } >lit_seg :lit_phdr
146
147   .dram0.literal :
148   {
149     _dram0_literal_start = ABSOLUTE(.);
150     *(.dram0.literal)
151     *(.dram.literal)
152     _dram0_literal_end = ABSOLUTE(.);
153   } >lit_seg :lit_phdr
154
155   .dport0.data :
156   {
157     _dport0_data_start = ABSOLUTE(.);
158     *(.dport0.data)
159     *(.dport.data)
160     _dport0_data_end = ABSOLUTE(.);
161   } >dram_seg :dram_phdr
162
163   .dport0.bss :
164   {
165     . = ALIGN (8);
166     _dport0_bss_start = ABSOLUTE(.);
167     *(.dport0.bss)
168     . = ALIGN (8);
169     _dport0_bss_end = ABSOLUTE(.);
170   } >dram_seg :dram_phdr
171
172   .dram0.data :
173   {
174     _dram0_data_start = ABSOLUTE(.);
175     *(.dram0.data)
176     *(.dram.data)
177     _dram0_data_end = ABSOLUTE(.);
178   } >dram_seg :dram_phdr
179
180   .data :
181   {
182     _data_start = ABSOLUTE(.);
183     *(.data)
184     *(.data.*)
185     *(.gnu.linkonce.d.*)
186     *(.data1)
187     *(.sdata)
188     *(.sdata.*)
189     *(.gnu.linkonce.s.*)
190     *(.sdata2)
191     *(.sdata2.*)
192     *(.gnu.linkonce.s2.*)
193     *(.jcr)
194     *(.eh_frame)
195     /*  C++ constructor and destructor tables, properly ordered:  */
196     KEEP (*crtbegin.o(.ctors))
197     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
198     KEEP (*(SORT(.ctors.*)))
199     KEEP (*(.ctors))
200     KEEP (*crtbegin.o(.dtors))
201     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
202     KEEP (*(SORT(.dtors.*)))
203     KEEP (*(.dtors))
204     /*  C++ exception handlers table:  */
205     __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
206     *(.xt_except_desc)
207     *(.gnu.linkonce.h.*)
208     __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
209     *(.xt_except_desc_end)
210     *(.dynamic)
211     *(.gnu.version_d)
212     _data_end = ABSOLUTE(.);
213   } >dram_seg :dram_phdr
214
215   .bss :
216   {
217     . = ALIGN (8);
218     _bss_start = ABSOLUTE(.);
219     *(.dynsbss)
220     *(.sbss)
221     *(.sbss.*)
222     *(.gnu.linkonce.sb.*)
223     *(.scommon)
224     *(.sbss2)
225     *(.sbss2.*)
226     *(.gnu.linkonce.sb2.*)
227     *(.dynbss)
228     *(.bss)
229     *(.bss.*)
230     *(.gnu.linkonce.b.*)
231     *(COMMON)
232     *(.dram0.bss)
233     . = ALIGN (8);
234     _bss_end = ABSOLUTE(.);
235     _end = ALIGN(0x8);
236     PROVIDE(end = ALIGN(0x8));
237         _fw_image_end = ABSOLUTE(.);
238     /*_stack_sentry = ALIGN(0x8);*/
239   } >dram_seg :dram_phdr
240
241   .boot :
242     { *(.boot) } > iram_seg :iram_phdr
243
244   .text :
245   {
246     _stext = .;
247     _text_start = ABSOLUTE(.);
248     *(.entry.text)
249     *(.init.literal)
250     *(.init)
251     *(.literal .text .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
252     *(.fini.literal)
253     *(.fini)
254     *(.gnu.version)
255     _text_end = ABSOLUTE(.);
256     _etext = .;
257   } >iram_seg :iram_phdr
258
259   .iram0.text :
260   {
261     _iram0_text_start = ABSOLUTE(.);
262     *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text)
263     _iram0_text_end = ABSOLUTE(.);
264   } >iram_seg :iram_phdr
265
266   .debug  0 :  { *(.debug) }
267   .line  0 :  { *(.line) }
268   .debug_srcinfo  0 :  { *(.debug_srcinfo) }
269   .debug_sfnames  0 :  { *(.debug_sfnames) }
270   .debug_aranges  0 :  { *(.debug_aranges) }
271   .debug_pubnames  0 :  { *(.debug_pubnames) }
272   .debug_info  0 :  { *(.debug_info) }
273   .debug_abbrev  0 :  { *(.debug_abbrev) }
274   .debug_line  0 :  { *(.debug_line) }
275   .debug_frame  0 :  { *(.debug_frame) }
276   .debug_str  0 :  { *(.debug_str) }
277   .debug_loc  0 :  { *(.debug_loc) }
278   .debug_macinfo  0 :  { *(.debug_macinfo) }
279   .debug_weaknames  0 :  { *(.debug_weaknames) }
280   .debug_funcnames  0 :  { *(.debug_funcnames) }
281   .debug_typenames  0 :  { *(.debug_typenames) }
282   .debug_varnames  0 :  { *(.debug_varnames) }
283
284   .xt.insn 0 :
285   {
286     KEEP (*(.xt.insn))
287     KEEP (*(.gnu.linkonce.x.*))
288   }
289   .xt.prop 0 :
290   {
291     KEEP (*(.xt.prop))
292     KEEP (*(.gnu.linkonce.prop.*))
293   }
294   .xt.lit 0 :
295   {
296     KEEP (*(.xt.lit))
297     KEEP (*(.gnu.linkonce.p.*))
298   }
299 }