diff options
Diffstat (limited to 'firmware/target/arm/boot-pp502x-bl-usb.lds')
-rw-r--r-- | firmware/target/arm/boot-pp502x-bl-usb.lds | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/firmware/target/arm/boot-pp502x-bl-usb.lds b/firmware/target/arm/boot-pp502x-bl-usb.lds new file mode 100644 index 0000000000..30a8c0e716 --- /dev/null +++ b/firmware/target/arm/boot-pp502x-bl-usb.lds | |||
@@ -0,0 +1,136 @@ | |||
1 | /* Will have been included from boot.lds */ | ||
2 | ENTRY(start) | ||
3 | OUTPUT_FORMAT(elf32-littlearm) | ||
4 | OUTPUT_ARCH(arm) | ||
5 | STARTUP(target/arm/crt0-pp502x-bl-usb.o) | ||
6 | |||
7 | #define DRAMORIG 0x01000000 /* Load at 16 MB */ | ||
8 | #define DRAMSIZE 0x00100000 /* 1MB for bootloader */ | ||
9 | #define MEMEND (MEMORYSIZE*0x100000) /* From virtual mapping at 0 */ | ||
10 | #define NOCACHE_BASE 0x10000000 | ||
11 | #ifndef IRAMORIG | ||
12 | #define IRAMORIG 0x40000000 | ||
13 | #endif | ||
14 | #define IRAMSIZE 0x20000 | ||
15 | #define FLASHORIG 0x001f0000 | ||
16 | #define FLASHSIZE 2M | ||
17 | |||
18 | #define CACHEALIGN_SIZE 16 | ||
19 | |||
20 | MEMORY | ||
21 | { | ||
22 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
23 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
24 | } | ||
25 | |||
26 | SECTIONS | ||
27 | { | ||
28 | . = DRAMORIG; | ||
29 | _loadaddress = . + NOCACHE_BASE; | ||
30 | |||
31 | .text : | ||
32 | { | ||
33 | *(.init.text) | ||
34 | *(.text*) | ||
35 | *(.glue_7) | ||
36 | *(.glue_7t) | ||
37 | . = ALIGN(0x4); | ||
38 | } > DRAM | ||
39 | |||
40 | .rodata : | ||
41 | { | ||
42 | *(.rodata) /* problems without this, dunno why */ | ||
43 | *(.rodata*) | ||
44 | *(.rodata.str1.1) | ||
45 | *(.rodata.str1.4) | ||
46 | . = ALIGN(0x4); | ||
47 | } > DRAM | ||
48 | |||
49 | .data : | ||
50 | { | ||
51 | *(.data*) | ||
52 | . = ALIGN(0x4); | ||
53 | } > DRAM | ||
54 | |||
55 | /* .ncdata section is placed at uncached physical alias address and is | ||
56 | * loaded at the proper cached virtual address - no copying is | ||
57 | * performed in the init code */ | ||
58 | .ncdata . + NOCACHE_BASE : | ||
59 | { | ||
60 | . = ALIGN(CACHEALIGN_SIZE); | ||
61 | *(.ncdata*) | ||
62 | . = ALIGN(CACHEALIGN_SIZE); | ||
63 | } AT> DRAM | ||
64 | |||
65 | /DISCARD/ . - NOCACHE_BASE : | ||
66 | { | ||
67 | *(.eh_frame) | ||
68 | } > DRAM | ||
69 | |||
70 | _noloaddram = .; | ||
71 | |||
72 | .ibss IRAMORIG (NOLOAD) : | ||
73 | { | ||
74 | _iedata = .; | ||
75 | *(.qharray) | ||
76 | *(.ibss) | ||
77 | . = ALIGN(0x4); | ||
78 | _iend = .; | ||
79 | } > IRAM | ||
80 | |||
81 | .iram _iend : | ||
82 | { | ||
83 | _iramstart = .; | ||
84 | *(.icode) | ||
85 | *(.irodata) | ||
86 | *(.idata) | ||
87 | _iramend = .; | ||
88 | } > IRAM AT> DRAM | ||
89 | |||
90 | _iramcopy = LOADADDR(.iram); | ||
91 | |||
92 | .loadaddressend : | ||
93 | { | ||
94 | _loadaddressend = . + NOCACHE_BASE; | ||
95 | } AT> DRAM | ||
96 | |||
97 | .stack (NOLOAD) : | ||
98 | { | ||
99 | . = ALIGN(8); | ||
100 | *(.stack) | ||
101 | stackbegin = .; | ||
102 | . += 0x2000; | ||
103 | stackend = .; | ||
104 | } > IRAM | ||
105 | |||
106 | /* .bss and .ncbss are treated as a single section to use one init loop | ||
107 | * to zero them - note "_edata" and "_end" */ | ||
108 | .bss _noloaddram (NOLOAD) : | ||
109 | { | ||
110 | _edata = .; | ||
111 | *(.bss*) | ||
112 | *(COMMON) | ||
113 | } > DRAM | ||
114 | |||
115 | .ncbss . + NOCACHE_BASE (NOLOAD) : | ||
116 | { | ||
117 | . = ALIGN(CACHEALIGN_SIZE); | ||
118 | *(.ncbss*) | ||
119 | . = ALIGN(CACHEALIGN_SIZE); | ||
120 | } AT> DRAM | ||
121 | |||
122 | /* This will be aligned by preceding alignments */ | ||
123 | .endaddr . - NOCACHE_BASE (NOLOAD) : | ||
124 | { | ||
125 | _end = .; | ||
126 | } > DRAM | ||
127 | |||
128 | /* Reference to all DRAM after loaded bootloader image */ | ||
129 | .freebuffer _end (NOLOAD) : | ||
130 | { | ||
131 | . = ALIGN(4); | ||
132 | freebuffer = .; | ||
133 | . = MEMEND-1; | ||
134 | freebufferend = .; | ||
135 | } | ||
136 | } | ||