Fix remote screen check in graphic equalizer, so that it can be used on logf-enabled...
[Rockbox.git] / firmware / boot.lds
blobf361e45e9e4cc17dd8c1dec542eef638386b311d
1 #include "config.h"
3 ENTRY(start)
4 #ifdef CPU_COLDFIRE
5 OUTPUT_FORMAT(elf32-m68k)
6 INPUT(target/coldfire/crt0.o)
7 #elif defined (CPU_ARM)
8 OUTPUT_FORMAT(elf32-littlearm)
9 OUTPUT_ARCH(arm)
10 #ifndef IPOD_ARCH
11 /* the ipods can't have the crt0.o mentioned here, but the others can't do
12    without it! */
13 #ifdef CPU_PP
14 INPUT(target/arm/crt0-pp.o)
15 #else
16 INPUT(target/arm/crt0.o)
17 #endif
18 #endif
19 #else
20 OUTPUT_FORMAT(elf32-sh)
21 INPUT(target/sh/crt0.o)
22 #endif
24 #define DRAMSIZE (MEMORYSIZE * 0x100000)
26 #ifdef IRIVER_H100_SERIES
27 #define DRAMORIG 0x31000000
28 #define IRAMORIG 0x10000000
29 #define IRAMSIZE 0x18000
30 #define FLASHORIG 0x001f0000
31 #define FLASHSIZE 2M
32 #elif defined(IRIVER_H300_SERIES)
33 #define DRAMORIG 0x31000000
34 #define IRAMORIG 0x10000000
35 #define IRAMSIZE 0x18000
36 #define FLASHORIG 0x003f0000
37 #define FLASHSIZE 4M
38 #elif defined(IAUDIO_X5)
39 #define DRAMORIG 0x31000000
40 #define IRAMORIG 0x10000000
41 #define IRAMSIZE 0x20000
42 #define FLASHORIG 0x00010000
43 #define FLASHSIZE 4M
44 #elif CONFIG_CPU == PP5020
45 #define DRAMORIG 0x10000000
46 #define IRAMORIG 0x40000000
47 #define IRAMSIZE 0x18000
48 #define FLASHORIG 0x001f0000
49 #define FLASHSIZE 2M
50 #elif CONFIG_CPU == PP5024
51 #define DRAMORIG 0x10000000
52 #define IRAMORIG 0x40000000
53 #define IRAMSIZE 0x18000
54 #define FLASHORIG 0x001f0000
55 #define FLASHSIZE 2M
56 #elif CONFIG_CPU == S3C2440
57 #define DRAMORIG 0x30000000
58 #define IRAMORIG 0x40000000
59 #define IRAMSIZE 4K
60 #define FLASHORIG 0x0000000
61 #define FLASHSIZE 1M
62 #elif CONFIG_CPU == PP5002
63 #define DRAMORIG 0x28000000
64 #define IRAMORIG 0x40000000
65 #define IRAMSIZE 0x18000
66 #define FLASHORIG 0x001f0000
67 #define FLASHSIZE 2M
68 #else
69 #define DRAMORIG 0x09000000
70 #define IRAMORIG 0x0f000000
71 #define IRAMSIZE 0x1000
72 #define FLASHORIG 0x02000000 + ROM_START
73 #define FLASHSIZE 256K - ROM_START
74 #endif
76 #if !defined(CPU_PP) && (CONFIG_CPU!=S3C2440)
77 MEMORY
79    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
80    IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
81    FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
83 #endif
85 SECTIONS
86 #ifdef CPU_PP
88   . = IRAMORIG;
90   .text : { 
91     *(.init.text)
92     *(.text)
93   }
95   .data : { 
96     *(.icode)
97     *(.irodata)
98     *(.idata)
99     *(.data)
100     _dataend = . ;
101    }
103   .stack :
104   {
105      *(.stack)
106      _stackbegin = .;
107      stackbegin = .;
108      . += 0x2000;
109      _stackend = .;
110      stackend = .;
111   }
113   /* The bss section is too large for IRAM - we just move it 16MB into the
114      DRAM */
116   . = (DRAMORIG+16*1024*1024);
117   .bss : {
118      _edata = .;
119      *(.bss);
120      *(.ibss);
121      _end = .;
122    }
124 #elif (CONFIG_CPU==S3C2440)
126   . = DRAMORIG + 0x8000;
127   .text : {
128     *(.init.text)
129     *(.text)
130   }
131   .data : {
132     *(.icode)
133     *(.irodata)
134     *(.idata)
135     *(.data)
136     _dataend = . ;
137    }
138   .stack :
139   {
140      *(.stack)
141      _stackbegin = .;
142      stackbegin = .;
143      . += 0x2000;
144      _stackend = .;
145      stackend = .;
146   }
147   .bss : {
148      _edata = .;
149      *(.bss);
150      *(.ibss);
151      _end = .;
152    }
154 #else
156     .vectors :
157     {
158 #ifdef IAUDIO_X5
159         *(.init.text)
160 #endif
161         _datacopy = .;
162     } > FLASH
164     .data : AT ( _datacopy )
165     {
166         _datastart = .;
167         *(.resetvectors);
168         *(.vectors);
169         . = ALIGN(0x200);
170         *(.icode)
171         *(.irodata)
172         *(.idata)
173         *(.data)
174         . = ALIGN(0x4);
175         _dataend = .;         
176         . = ALIGN(0x10);  /* Maintain proper alignment for .text section */
177     } > IRAM
178     
179     /* TRICK ALERT! Newer versions of the linker don't allow output sections
180        to overlap even if one of them is empty, so advance the location pointer
181        "by hand" */
182     .text LOADADDR(.data) + SIZEOF(.data) :
183     {
184         *(.init.text)
185         *(.text)
186         . = ALIGN(0x4);
187     } > FLASH
189     .rodata :
190     {
191         *(.rodata)
192         *(.rodata.str1.1)
193         *(.rodata.str1.4)
194         . = ALIGN(0x4);
195         _iramcopy = .;
196     } > FLASH
198     .stack :
199     {
200        *(.stack)
201        _stackbegin = .;
202        stackbegin = .;
203        . += 0x2000;
204        _stackend = .;
205        stackend = .;
206     } > IRAM
208 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) || defined(IAUDIO_X5)
209     .bss DRAMORIG+0x800000:
210 #else
211     .bss :
212 #endif
213     {
214        _edata = .;
215         *(.ibss)
216         *(.bss)
217         *(COMMON)
218        _end = .;
219 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) || defined(IAUDIO_X5)
220     } > DRAM
221 #else
222     } > IRAM
223 #endif
226 #endif