diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/boot.lds | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/firmware/boot.lds b/firmware/boot.lds new file mode 100644 index 0000000000..c61a4c836a --- /dev/null +++ b/firmware/boot.lds | |||
@@ -0,0 +1,110 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | #if CONFIG_CPU == MCF5249 | ||
5 | OUTPUT_FORMAT(elf32-m68k) | ||
6 | #else | ||
7 | OUTPUT_FORMAT(elf32-sh) | ||
8 | #endif | ||
9 | INPUT(crt0.o) | ||
10 | |||
11 | #define PLUGINSIZE 0x8000 | ||
12 | |||
13 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE | ||
14 | |||
15 | #ifdef IRIVER_H100 | ||
16 | #define DRAMORIG 0x30000000 | ||
17 | #define IRAMORIG 0x10000000 | ||
18 | #define IRAMSIZE 0x18000 | ||
19 | #define FLASHORIG 0x001f0000 | ||
20 | #define FLASHSIZE 2M | ||
21 | #else | ||
22 | #define DRAMORIG 0x09000000 | ||
23 | #define IRAMORIG 0x0f000000 | ||
24 | #define IRAMSIZE 0x1000 | ||
25 | #define FLASHORIG 0x02000000 + ROM_START | ||
26 | #define FLASHSIZE 256K - ROM_START | ||
27 | #endif | ||
28 | |||
29 | #define ENDADDR (IRAMORIG + IRAMSIZE) | ||
30 | |||
31 | MEMORY | ||
32 | { | ||
33 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
34 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
35 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | ||
36 | } | ||
37 | SECTIONS | ||
38 | { | ||
39 | .vectors : | ||
40 | { | ||
41 | _datacopy = .; | ||
42 | } > FLASH | ||
43 | |||
44 | .data : AT ( _datacopy ) | ||
45 | { | ||
46 | _datastart = .; | ||
47 | *(.resetvectors); | ||
48 | *(.vectors); | ||
49 | . = ALIGN(0x200); | ||
50 | *(.data) | ||
51 | *(.icode) | ||
52 | *(.idata) | ||
53 | . = ALIGN(0x4); | ||
54 | _dataend = .; | ||
55 | . = ALIGN(0x10); /* Maintain proper alignment for .text section */ | ||
56 | } > IRAM | ||
57 | |||
58 | /* TRICK ALERT! Newer versions of the linker don't allow output sections | ||
59 | to overlap even if one of them is empty, so advance the location pointer | ||
60 | "by hand" */ | ||
61 | .text LOADADDR(.data) + SIZEOF(.data) : | ||
62 | { | ||
63 | *(.init.text) | ||
64 | *(.text) | ||
65 | . = ALIGN(0x4); | ||
66 | } > FLASH | ||
67 | |||
68 | .rodata : | ||
69 | { | ||
70 | *(.rodata) | ||
71 | *(.rodata.str1.1) | ||
72 | *(.rodata.str1.4) | ||
73 | . = ALIGN(0x4); | ||
74 | _iramcopy = .; | ||
75 | } > FLASH | ||
76 | |||
77 | .stack : | ||
78 | { | ||
79 | *(.stack) | ||
80 | _stackbegin = .; | ||
81 | stackbegin = .; | ||
82 | . += 0x2000; | ||
83 | _stackend = .; | ||
84 | stackend = .; | ||
85 | } > IRAM | ||
86 | |||
87 | .bss : | ||
88 | { | ||
89 | _edata = .; | ||
90 | *(.bss) | ||
91 | *(COMMON) | ||
92 | _end = .; | ||
93 | } > IRAM | ||
94 | |||
95 | .mp3buf : | ||
96 | { | ||
97 | . = ALIGN(0x4); | ||
98 | _mp3buffer = .; | ||
99 | } > IRAM | ||
100 | |||
101 | .mp3end ENDADDR: | ||
102 | { | ||
103 | _mp3end = .; | ||
104 | } > IRAM | ||
105 | |||
106 | .plugin ENDADDR: | ||
107 | { | ||
108 | _pluginbuf = .; | ||
109 | } | ||
110 | } | ||