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