Initial maemo platform support
[maemo-rb.git] / firmware / target / arm / boot-pp502x-bl-usb.lds
blob30a8c0e716a88ccc5b92e0db831dc3ad5d1930f4
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)
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
18 #define CACHEALIGN_SIZE 16
20 MEMORY
22     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
23     IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
26 SECTIONS
28     . = DRAMORIG;
29     _loadaddress = . + NOCACHE_BASE;
31     .text :
32     {
33         *(.init.text)
34         *(.text*)
35         *(.glue_7)
36         *(.glue_7t)
37         . = ALIGN(0x4);
38     } > DRAM
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
49     .data :
50     {
51         *(.data*)
52         . = ALIGN(0x4);
53     } > DRAM
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
65     /DISCARD/ . - NOCACHE_BASE :
66     {
67         *(.eh_frame)
68     } > DRAM
70     _noloaddram  = .;
72     .ibss IRAMORIG (NOLOAD) :
73     {
74         _iedata = .;
75         *(.qharray)
76         *(.ibss)
77         . = ALIGN(0x4);
78         _iend = .;
79     } > IRAM
81     .iram _iend :
82     {
83         _iramstart = .;
84         *(.icode)
85         *(.irodata)
86         *(.idata)
87         _iramend = .;
88     } > IRAM AT> DRAM
90     _iramcopy = LOADADDR(.iram);
92     .loadaddressend :
93     {
94         _loadaddressend = . + NOCACHE_BASE;
95     } AT> DRAM
97     .stack (NOLOAD) :
98     {
99         . = ALIGN(8);
100         *(.stack)
101         stackbegin = .;
102         . += 0x2000;
103         stackend = .;
104     } > IRAM
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
115     .ncbss . + NOCACHE_BASE (NOLOAD) :
116     {
117         . = ALIGN(CACHEALIGN_SIZE);
118         *(.ncbss*)
119         . = ALIGN(CACHEALIGN_SIZE);
120     } AT> DRAM
122     /* This will be aligned by preceding alignments */
123     .endaddr . - NOCACHE_BASE (NOLOAD) :
124     {
125         _end = .;
126     } > DRAM
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     }