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)
14 #define STUBOFFSET 0x10000
21 #define NOCACHE_BASE 0x10000000
23 #define NOCACHE_BASE 0x28000000
25 #define CACHEALIGN_SIZE 16
29 /* Default to no offset if target doesn't define this */
30 #define NOCACHE_BASE 0x00000000
33 #if CONFIG_CPU==DM320 || CONFIG_CPU==S3C2440
35 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
36 #elif CONFIG_CPU==IMX31L
38 /* Reserve 1mb for LCD buffer/TTB as in app.lds */
39 #define DRAMSIZE (MEMORYSIZE * 0x100000 - 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
40 #elif CONFIG_CPU==AS3525 && MEMORYSIZE <= 2
41 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET
43 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
46 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
50 #if defined(ARCH_IRIVER) || defined(IAUDIO_M3)
51 #define DRAMORIG 0x31000000
52 #define IRAMORIG 0x1000c000
53 #define IRAMSIZE 0xc000
54 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
55 #define DRAMORIG 0x31000000
56 #define IRAMORIG 0x10010000
57 #define IRAMSIZE 0x10000
58 #elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
59 /* PP5022/24 have 128KB of IRAM */
60 #define DRAMORIG 0x00000000
61 #define IRAMORIG 0x4000c000
62 #define IRAMSIZE 0x14000
64 /* all other PP's have 96KB of IRAM */
65 #define DRAMORIG 0x00000000
66 #define IRAMORIG 0x4000c000
67 #define IRAMSIZE 0x0c000
68 #elif CONFIG_CPU == PNX0101
69 #define DRAMORIG 0xc00000 + STUBOFFSET
70 #define IRAMORIG 0x407000
71 #define IRAMSIZE 0x9000
72 #elif CONFIG_CPU == S3C2440
73 #define DRAMORIG 0x0 + STUBOFFSET
76 #elif CONFIG_CPU == IMX31L
77 #define DRAMORIG 0x0 + STUBOFFSET
80 #elif CONFIG_CPU==DM320
81 #define DRAMORIG 0x00900000 + STUBOFFSET
82 #define IRAMORIG DRAMORIG
83 #define IRAMSIZE 0x4000
85 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
86 #define DRAMORIG 0x20000000
87 /*#define IRAMORIG 0x1000c000
88 #define IRAMSIZE 0xc000*/
91 #elif CONFIG_CPU==AS3525
93 #define IRAMSIZE 0 /* simulates no IRAM since codec is already entirely in IRAM */
94 #define CODEC_ORIGIN (0x50000 - CODEC_SIZE)
95 #define PLUGIN_ORIGIN (DRAMORIG + DRAMSIZE)
98 #define IRAMSIZE 0x50000
100 #define DRAMORIG 0x30000000
103 #define DRAMORIG 0x09000000 + STUBOFFSET
106 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
108 #ifndef CODEC_ORIGIN /* targets can specify another origin */
109 #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
112 #ifndef PLUGIN_ORIGIN /* targets can specify another origin */
113 #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
117 #define THIS_LENGTH CODEC_SIZE
118 #define THIS_ORIGIN CODEC_ORIGIN
120 #define THIS_LENGTH PLUGIN_LENGTH
121 #define THIS_ORIGIN PLUGIN_ORIGIN
126 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
127 #if defined(IRAMSIZE) && IRAMSIZE != 0
128 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
135 _plugin_start_addr = .;
136 plugin_start_addr = .;
143 #if defined(IRAMSIZE) && IRAMSIZE == 0
155 #if defined(IRAMSIZE) && IRAMSIZE == 0
164 #if defined(IRAMSIZE) && IRAMSIZE == 0
169 #if NOCACHE_BASE != 0
170 .ncdata . + NOCACHE_BASE :
172 . = ALIGN(CACHEALIGN_SIZE);
174 . = ALIGN(CACHEALIGN_SIZE);
178 #if defined(IRAMSIZE)
179 iramcopy = . - NOCACHE_BASE;
187 #if defined(IRAMSIZE) && IRAMSIZE != 0
188 .iram IRAMORIG : AT ( iramcopy)
209 plugin_bss_start = .;
211 #if defined(IRAMSIZE) && IRAMSIZE == 0
218 #if NOCACHE_BASE != 0
219 .ncbss . + NOCACHE_BASE (NOLOAD) :
221 . = ALIGN(CACHEALIGN_SIZE);
223 . = ALIGN(CACHEALIGN_SIZE);
228 .pluginend . - NOCACHE_BASE :
230 _plugin_end_addr = .;
234 /* Special trick to avoid a linker error when no other sections are
235 left after garbage collection (plugin not for this platform) */