diff options
Diffstat (limited to 'firmware/target/coldfire/iriver/boot.lds')
-rw-r--r-- | firmware/target/coldfire/iriver/boot.lds | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/firmware/target/coldfire/iriver/boot.lds b/firmware/target/coldfire/iriver/boot.lds new file mode 100644 index 0000000000..4e2619f764 --- /dev/null +++ b/firmware/target/coldfire/iriver/boot.lds | |||
@@ -0,0 +1,89 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-m68k) | ||
5 | INPUT(target/coldfire/crt0.o) | ||
6 | |||
7 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
8 | |||
9 | #ifdef IRIVER_H100_SERIES | ||
10 | #define DRAMORIG 0x31000000 | ||
11 | #define IRAMORIG 0x10000000 | ||
12 | #define IRAMSIZE 0x18000 | ||
13 | #define FLASHORIG 0x001f0000 | ||
14 | #define FLASHSIZE 2M | ||
15 | #elif defined(IRIVER_H300_SERIES) | ||
16 | #define DRAMORIG 0x31000000 | ||
17 | #define IRAMORIG 0x10000000 | ||
18 | #define IRAMSIZE 0x18000 | ||
19 | #define FLASHORIG 0x003f0000 | ||
20 | #define FLASHSIZE 4M | ||
21 | #endif | ||
22 | |||
23 | MEMORY | ||
24 | { | ||
25 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
26 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
27 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | ||
28 | } | ||
29 | |||
30 | SECTIONS | ||
31 | { | ||
32 | .vectors : | ||
33 | { | ||
34 | _datacopy = .; | ||
35 | } > FLASH | ||
36 | |||
37 | .data : AT ( _datacopy ) | ||
38 | { | ||
39 | _datastart = .; | ||
40 | KEEP(*(.resetvectors)); | ||
41 | *(.resetvectors); | ||
42 | KEEP(*(.vectors)); | ||
43 | *(.vectors); | ||
44 | . = ALIGN(0x200); | ||
45 | *(.icode) | ||
46 | *(.irodata) | ||
47 | *(.idata) | ||
48 | *(.data*) | ||
49 | . = ALIGN(0x4); | ||
50 | _dataend = .; | ||
51 | . = ALIGN(0x10); /* Maintain proper alignment for .text section */ | ||
52 | } > IRAM | ||
53 | |||
54 | /* TRICK ALERT! Newer versions of the linker don't allow output sections | ||
55 | to overlap even if one of them is empty, so advance the location pointer | ||
56 | "by hand" */ | ||
57 | .text LOADADDR(.data) + SIZEOF(.data) : | ||
58 | { | ||
59 | *(.init.text) | ||
60 | *(.text*) | ||
61 | . = ALIGN(0x4); | ||
62 | } > FLASH | ||
63 | |||
64 | .rodata : | ||
65 | { | ||
66 | *(.rodata*) | ||
67 | . = ALIGN(0x4); | ||
68 | _iramcopy = .; | ||
69 | } > FLASH | ||
70 | |||
71 | .stack : | ||
72 | { | ||
73 | *(.stack) | ||
74 | _stackbegin = .; | ||
75 | stackbegin = .; | ||
76 | . += 0x2000; | ||
77 | _stackend = .; | ||
78 | stackend = .; | ||
79 | } > IRAM | ||
80 | |||
81 | .bss DRAMORIG+0x800000: | ||
82 | { | ||
83 | _edata = .; | ||
84 | *(.ibss) | ||
85 | *(.bss*) | ||
86 | *(COMMON) | ||
87 | _end = .; | ||
88 | } > DRAM | ||
89 | } | ||