i.MX31: Add some enums and a couple helper functions to make dealing with pin muxing...
[kugel-rb.git] / firmware / target / arm / imx31 / app.lds
blob4ee7ac45d4040fa53cf33c7fa88972fea1abc0d2
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 - 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
22 #define DRAMORIG (0x0 + STUBOFFSET)
23 /* #define IRAMORIG 0x1FFFC000 */
24 #define IRAMORIG DRAMORIG
25 #define IRAM     DRAM
26 #define IRAMSIZE IRAM_SIZE
28 /* End of the audio buffer, where the codec buffer starts */
29 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
31 /* Where the codec buffer ends, and the plugin buffer starts */
32 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
34 MEMORY
36     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
37     DEVBSS : ORIGIN = CSD0_BASE_ADDR + (MEMORYSIZE * 0x100000 - 0x100000), \
38              LENGTH = 0x100000 - FRAME_SIZE - TTB_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     /DISCARD/ :
82     {
83         *(.eh_frame)
84     }
86     .vectors 0x0 :
87     {
88         _vectorsstart = .;
89         *(.vectors);
90         _vectorsend = .;
91     } AT> DRAM
93     _vectorscopy = LOADADDR(.vectors);
94     
95     .stack (NOLOAD) :
96     {
97        *(.stack)
98        stackbegin = .;
99        . += 0x2000;
100        stackend = .;
101     } > DRAM
102     
103     _sdmacodecopy = stackbegin;
105     .bss (NOLOAD) :
106     {
107        _edata = .;
108         *(.bss*)
109         *(.ibss)
110         *(COMMON)
111         . = ALIGN(0x4);
112        _end = .;
113     } > DRAM
115     .audiobuf (NOLOAD) :
116     {
117         . = ALIGN(0x4);
118         _audiobuffer = .;
119         audiobuffer = .;
120     } > DRAM
122     .audiobufend ENDAUDIOADDR (NOLOAD) :
123     {
124         audiobufend = .;
125         _audiobufend = .;
126     } > DRAM
128     .codec ENDAUDIOADDR (NOLOAD) :
129     {
130         codecbuf = .;
131         _codecbuf = .;
132     }
134     .plugin ENDADDR (NOLOAD) :
135     {
136         _pluginbuf = .;
137         pluginbuf = .;
138     }
139     
140     .sdma _pluginbuf : AT( _sdmacodecopy )
141     {
142         _sdmacodestart = .;
143         *(.sdmacode);
144         _sdmacodeend = .;
145     }
146     
147     .devbss (NOLOAD) :
148     {
149         _devbssdata = .;
150         *(.qharray)
151         *(.devbss*)
152         _devbssend = .;
153     } > DEVBSS