D2: Editing config.h wasn't enough to fully disable IRAM - also disable it in *.lds...
[Rockbox.git] / firmware / target / arm / tcc780x / app.lds
blobd62204a9a5fcec0d8227f21cb209e2b258f5febe
1 #include "config.h"
3 ENTRY(start)
5 OUTPUT_FORMAT(elf32-littlearm)
6 OUTPUT_ARCH(arm)
7 STARTUP(target/arm/tcc780x/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 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
20 #define DRAMORIG 0x20000000 + STUBOFFSET
21 #define ITCMORIG 0x00000000
22 #define ITCMSIZE 0x1000
23 #define DTCMORIG 0xA0000000
24 #define DTCMSIZE 0x2000
25 #define SRAMORIG 0x10000000
26 #define SRAMSIZE 0xc000
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     /* Seperate data & instruction TCMs plus SRAM. */
38     ITCM : ORIGIN = ITCMORIG, LENGTH = ITCMSIZE
39     DTCM : ORIGIN = DTCMORIG, LENGTH = DTCMSIZE
40     SRAM : ORIGIN = SRAMORIG, LENGTH = SRAMSIZE
43 SECTIONS
45     .text :
46     {
47         loadaddress = .;
48         _loadaddress = .;
49         . = ALIGN(0x200);
50         *(.init.text)
51         *(.text*)
52         *(.glue_7)
53         *(.glue_7t)
54         . = ALIGN(0x4);
55     } > DRAM
57     .rodata :
58     {
59         *(.rodata)  /* problems without this, dunno why */
60         *(.rodata*)
61         *(.rodata.str1.1)
62         *(.rodata.str1.4)
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         . = ALIGN(0x4);
77         _dataend  = .;
78     } > DRAM
80     /DISCARD/ :
81     {
82         *(.eh_frame)
83     }
85     .vectors ITCMORIG :
86     {
87         _vectorsstart = .;
88         *(.vectors);
89         _vectorsend = .;
90     } > ITCM AT> DRAM
92     _vectorscopy = LOADADDR(.vectors);
94     .itcm :
95     {
96         _itcmstart = .;
97         _itcmend = .;
98     } > ITCM AT> DRAM
100     _itcmcopy = LOADADDR(.itcm);
101     
102     .dtcm :
103     {
104         _dtcmstart = .;
105         _dtcmend = .;
106     } > DTCM AT> DRAM
108     _dtcmcopy = LOADADDR(.dtcm);
110     .iram :
111     {
112         _iramstart = .;
113         *(.irodata)
114         *(.idata)
115         *(.icode)
116         . = ALIGN(0x4);
117         _iramend = .;
118     /* } > SRAM AT> DRAM */
119     } > DRAM
121     _iramcopy = LOADADDR(.iram);
122     
123     .ibss (NOLOAD) :
124     {
125         _iedata = .;
126         *(.ibss)
127         . = ALIGN(0x4);
128         _iend = .;
129     /* } > SRAM */
130     } > DRAM
132     .stack :
133     {
134        *(.stack)
135        stackbegin = .;
136        . += 0x2000;
137        stackend = .;
138     /* } > SRAM */
139     } > DRAM
141     .bss :
142     {
143        _edata = .;
144         *(.bss*)
145         *(COMMON)
146         . = ALIGN(0x4);
147        _end = .;
148     } > DRAM
150     .audiobuf ALIGN(4) :
151     {
152         _audiobuffer = .;
153         audiobuffer = .;
154     } > DRAM
156     .audiobufend ENDAUDIOADDR:
157     {
158         audiobufend = .;
159         _audiobufend = .;
160     } > DRAM
162     .codec ENDAUDIOADDR:
163     {
164         codecbuf = .;
165         _codecbuf = .;
166     }
168     .plugin ENDADDR:
169     {
170         _pluginbuf = .;
171         pluginbuf = .;
172     }