M:Robe 500i: More LCD initialization, and beginnings of support for QVGA as well...
[kugel-rb.git] / apps / plugins / plugin.lds
blob9c65f31779c68222678d4849d072a7e1d0d26b03
1 #include "config.h"
3 /* These output formats should be in the config-files */
5 #ifdef CPU_COLDFIRE
6 OUTPUT_FORMAT(elf32-m68k)
7 #elif defined(CPU_ARM)
8 OUTPUT_FORMAT(elf32-littlearm)
9 #elif defined(CPU_SH)
10 OUTPUT_FORMAT(elf32-sh)
11 #elif defined(CPU_MIPS)
12 OUTPUT_FORMAT(elf32-littlemips)
13 #else
14 /* We can have an #error here we don't use this file when build sims! */
15 #error Unknown CPU architecture
16 #endif
18 #ifdef DEBUG
19 #define STUBOFFSET 0x10000
20 #else
21 #define STUBOFFSET 0
22 #endif
24 #if defined(CPU_PP)
25 #ifdef CPU_PP502x
26 #define NOCACHE_BASE    0x10000000
27 #else
28 #define NOCACHE_BASE    0x28000000
29 #endif /* CPU_* */
30 #define CACHEALIGN_SIZE 16
31 #endif /* CPU_PP */
33 #ifndef NOCACHE_BASE
34 /* Default to no offset if target doesn't define this */
35 #define NOCACHE_BASE 0x00000000
36 #endif
38 #if CONFIG_CPU==DM320 || CONFIG_CPU==S3C2440
39 #define LCD_BUFFER_SIZE  (LCD_WIDTH*LCD_HEIGHT*2)
41 /* must be 16Kb (0x4000) aligned */
42 #define TTB_SIZE         (0x4000) 
43 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
44 #elif CONFIG_CPU==IMX31L
45 #include "imx31l.h"
46 /* Reserve 1mb for LCD buffer/TTB as in app.lds */
47 #define DRAMSIZE (MEMORYSIZE * 0x100000 - 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
48 #elif CONFIG_CPU==AS3525 && MEMORYSIZE <= 2
49 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET
50 #else
51 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
52 #endif
54 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
55 #define ARCH_IRIVER
56 #endif
58 #if defined(ARCH_IRIVER) || defined(IAUDIO_M3)
59 #define DRAMORIG 0x31000000
60 #define IRAMORIG 0x1000c000
61 #define IRAMSIZE 0xc000
62 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
63 #define DRAMORIG 0x31000000
64 #define IRAMORIG 0x10010000
65 #define IRAMSIZE 0x10000
66 #elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
67 /* PP5022/24 have 128KB of IRAM */
68 #define DRAMORIG 0x00000000
69 #define IRAMORIG 0x4000c000
70 #define IRAMSIZE 0x14000
71 #elif defined(CPU_PP)
72 /* all other PP's have 96KB of IRAM */
73 #define DRAMORIG 0x00000000
74 #define IRAMORIG 0x4000c000
75 #define IRAMSIZE 0x0c000
76 #elif CONFIG_CPU == PNX0101
77 #define DRAMORIG 0xc00000 + STUBOFFSET
78 #define IRAMORIG 0x407000
79 #define IRAMSIZE 0x9000
80 #elif CONFIG_CPU == S3C2440
81 #define DRAMORIG 0x0 + STUBOFFSET
82 #define IRAM DRAM
83 #define IRAMSIZE 0
84 #elif CONFIG_CPU == IMX31L
85 #define DRAMORIG 0x0 + STUBOFFSET
86 #define IRAM DRAM
87 #define IRAMSIZE 0
88 #elif CONFIG_CPU==DM320
89 #define DRAMORIG 0x00900000 + STUBOFFSET
90 #define IRAM DRAM
91 /* The bit of IRAM that is available is used in the core */
92 #define IRAMSIZE 0
93 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
94 #define DRAMORIG 0x20000000
95 /*#define IRAMORIG 0x1000c000
96 #define IRAMSIZE 0xc000*/
97 #define IRAM DRAM
98 #define IRAMSIZE 0
99 #elif CONFIG_CPU==AS3525
100 #if MEMORYSIZE <= 2
101 #define IRAMSIZE 0  /* simulates no IRAM since codec is already entirely in IRAM */
102 #define CODEC_ORIGIN (0x50000 - CODEC_SIZE)
103 #define PLUGIN_ORIGIN (DRAMORIG + DRAMSIZE)
104 #else
105 #define IRAMORIG 0x0
106 #define IRAMSIZE 0x50000
107 #endif
108 #define DRAMORIG 0x30000000
110 #elif CONFIG_CPU == JZ4732
111 #define DRAMORIG 0x80004000 + STUBOFFSET
112 //#define IRAMORIG 0x80000000
113 //#define IRAMSIZE 0x4000
114 #else
115 #define DRAMORIG 0x09000000 + STUBOFFSET
116 #endif
118 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
120 #ifndef CODEC_ORIGIN /* targets can specify another origin */
121 #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
122 #endif
124 #ifndef PLUGIN_ORIGIN /* targets can specify another origin */
125 #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
126 #endif
128 #ifdef CODEC
129 #define THIS_LENGTH CODEC_SIZE
130 #define THIS_ORIGIN CODEC_ORIGIN
131 #elif defined OVERLAY_OFFSET
132 #define THIS_LENGTH (DRAMSIZE - OVERLAY_OFFSET)
133 #define THIS_ORIGIN (DRAMORIG + OVERLAY_OFFSET)
134 #else /* plugin */
135 #define THIS_LENGTH PLUGIN_LENGTH
136 #define THIS_ORIGIN PLUGIN_ORIGIN
137 #endif
139 MEMORY
141    PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
142 #if defined(IRAMSIZE) && IRAMSIZE != 0
143    PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
144 #endif
147 SECTIONS
149     .header : {
150         _plugin_start_addr = .;
151         plugin_start_addr = .;
152         KEEP(*(.header))
153     } > PLUGIN_RAM
155     .text :
156     {
157         *(.text*)
158 #if defined(IRAMSIZE) && IRAMSIZE == 0
159                 *(.icode)
160 #endif
161 #ifdef CPU_ARM
162         *(.glue_7)
163         *(.glue_7t)
164 #endif
165     } > PLUGIN_RAM
167     .rodata :
168     {
169         *(.rodata*)
170 #if defined(IRAMSIZE) && IRAMSIZE == 0
171                 *(.irodata)
172 #endif
173         . = ALIGN(0x4);
174     } > PLUGIN_RAM
176     .data :
177     {
178         *(.data*)
179 #if defined(IRAMSIZE) && IRAMSIZE == 0
180                 *(.idata)
181 #endif
182     } > PLUGIN_RAM
184 #if NOCACHE_BASE != 0
185     .ncdata . + NOCACHE_BASE :
186     {
187         . = ALIGN(CACHEALIGN_SIZE);
188         *(.ncdata*)
189         . = ALIGN(CACHEALIGN_SIZE);
190     } AT> PLUGIN_RAM
191 #endif
193 #if defined(IRAMSIZE)
194     iramcopy = . - NOCACHE_BASE;
195 #endif
197     /DISCARD/ :
198     {
199         *(.eh_frame)
200 #ifdef CPU_MIPS
201         *(.rel.dyn)
202 #endif
203     }
205 #if defined(IRAMSIZE) && IRAMSIZE != 0
206     .iram IRAMORIG : AT ( iramcopy)
207     {
208         iramstart = .;
209         *(.icode)
210         *(.irodata)
211         *(.idata)
212         iramend = .;
213     } > PLUGIN_IRAM
216     .ibss (NOLOAD) :
217     {
218         iedata = .;
219         *(.ibss)
220         . = ALIGN(0x4);
221         iend = .;
222     } > PLUGIN_IRAM
223 #endif
225     .bss (NOLOAD) :
226     {
227         plugin_bss_start = .;
228         *(.bss*)
229 #if defined(IRAMSIZE) && IRAMSIZE == 0
230                 *(.ibss)
231 #endif
232         *(COMMON)
233         . = ALIGN(0x4);
234     } > PLUGIN_RAM
235     
236 #if NOCACHE_BASE != 0
237     .ncbss . + NOCACHE_BASE (NOLOAD) :
238     {
239         . = ALIGN(CACHEALIGN_SIZE);
240         *(.ncbss*)
241         . = ALIGN(CACHEALIGN_SIZE);
242     } AT> PLUGIN_RAM
243 #endif
245     /* Restore . */
246     .pluginend . - NOCACHE_BASE :
247     {
248         _plugin_end_addr = .;
249         plugin_end_addr = .;
250     }
252     /* Special trick to avoid a linker error when no other sections are
253        left after garbage collection (plugin not for this platform) */
254     .comment 0 :
255     {
256         KEEP(*(.comment))
257     }