summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/rom.lds70
1 files changed, 53 insertions, 17 deletions
diff --git a/firmware/rom.lds b/firmware/rom.lds
index 29e72d70c0..0967c6b88a 100644
--- a/firmware/rom.lds
+++ b/firmware/rom.lds
@@ -1,38 +1,39 @@
1#include "config.h" 1#include "config.h"
2 2
3ENTRY(start) 3ENTRY(start)
4
4#ifdef CPU_COLDFIRE 5#ifdef CPU_COLDFIRE
5OUTPUT_FORMAT(elf32-m68k) 6OUTPUT_FORMAT(elf32-m68k)
6#else
7OUTPUT_FORMAT(elf32-sh)
8#endif
9#ifdef CPU_COLDFIRE
10INPUT(target/coldfire/crt0.o) 7INPUT(target/coldfire/crt0.o)
11#elif defined(CPU_PP) 8#elif defined(CPU_PP)
9OUTPUT_FORMAT(elf32-littlearm)
12INPUT(target/arm/crt0-pp.o) 10INPUT(target/arm/crt0-pp.o)
13#elif defined(CPU_ARM) 11#elif defined(CPU_ARM)
12OUTPUT_FORMAT(elf32-littlearm)
14INPUT(target/arm/crt0.o) 13INPUT(target/arm/crt0.o)
15#elif CONFIG_CPU == SH7034 14#elif CONFIG_CPU == SH7034
15OUTPUT_FORMAT(elf32-sh)
16INPUT(target/sh/crt0.o) 16INPUT(target/sh/crt0.o)
17#else 17#else
18OUTPUT_FORMAT(elf32-sh)
18INPUT(crt0.o) 19INPUT(crt0.o)
19#endif 20#endif
20 21
21 22
22#if MEMORYSIZE >= 32 23#if MEMORYSIZE >= 32
23#define PLUGINSIZE 0xC0000 24#define PLUGINSIZE PLUGIN_BUFFER_SIZE
24#else 25#else
25#define PLUGINSIZE 0x8000 26#define PLUGINSIZE 0x8000
26#endif 27#endif
27 28
28#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE
29 29
30#ifdef IRIVER_H100 30#ifdef IRIVER_H100_SERIES
31#define CODECSIZE CODEC_SIZE
31#define DRAMORIG 0x31000000 32#define DRAMORIG 0x31000000
32#define IRAMORIG 0x10000000 33#define IRAMORIG 0x10000000
33#define IRAMSIZE 0x18000 34#define IRAMSIZE 0xc000
34#define FLASHORIG 0x001f0000 35#define FLASHORIG 0x00100028
35#define FLASHSIZE 2M 36#define FLASHSIZE 0x000eff80
36#else 37#else
37#define DRAMORIG 0x09000000 38#define DRAMORIG 0x09000000
38#define IRAMORIG 0x0f000000 39#define IRAMORIG 0x0f000000
@@ -41,7 +42,18 @@ INPUT(crt0.o)
41#define FLASHSIZE 256K - ROM_START 42#define FLASHSIZE 256K - ROM_START
42#endif 43#endif
43 44
44#define ENDADDR (DRAMORIG + DRAMSIZE) 45#ifdef CODECSIZE
46#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE
47/* Where the codec buffer ends, and the plugin buffer starts */
48#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
49#else
50#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE
51/* Where the audio buffer ends, and the plugin buffer starts */
52#define ENDADDR ENDAUDIOADDR
53#endif
54
55/* End of the audio buffer, where the codec/plugin buffer starts */
56#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
45 57
46MEMORY 58MEMORY
47{ 59{
@@ -74,10 +86,15 @@ SECTIONS
74 . = ALIGN(0x200); 86 . = ALIGN(0x200);
75 *(.data) 87 *(.data)
76 . = ALIGN(0x4); 88 . = ALIGN(0x4);
77 _dataend = .; 89 _dataend = .;
78 . = ALIGN(0x10); /* Maintain proper alignment for .text section */ 90 . = ALIGN(0x10); /* Maintain proper alignment for .text section */
79 } > DRAM 91 } > DRAM
80 92
93 /DISCARD/ :
94 {
95 *(.eh_frame)
96 }
97
81 /* TRICK ALERT! Newer versions of the linker don't allow output sections 98 /* TRICK ALERT! Newer versions of the linker don't allow output sections
82 to overlap even if one of them is empty, so advance the location pointer 99 to overlap even if one of them is empty, so advance the location pointer
83 "by hand" */ 100 "by hand" */
@@ -105,7 +122,7 @@ SECTIONS
105 *(.idata) 122 *(.idata)
106 _iramend = .; 123 _iramend = .;
107 } > IRAM 124 } > IRAM
108 125
109 .ibss (NOLOAD) : 126 .ibss (NOLOAD) :
110 { 127 {
111 _iedata = .; 128 _iedata = .;
@@ -122,29 +139,48 @@ SECTIONS
122 . += 0x2000; 139 . += 0x2000;
123 _stackend = .; 140 _stackend = .;
124 stackend = .; 141 stackend = .;
125 } > DRAM 142 } > IRAM
126 143
144#ifdef CPU_COLDFIRE
145 .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
146#else
127 .bss : 147 .bss :
148#endif
128 { 149 {
129 _edata = .; 150 _edata = .;
130 *(.bss) 151 *(.bss*)
131 *(COMMON) 152 *(COMMON)
153 . = ALIGN(0x4);
132 _end = .; 154 _end = .;
133 } > DRAM 155 } > DRAM
134 156
135 .audiobuf : 157 .audiobuf ALIGN(4):
136 { 158 {
137 . = ALIGN(0x4);
138 _audiobuffer = .; 159 _audiobuffer = .;
160 audiobuffer = .;
139 } > DRAM 161 } > DRAM
140 162
163#ifdef CODECSIZE
164 .audiobufend ENDAUDIOADDR:
165#else
141 .audiobufend ENDADDR: 166 .audiobufend ENDADDR:
167#endif
142 { 168 {
143 _audiobufend = .; 169 _audiobufend = .;
170 audiobufend = .;
144 } > DRAM 171 } > DRAM
145 172
173#ifdef CODECSIZE
174 .codec ENDAUDIOADDR:
175 {
176 codecbuf = .;
177 _codecbuf = .;
178 }
179#endif
180
146 .plugin ENDADDR: 181 .plugin ENDADDR:
147 { 182 {
148 _pluginbuf = .; 183 _pluginbuf = .;
184 pluginbuf = .;
149 } 185 }
150} 186}