Added stop (off+repeat) to ondio wps.
[kugel-rb.git] / firmware / app.lds
bloba2cefe10917bb0081fd19030b2c11ba4b572eaf1
1 #include "config.h"
3 ENTRY(start)
4 OUTPUT_FORMAT(elf32-sh)
5 INPUT(crt0.o)
7 #define PLUGINSIZE 0x8000
9 #ifdef DEBUG
10 #define DRAMSIZE 0x1f0000 - PLUGINSIZE
11 #define ORIGADDR 0x09010000
13 #else
14 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE
15 #define ORIGADDR 0x09000000
16 #endif
17 #define ENDADDR  (ORIGADDR + DRAMSIZE)
19 MEMORY
21 #ifdef NEO_MEMORY
22    ROM : ORIGIN = 0x00020000, LENGTH = 0x1E0000
23    SRAM : ORIGIN = 0x0C000000, LENGTH = 0x40000
24 #else
25    DRAM : ORIGIN = ORIGADDR, LENGTH = DRAMSIZE
26 #endif
27    IRAM : ORIGIN = 0x0f000000, LENGTH = 0x1000
30 SECTIONS
32 #ifdef NEO_MEMORY
33         .bss :
34         {
35                 _edata = .;
36                 *(.bss)
37                 *(COMMON)
38                 _end = .;
39         } > SRAM
41         .text :
42         {
43                 . = ALIGN(0x4);
44                 *(.vectors);
45                 . = ALIGN(0x200);
46                 *(.init.text)
47                 *(.text)
48         } > ROM
50         .rodata :
51         {
52                 *(.rodata)
53                 *(.rodata.str1.4)
54                 . = ALIGN(0x4);
55         } > ROM
57         .data : AT ( LOADADDR(.romdata) )
58         {
59                 _datastart = .;
60                 *(.data)
61                 _dataend = .;
62         } > SRAM
64         .iram : AT ( _iramcopy )
65         {
66                 _iramstart = .;
67                 *(.icode)
68                 *(.idata)
69                 _iramend = .;
70         } > IRAM
72         .romdata :
73         {
74                 _datacopy = .;
75                 . += SIZEOF(.data);
76                 _iramcopy = .;
77                 . += SIZEOF(.iram);
78         } > ROM
80         .stack :
81         {
82                 _stackbegin = .;
83                 *(.stack)
84                 . += 0x1000;
85                _stackend = .;
86         } > SRAM
87         
88         .mp3buf :
89         {
90                 _mp3buffer = .;
91         } > SRAM
93         .mp3end 0x0C040000 - 0x300:
94         {
95                 _mp3end = .;
96         } > SRAM
98         .plugin 0x0C040000:
99         {
100                 _pluginbuf = .;
101         } > SRAM
102 #else
103     .vectors :
104     {
105         *(.resetvectors);
106         *(.vectors);
107     } > DRAM
109     .text :
110     {
111         . = ALIGN(0x200);
112         *(.init.text)
113         *(.text)
114         . = ALIGN(0x4);
115     } > DRAM
117     .rodata :
118     {
119         *(.rodata)
120         *(.rodata.str1.4)
121         . = ALIGN(0x4);
123         /* Pseudo-allocate the copies of the data sections */
124         _datacopy = .;
125     } > DRAM
127     /* TRICK ALERT! For RAM execution, we put the .data section at the
128        same load address as the copy. Thus, we don't waste extra RAM
129        when we don't actually need the copy.  */
130     .data : AT ( _datacopy )
131     {
132         _datastart = .;
133         *(.data)
134         . = ALIGN(0x4);
135         _dataend  = .;
136         _iramcopy = .;
137     } > DRAM
139     .iram 0xf000000 : AT ( _iramcopy)
140     {
141         _iramstart = .;
142         *(.icode)
143         *(.idata)
144         _iramend = .;
145     } > IRAM
147     /* TRICK ALERT! We want 0x2000 bytes of stack, but we set the section
148        size smaller, and allow the stack to grow into the .iram copy */
149     .stack ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
150     {
151        *(.stack)
152        _stackbegin = . - SIZEOF(.iram);
153        . += 0x2000 - SIZEOF(.iram);
154        _stackend = .;
155     } > DRAM
157     .bss :
158     {
159        _edata = .;
160         *(.bss)
161         *(COMMON)
162        _end = .;
163     } > DRAM
165     .mp3buf :
166     {
167         _mp3buffer = .;
168     } > DRAM
170     .mp3end ENDADDR:
171     {
172         _mp3end = .;
173     } > DRAM
175     .plugin ENDADDR:
176     {
177         _pluginbuf = .;
178     }
180 #endif