diff options
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/app.lds')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/app.lds | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/app.lds b/firmware/target/mips/ingenic_x1000/app.lds new file mode 100644 index 0000000000..0f6352b8ee --- /dev/null +++ b/firmware/target/mips/ingenic_x1000/app.lds | |||
@@ -0,0 +1,119 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | OUTPUT_FORMAT("elf32-littlemips") | ||
4 | OUTPUT_ARCH(MIPS) | ||
5 | ENTRY(_start) | ||
6 | STARTUP(target/mips/ingenic_x1000/crt0.o) | ||
7 | |||
8 | /* Stub area is used for loading new firmware via RoLo */ | ||
9 | #define STUBSIZE 0x4000 | ||
10 | #define SDRAM_ORIG 0x80000000 | ||
11 | |||
12 | /* IRAM contains stub, DRAM contains main app */ | ||
13 | #define IRAMORIG SDRAM_ORIG | ||
14 | #define IRAMSIZE STUBSIZE | ||
15 | #define DRAMORIG (SDRAM_ORIG + STUBSIZE) | ||
16 | #define DRAMSIZE (MEMORYSIZE * 0x100000 - STUBSIZE) | ||
17 | |||
18 | /* End of the audio buffer, where the codec buffer starts */ | ||
19 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE) | ||
20 | |||
21 | /* Where the codec buffer ends, and the plugin buffer starts */ | ||
22 | #define ENDCODECADDR (ENDAUDIOADDR + CODEC_SIZE) | ||
23 | |||
24 | MEMORY | ||
25 | { | ||
26 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
27 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
28 | } | ||
29 | |||
30 | SECTIONS | ||
31 | { | ||
32 | .text : | ||
33 | { | ||
34 | loadaddress = .; | ||
35 | _loadaddress = .; | ||
36 | *(.init.text); | ||
37 | *(.text*); | ||
38 | } > DRAM | ||
39 | |||
40 | . = ALIGN(4); | ||
41 | .rodata : | ||
42 | { | ||
43 | *(.rodata*); | ||
44 | } > DRAM | ||
45 | |||
46 | . = ALIGN(4); | ||
47 | .data : | ||
48 | { | ||
49 | *(.data*); | ||
50 | *(.sdata*); | ||
51 | } > DRAM | ||
52 | |||
53 | .iram IRAMORIG: AT (_bssbegin) | ||
54 | { | ||
55 | _iramstart = .; | ||
56 | . = 0x000; /* TLB refill */ | ||
57 | KEEP(*(.vectors.1)); | ||
58 | . = 0x100; /* Cache error */ | ||
59 | KEEP(*(.vectors.2)); | ||
60 | . = 0x180; /* General exception */ | ||
61 | KEEP(*(.vectors.3)); | ||
62 | . = 0x200; /* Interrupt */ | ||
63 | KEEP(*(.vectors.4)); | ||
64 | KEEP(*(.vectors)); | ||
65 | |||
66 | *(.icode); | ||
67 | *(.irodata); | ||
68 | *(.idata); | ||
69 | _iramend = .; | ||
70 | } > IRAM | ||
71 | _iramcopy = LOADADDR(.iram); | ||
72 | |||
73 | . = ALIGN(4); | ||
74 | .stack (NOLOAD) : | ||
75 | { | ||
76 | *(.stack); | ||
77 | stackbegin = .; | ||
78 | . += 0x1E00; | ||
79 | stackend = .; | ||
80 | _irqstackbegin = .; | ||
81 | . += 0x300; | ||
82 | _irqstackend = .; | ||
83 | } > IRAM | ||
84 | |||
85 | .bss (NOLOAD) : | ||
86 | { | ||
87 | _bssbegin = .; | ||
88 | *(.sbss*); | ||
89 | *(.bss*); | ||
90 | *(COMMON); | ||
91 | *(.scommon*); | ||
92 | _bssend = .; | ||
93 | _end = .; | ||
94 | } > DRAM | ||
95 | |||
96 | #ifdef BOOTLOADER | ||
97 | . = ALIGN(4); | ||
98 | loadbuffer = .; | ||
99 | . += 0x100000 * 4; /* Allow 4 MiB for the rockbox binary */ | ||
100 | loadbufferend = .; | ||
101 | #else | ||
102 | |||
103 | .audiobuf : | ||
104 | { | ||
105 | . = ALIGN(4); /* XXX might need more alignment here */ | ||
106 | audiobuffer = .; | ||
107 | } > DRAM | ||
108 | |||
109 | audiobufend = ENDAUDIOADDR; | ||
110 | codecbuf = ENDAUDIOADDR; | ||
111 | pluginbuf = ENDCODECADDR; | ||
112 | #endif | ||
113 | |||
114 | /DISCARD/ : | ||
115 | { | ||
116 | *(.eh_frame); | ||
117 | *(.rel.dyn); | ||
118 | } | ||
119 | } | ||