FS#8961 - Anti-Aliased Fonts.
[kugel-rb.git] / apps / plugins / plugin.lds
blob70bc3e06c43411e8001c97fd67df20f705d21c60
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==IMX31L
39 /* Give this 1 meg to allow it to align to the MMU boundary */
40 #if CONFIG_CPU==DM320
41 #ifndef LCD_NATIVE_WIDTH
42 #define LCD_NATIVE_WIDTH LCD_WIDTH
43 #endif
45 #ifndef LCD_NATIVE_HEIGHT
46 #define LCD_NATIVE_HEIGHT LCD_HEIGHT
47 #endif
49 #define LCD_FUDGE       LCD_NATIVE_WIDTH%32
50 #define LCD_BUFFER_SIZE  ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
51 #define LCD_TTB_AREA    0x100000*((LCD_BUFFER_SIZE>>19)+1)
52 #else
53 #define LCD_TTB_AREA    0x100000
54 #endif
56 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA
58 #elif CONFIG_CPU==S3C2440
59 #include "cpu.h"
60 /* must be 16Kb (0x4000) aligned */
61 #define TTB_SIZE         (0x4000) 
62 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
64 #elif CONFIG_CPU==AS3525
65 #include "cpu.h"
66 #define DRAMORIG DRAM_ORIG
67 #ifdef AMS_LOWMEM
68 #define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE)
69 #else
70 #define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE)
71 #endif
72 #endif
74  /* default to full RAM (minus codecs&plugins) unless specified otherwise */
75 #ifndef DRAMSIZE
76 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
77 #endif
80 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
81 #define ARCH_IRIVER
82 #endif
84 #if defined(ARCH_IRIVER) || defined(IAUDIO_M3)
85 #define DRAMORIG 0x31000000
86 #define IRAMORIG 0x1000c000
87 #define IRAMSIZE 0xc000
89 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
90 #define DRAMORIG 0x31000000
91 #define IRAMORIG 0x10010000
92 #define IRAMSIZE 0x10000
94 #elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
95 /* PP5022/24 have 128KB of IRAM */
96 #define DRAMORIG 0x00000000
97 #define IRAMORIG 0x4000c000
98 #define IRAMSIZE 0x14000
100 #elif defined(CPU_PP)
101 /* all other PP's have 96KB of IRAM */
102 #define DRAMORIG 0x00000000
103 #define IRAMORIG 0x4000c000
104 #define IRAMSIZE 0x0c000
106 #elif CONFIG_CPU == PNX0101
107 #define DRAMORIG 0xc00000 + STUBOFFSET
108 #define IRAMORIG 0x407000
109 #define IRAMSIZE 0x9000
111 #elif CONFIG_CPU == IMX31L || CONFIG_CPU == S3C2440
112 #define DRAMORIG 0x0 + STUBOFFSET
113 #define IRAM DRAM
114 #define IRAMSIZE 0
116 #elif CONFIG_CPU==DM320
117 #define DRAMORIG 0x00900000 + STUBOFFSET
118 #define IRAM DRAM
119 /* The bit of IRAM that is available is used in the core */
120 #define IRAMSIZE 0
122 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
123 #define DRAMORIG 0x20000000
124 /*#define IRAMORIG 0x1000c000
125 #define IRAMSIZE 0xc000*/
126 #define IRAM DRAM
127 #define IRAMSIZE 0
129 #elif CONFIG_CPU==AS3525
130 #ifdef AMS_LOWMEM
131 #define IRAMSIZE 0  /* simulates no IRAM since codec is already entirely in IRAM */
132 #define CODEC_ORIGIN (IRAM_ORIG + IRAM_SIZE - CODEC_SIZE)
133 #define PLUGIN_ORIGIN (DRAM_ORIG + DRAMSIZE)
134 #else
135 #define IRAMORIG (IRAM_ORIG + 0x20000)
136 #define IRAMSIZE (IRAM_ORIG + IRAM_SIZE - IRAMORIG)
137 #endif
139 #elif CONFIG_CPU == JZ4732
140 #define DRAMORIG 0x80004000 + STUBOFFSET
141 #define IRAM DRAM
142 /* The bit of IRAM that is available is used in the core */
143 #else
144 #define DRAMORIG 0x09000000 + STUBOFFSET
145 #endif
147 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
150 #ifndef CODEC_ORIGIN /* targets can specify another origin */
151 #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
152 #endif
154 #ifndef PLUGIN_ORIGIN /* targets can specify another origin */
155 #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
156 #endif
158 #ifdef CODEC
159 #define THIS_LENGTH CODEC_SIZE
160 #define THIS_ORIGIN CODEC_ORIGIN
161 #elif defined OVERLAY_OFFSET
162 #define THIS_LENGTH (DRAMSIZE - OVERLAY_OFFSET)
163 #define THIS_ORIGIN (DRAMORIG + OVERLAY_OFFSET)
164 #else /* plugin */
165 #define THIS_LENGTH PLUGIN_LENGTH
166 #define THIS_ORIGIN PLUGIN_ORIGIN
167 #endif
169 MEMORY
171    PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
172 #if defined(IRAMSIZE) && IRAMSIZE != 0
173    PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
174 #endif
177 SECTIONS
179     .header : {
180         _plugin_start_addr = .;
181         plugin_start_addr = .;
182         KEEP(*(.header))
183     } > PLUGIN_RAM
185     .text :
186     {
187         *(.text*)
188 #if defined(IRAMSIZE) && IRAMSIZE == 0
189                 *(.icode)
190 #endif
191 #ifdef CPU_ARM
192         *(.glue_7)
193         *(.glue_7t)
194 #endif
195     } > PLUGIN_RAM
197     .rodata :
198     {
199         *(.rodata*)
200 #if defined(IRAMSIZE) && IRAMSIZE == 0
201                 *(.irodata)
202 #endif
203         . = ALIGN(0x4);
204     } > PLUGIN_RAM
206     .data :
207     {
208         *(.data*)
209 #if defined(IRAMSIZE) && IRAMSIZE == 0
210                 *(.idata)
211 #endif
212     } > PLUGIN_RAM
214 #if NOCACHE_BASE != 0
215     .ncdata . + NOCACHE_BASE :
216     {
217         . = ALIGN(CACHEALIGN_SIZE);
218         *(.ncdata*)
219         . = ALIGN(CACHEALIGN_SIZE);
220     } AT> PLUGIN_RAM
221 #endif
223 #if defined(IRAMSIZE)
224     iramcopy = . - NOCACHE_BASE;
225 #endif
227     /DISCARD/ :
228     {
229         *(.eh_frame)
230 #ifdef CPU_MIPS
231         *(.rel.dyn)
232 #endif
233     }
235 #if defined(IRAMSIZE) && IRAMSIZE != 0
236     .iram IRAMORIG : AT ( iramcopy)
237     {
238         iramstart = .;
239         *(.icode)
240         *(.irodata)
241         *(.idata)
242         iramend = .;
243     } > PLUGIN_IRAM
246     .ibss (NOLOAD) :
247     {
248         iedata = .;
249         *(.ibss)
250         . = ALIGN(0x4);
251         iend = .;
252     } > PLUGIN_IRAM
253 #endif
255     .bss (NOLOAD) :
256     {
257         plugin_bss_start = .;
258         *(.bss*)
259 #if defined(IRAMSIZE) && IRAMSIZE == 0
260                 *(.ibss)
261 #endif
262         *(COMMON)
263         . = ALIGN(0x4);
264     } > PLUGIN_RAM
265     
266 #if NOCACHE_BASE != 0
267     .ncbss . + NOCACHE_BASE (NOLOAD) :
268     {
269         . = ALIGN(CACHEALIGN_SIZE);
270         *(.ncbss*)
271         . = ALIGN(CACHEALIGN_SIZE);
272     } AT> PLUGIN_RAM
273 #endif
275     /* Restore . */
276     .pluginend . - NOCACHE_BASE :
277     {
278         _plugin_end_addr = .;
279         plugin_end_addr = .;
280     }
282     /* Special trick to avoid a linker error when no other sections are
283        left after garbage collection (plugin not for this platform) */
284     .comment 0 :
285     {
286         KEEP(*(.comment))
287     }