Gigabeat S: Reclaim about 800K of memory that was laying unused. Get rid of DEVBSS_AT...
[kugel-rb.git] / firmware / target / arm / imx31 / app.lds
blob7043a55526cc1e6315792af7ea0f2361c70c78a3
1 #include "config.h"
3 ENTRY(start)
5 OUTPUT_FORMAT(elf32-littlearm)
6 OUTPUT_ARCH(arm)
7 STARTUP(target/arm/imx31/crt0.o)
9 #define PLUGINSIZE PLUGIN_BUFFER_SIZE
10 #define CODECSIZE CODEC_SIZE
12 #ifdef DEBUG
13 #define STUBOFFSET 0x10000
14 #else
15 #define STUBOFFSET 0
16 #endif
18 #include "imx31l.h"
19 /* Subtract 1MB for the FRAME/TTB section */
20 #define DRAMSIZE ((MEMORYSIZE * 0x100000) - STUBOFFSET - CODECSIZE - \
21                   PLUGINSIZE - QHARRAY_SIZE - FRAME_SIZE - TTB_SIZE)
23 #define DRAMORIG (0x0 + STUBOFFSET)
24 /* #define IRAMORIG 0x1FFFC000 */
25 #define IRAMORIG DRAMORIG
26 #define IRAM     DRAM
27 #define IRAMSIZE IRAM_SIZE
29 /* End of the audio buffer, where the codec buffer starts */
30 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
32 /* Where the codec buffer ends, and the plugin buffer starts */
33 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
35 MEMORY
37     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
38     QHARRAY : ORIGIN = QHARRAY_PHYS_ADDR, LENGTH = QHARRAY_SIZE
41 SECTIONS
43     .text :
44     {
45         loadaddress = .;
46         _loadaddress = .;
47         . = ALIGN(0x200);
48         *(.init.text)
49         *(.text*)
50         *(.icode)
51         *(.glue_7)
52         *(.glue_7t)
53         . = ALIGN(0x4);
54     } > DRAM
56     .rodata :
57     {
58         *(.rodata)  /* problems without this, dunno why */
59         *(.rodata*)
60         *(.rodata.str1.1)
61         *(.rodata.str1.4)
62         *(.irodata)
63         . = ALIGN(0x4);
65         /* Pseudo-allocate the copies of the data sections */
66         _datacopy = .;
67     } > DRAM
69     /* TRICK ALERT! For RAM execution, we put the .data section at the
70        same load address as the copy. Thus, we don't waste extra RAM
71        when we don't actually need the copy.  */
72     .data : AT ( _datacopy )
73     {
74         _datastart = .;
75         *(.data*)
76         *(.idata)
77         . = ALIGN(0x4);
78         _dataend  = .;
79     } > DRAM
81 #if 0 /* Unneeded at the moment */
82     /* .ncdata section is placed at uncached physical alias address and is
83      * loaded at the proper cached virtual address - no copying is
84      * performed in the init code */
85     .ncdata . + NOCACHE_BASE :
86     {
87         . = ALIGN(CACHEALIGN_SIZE); /* >= Cache line boundary */
88         *(.ncdata*)
89         . = ALIGN(CACHEALIGN_SIZE); /* >= Cache line boundary */
90     } AT> DRAM
91 #endif
92     /DISCARD/ :
93     {
94         *(.eh_frame)
95     }
97     .vectors 0x0 :
98     {
99         _vectorsstart = .;
100         *(.vectors);
101         _vectorsend = .;
102     } AT> DRAM
104     _vectorscopy = LOADADDR(.vectors);
105     
106     .stack (NOLOAD) :
107     {
108        *(.stack)
109        stackbegin = .;
110        . += 0x2000;
111        stackend = .;
112     } > DRAM
113     
114     _sdmacodecopy = stackbegin;
116     .bss (NOLOAD) :
117     {
118        _edata = .;
119         *(.bss*)
120         *(.ibss)
121         *(COMMON)
122         . = ALIGN(0x4);
123     } > DRAM
124     
125     .ncbss . + NOCACHE_BASE (NOLOAD) :
126     {
127         . = ALIGN(CACHEALIGN_SIZE); /* >= Cache line boundary */
128         *(.ncbss*)
129         . = ALIGN(CACHEALIGN_SIZE); /* >= Cache line boundary */
130     } AT> DRAM
131     
132     .endaddr . - NOCACHE_BASE (NOLOAD) :
133     {
134         _end = .;
135     } > DRAM
137     .audiobuf (NOLOAD) :
138     {
139         _audiobuffer = .;
140         audiobuffer = .;
141     } > DRAM
143     .audiobufend ENDAUDIOADDR (NOLOAD) :
144     {
145         audiobufend = .;
146         _audiobufend = .;
147     } > DRAM
149     .codec ENDAUDIOADDR (NOLOAD) :
150     {
151         codecbuf = .;
152         _codecbuf = .;
153     }
155     .plugin ENDADDR (NOLOAD) :
156     {
157         _pluginbuf = .;
158         pluginbuf = .;
159     }
160     
161     .sdma _pluginbuf : AT( _sdmacodecopy )
162     {
163         _sdmacodestart = .;
164         *(.sdmacode);
165         _sdmacodeend = .;
166     }
167     
168     .qharray (NOLOAD) :
169     {
170         _qharray = .;
171         *(.qharray)
172         _qharrayend = .;
173     } > QHARRAY