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
33 #if CONFIG_CPU==IMX31L
36 #define DRAMSIZE ((MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE \
37 - CODEC_SIZE - QHARRAY_SIZE - FRAME_SIZE - TTB_SIZE)
39 #elif CONFIG_CPU==DM320
41 /* Give this 1 meg to allow it to align to the MMU boundary */
42 #ifndef LCD_NATIVE_WIDTH
43 #define LCD_NATIVE_WIDTH LCD_WIDTH
46 #ifndef LCD_NATIVE_HEIGHT
47 #define LCD_NATIVE_HEIGHT LCD_HEIGHT
50 #define LCD_FUDGE LCD_NATIVE_WIDTH%32
51 #define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
52 #define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1)
54 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA
56 #elif CONFIG_CPU==S3C2440
58 /* must be 16Kb (0x4000) aligned */
59 #define TTB_SIZE (0x4000)
60 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
62 #elif CONFIG_CPU==TCC7801
64 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - TTB_SIZE
66 #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2
68 #define DRAMORIG DRAM_ORIG
69 #if defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
70 #define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE)
72 #define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE)
76 /* default to full RAM (minus codecs&plugins) unless specified otherwise */
78 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
81 /* MCF5249 have 96KB of IRAM */
82 #if CONFIG_CPU == MCF5249
83 #define DRAMORIG 0x31000000
84 #define IRAMORIG 0x1000c000
85 #define IRAMSIZE 0xc000
87 /* MCF5250 have 128KB of IRAM */
88 #elif CONFIG_CPU == MCF5250
89 #define DRAMORIG 0x31000000
90 #define IRAMORIG 0x1000c000
91 #define IRAMSIZE 0x14000
93 #elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
94 /* PP5022/24 have 128KB of IRAM */
95 #define DRAMORIG 0x00000000
96 #define IRAMORIG 0x4000c000
97 #define IRAMSIZE 0x14000
100 /* all other PP's have 96KB of IRAM */
101 #define DRAMORIG 0x00000000
102 #define IRAMORIG 0x4000c000
103 #define IRAMSIZE 0x0c000
105 #elif CONFIG_CPU == PNX0101
106 #define DRAMORIG 0xc00000 + STUBOFFSET
107 #define IRAMORIG 0x407000
108 #define IRAMSIZE 0x9000
110 #elif CONFIG_CPU == IMX31L || CONFIG_CPU == S3C2440
111 #define DRAMORIG 0x0 + STUBOFFSET
115 #elif CONFIG_CPU==DM320
116 #define DRAMORIG 0x00900000 + STUBOFFSET
118 /* The bit of IRAM that is available is used in the core */
121 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
122 #define DRAMORIG 0x20000000
123 #if CONFIG_CPU==TCC7801
124 #define IRAMORIG 0x1000c000
125 #define IRAMSIZE 0xc000
131 #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2
132 #if defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
133 #define IRAMSIZE 0 /* simulates no IRAM since codec is already entirely in IRAM */
134 #define CODEC_ORIGIN (IRAM_ORIG + IRAM_SIZE - CODEC_SIZE)
135 #define PLUGIN_ORIGIN (DRAM_ORIG + DRAMSIZE)
137 #define IRAMORIG (IRAM_ORIG + 0x20000)
138 #define IRAMSIZE (IRAM_ORIG + IRAM_SIZE - IRAMORIG)
141 #elif CONFIG_CPU==S5L8700
142 /* S5L8700 have 256KB of IRAM */
143 #define DRAMORIG 0x08000000
144 #define IRAMORIG (0x00000000 + (48*1024))
145 #define IRAMSIZE (208*1024)
147 #elif CONFIG_CPU==S5L8701
148 /* S5L8701 have 176KB of IRAM */
149 #define DRAMORIG 0x08000000
150 #define IRAMORIG (0x00000000 + (48*1024))
151 #define IRAMSIZE (128*1024)
153 #elif CONFIG_CPU == JZ4732
154 #define DRAMORIG 0x80004000 + STUBOFFSET
157 /* The bit of IRAM that is available is used in the core */
159 #define DRAMORIG 0x09000000 + STUBOFFSET
163 /* Default to no offset if target doesn't define this */
164 #define NOCACHE_BASE 0x00000000
167 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
170 #ifndef CODEC_ORIGIN /* targets can specify another origin */
171 #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
174 #ifndef PLUGIN_ORIGIN /* targets can specify another origin */
175 #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
179 #define THIS_LENGTH CODEC_SIZE
180 #define THIS_ORIGIN CODEC_ORIGIN
181 #elif defined OVERLAY_OFFSET
182 #define THIS_LENGTH (DRAMSIZE - OVERLAY_OFFSET)
183 #define THIS_ORIGIN (DRAMORIG + OVERLAY_OFFSET)
184 #elif defined IMGVDECODER_OFFSET
185 #define THIS_LENGTH (PLUGIN_LENGTH - IMGVDECODER_OFFSET)
186 #define THIS_ORIGIN (PLUGIN_ORIGIN + IMGVDECODER_OFFSET)
188 #define THIS_LENGTH PLUGIN_LENGTH
189 #define THIS_ORIGIN PLUGIN_ORIGIN
194 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
195 #if defined(IRAMSIZE) && IRAMSIZE != 0
196 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
203 _plugin_start_addr = .;
204 plugin_start_addr = .;
211 #if defined(IRAMSIZE) && IRAMSIZE == 0
223 #if defined(IRAMSIZE) && IRAMSIZE == 0
232 #if defined(IRAMSIZE) && IRAMSIZE == 0
237 #if NOCACHE_BASE != 0
238 .ncdata . + NOCACHE_BASE :
240 . = ALIGN(CACHEALIGN_SIZE);
242 . = ALIGN(CACHEALIGN_SIZE);
243 /* EABI currently needs iramcopy defined here, otherwise .iram can sometimes
244 have an incorrect load address, breaking codecs. */
245 #if defined(IRAMSIZE)
246 iramcopy = . - NOCACHE_BASE;
249 /* This definition is used when NOCACHE_BASE is 0. The address offset bug only
250 seems to occur when the empty .ncdata is present. */
251 #elif defined(IRAMSIZE)
263 #if defined(IRAMSIZE) && IRAMSIZE != 0
264 .iram IRAMORIG : AT ( iramcopy)
285 plugin_bss_start = .;
286 _plugin_bss_start = .;
288 #if defined(IRAMSIZE) && IRAMSIZE == 0
295 #if NOCACHE_BASE != 0
296 .ncbss . + NOCACHE_BASE (NOLOAD) :
298 . = ALIGN(CACHEALIGN_SIZE);
300 . = ALIGN(CACHEALIGN_SIZE);
305 .pluginend . - NOCACHE_BASE :
307 _plugin_end_addr = .;
311 /* Special trick to avoid a linker error when no other sections are
312 left after garbage collection (plugin not for this platform) */