Factor out some drawing code.
[kugel-rb.git] / firmware / target / coldfire / iriver / boot.lds
blob5330cb6df79e4aafa5308dcbe1d6d07bf329b7c1
1 #include "config.h"
3 ENTRY(start)
4 OUTPUT_FORMAT(elf32-m68k)
5 STARTUP(target/coldfire/crt0.o)
7 #define DRAMSIZE (MEMORYSIZE * 0x100000)
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
23 MEMORY
25    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
26    IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
27    FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
30 SECTIONS
32     .vectors :
33     {
34         _datacopy = .;
35     } > FLASH
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
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
64     .rodata :
65     {
66         *(.rodata*)
67         . = ALIGN(0x4);
68         _iramcopy = .;
69     } > FLASH
71     .stack :
72     {
73        *(.stack)
74        _stackbegin = .;
75        stackbegin = .;
76        . += 0x2000;
77        _stackend = .;
78        stackend = .;
79     } > IRAM
81     .bss DRAMORIG+0x800000:
82     {
83        _edata = .;
84         *(.ibss)
85         *(.bss*)
86         *(COMMON)
87        _end = .;
88     } > DRAM