Added ID3 database support. Still very early.
[kugel-rb.git] / firmware / rom.lds
blobaee179b9e7b99af70b2f0c2caa8829fecf018f08
1 #include "config.h"
3 ENTRY(start)
4 OUTPUT_FORMAT(elf32-sh)
5 INPUT(crt0.o)
7 #define PLUGINSIZE 0x8000
9 #define DRAMORIG 0x09000000
10 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE
11 #define IRAMORIG 0x0f000000
12 #define IRAMSIZE 0x1000
13 #define FLASHORIG 0x02000000 + ROM_START
14 #define FLASHSIZE 256K - ROM_START
16 #define ENDADDR  (DRAMORIG + DRAMSIZE)
18 MEMORY
20    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
21    IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
22    FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
24 SECTIONS
26     .vectors :
27     {
28         _datacopy = .;
29     } > FLASH
31     .data : AT ( _datacopy )
32     {
33         _datastart = .;
34         *(.resetvectors);
35         *(.vectors);
36         . = _datastart + 0x200;
37         *(.data)
38         . = ALIGN(0x4);
39         _dataend = .;         
40         . = ALIGN(0x10);  /* Maintain proper alignment for .text section */
41     } > DRAM
42     
43     /* TRICK ALERT! Newer versions of the linker don't allow output sections
44        to overlap even if one of them is empty, so advance the location pointer
45        "by hand" */
46     .text LOADADDR(.data) + SIZEOF(.data) :
47     {
48         *(.init.text)
49         *(.text)
50         . = ALIGN(0x4);
51     } > FLASH
53     .rodata :
54     {
55         *(.rodata)
56         *(.rodata.str1.4)
57         . = ALIGN(0x4);
58         _iramcopy = .;
59     } > FLASH
61     .iram 0xf000000 : AT ( _iramcopy )
62     {
63         _iramstart = .;
64         *(.icode)
65         *(.idata)
66         _iramend = .;
67     } > IRAM
68   
69     .stack :
70     {
71        *(.stack)
72        _stackbegin = .;
73        . += 0x2000;
74        _stackend = .;
75     } > DRAM
77     .bss :
78     {
79        _edata = .;
80         *(.bss)
81         *(COMMON)
82        _end = .;
83     } > DRAM
85     .mp3buf :
86     {
87         . = ALIGN(0x4);
88         _mp3buffer = .;
89     } > DRAM
91     .mp3end ENDADDR:
92     {
93         _mp3end = .;
94     } > DRAM
96     .plugin ENDADDR:
97     {
98         _pluginbuf = .;
99     }