3 /* These output formats should be in the config-files */
6 OUTPUT_FORMAT(elf32-m68k)
8 OUTPUT_FORMAT(elf32-littlearm)
10 OUTPUT_FORMAT(elf32-sh)
11 #elif defined(CPU_MIPS)
12 OUTPUT_FORMAT(elf32-littlemips)
14 /* We can have an #error here we don't use this file when build sims! */
15 #error Unknown CPU architecture
19 #define STUBOFFSET 0x10000
26 #define NOCACHE_BASE 0x10000000
28 #define NOCACHE_BASE 0x28000000
30 #define CACHEALIGN_SIZE 16
34 /* Default to no offset if target doesn't define this */
35 #define NOCACHE_BASE 0x00000000
38 #if CONFIG_CPU==DM320 || CONFIG_CPU==IMX31L
39 /* Give this 1 meg to allow it to align to the MMU boundary */
40 #define LCD_TTB_AREA 0x100000
41 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA
43 #elif CONFIG_CPU==S3C2440
44 #define LCD_BUFFER_SIZE (LCD_WIDTH*LCD_HEIGHT*2)
45 /* must be 16Kb (0x4000) aligned */
46 #define TTB_SIZE (0x4000)
47 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
49 #elif CONFIG_CPU==AS3525
51 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET
53 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
57 /* default to full RAM (minus codecs&plugins) unless specified otherwise */
59 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
63 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
67 #if defined(ARCH_IRIVER) || defined(IAUDIO_M3)
68 #define DRAMORIG 0x31000000
69 #define IRAMORIG 0x1000c000
70 #define IRAMSIZE 0xc000
72 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
73 #define DRAMORIG 0x31000000
74 #define IRAMORIG 0x10010000
75 #define IRAMSIZE 0x10000
77 #elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
78 /* PP5022/24 have 128KB of IRAM */
79 #define DRAMORIG 0x00000000
80 #define IRAMORIG 0x4000c000
81 #define IRAMSIZE 0x14000
84 /* all other PP's have 96KB of IRAM */
85 #define DRAMORIG 0x00000000
86 #define IRAMORIG 0x4000c000
87 #define IRAMSIZE 0x0c000
89 #elif CONFIG_CPU == PNX0101
90 #define DRAMORIG 0xc00000 + STUBOFFSET
91 #define IRAMORIG 0x407000
92 #define IRAMSIZE 0x9000
94 #elif CONFIG_CPU == IMX31L || CONFIG_CPU == S3C2440
95 #define DRAMORIG 0x0 + STUBOFFSET
99 #elif CONFIG_CPU==DM320
100 #define DRAMORIG 0x00900000 + STUBOFFSET
102 /* The bit of IRAM that is available is used in the core */
105 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
106 #define DRAMORIG 0x20000000
107 /*#define IRAMORIG 0x1000c000
108 #define IRAMSIZE 0xc000*/
112 #elif CONFIG_CPU==AS3525
114 #define IRAMSIZE 0 /* simulates no IRAM since codec is already entirely in IRAM */
115 #define CODEC_ORIGIN (0x50000 - CODEC_SIZE)
116 #define PLUGIN_ORIGIN (DRAMORIG + DRAMSIZE)
118 #define IRAMORIG 0x20000
119 #define IRAMSIZE 0x30000
121 #define DRAMORIG 0x30000000
123 #elif CONFIG_CPU == JZ4732
124 #define DRAMORIG 0x80004000 + STUBOFFSET
125 //#define IRAMORIG 0x80000000
126 //#define IRAMSIZE 0x4000
128 #define DRAMORIG 0x09000000 + STUBOFFSET
131 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
134 #ifndef CODEC_ORIGIN /* targets can specify another origin */
135 #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
138 #ifndef PLUGIN_ORIGIN /* targets can specify another origin */
139 #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
143 #define THIS_LENGTH CODEC_SIZE
144 #define THIS_ORIGIN CODEC_ORIGIN
145 #elif defined OVERLAY_OFFSET
146 #define THIS_LENGTH (DRAMSIZE - OVERLAY_OFFSET)
147 #define THIS_ORIGIN (DRAMORIG + OVERLAY_OFFSET)
149 #define THIS_LENGTH PLUGIN_LENGTH
150 #define THIS_ORIGIN PLUGIN_ORIGIN
155 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
156 #if defined(IRAMSIZE) && IRAMSIZE != 0
157 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
164 _plugin_start_addr = .;
165 plugin_start_addr = .;
172 #if defined(IRAMSIZE) && IRAMSIZE == 0
184 #if defined(IRAMSIZE) && IRAMSIZE == 0
193 #if defined(IRAMSIZE) && IRAMSIZE == 0
198 #if NOCACHE_BASE != 0
199 .ncdata . + NOCACHE_BASE :
201 . = ALIGN(CACHEALIGN_SIZE);
203 . = ALIGN(CACHEALIGN_SIZE);
207 #if defined(IRAMSIZE)
208 iramcopy = . - NOCACHE_BASE;
219 #if defined(IRAMSIZE) && IRAMSIZE != 0
220 .iram IRAMORIG : AT ( iramcopy)
241 plugin_bss_start = .;
243 #if defined(IRAMSIZE) && IRAMSIZE == 0
250 #if NOCACHE_BASE != 0
251 .ncbss . + NOCACHE_BASE (NOLOAD) :
253 . = ALIGN(CACHEALIGN_SIZE);
255 . = ALIGN(CACHEALIGN_SIZE);
260 .pluginend . - NOCACHE_BASE :
262 _plugin_end_addr = .;
266 /* Special trick to avoid a linker error when no other sections are
267 left after garbage collection (plugin not for this platform) */