Added battery profile change to correct file, removed unused powermgmt-as3525.c
[kugel-rb.git] / firmware / target / arm / as3525 / app.lds
blobe19ff1387816ef715fd53c611fc8ce0bf0401554
1 #include "config.h"
2 #include "cpu.h"
4 ENTRY(start)
6 OUTPUT_FORMAT(elf32-littlearm)
7 OUTPUT_ARCH(arm)
8 STARTUP(target/arm/crt0.o)
10 #define PLUGINSIZE PLUGIN_BUFFER_SIZE
11 #define CODECSIZE CODEC_SIZE
13 #ifdef DEBUG
14 #define STUBOFFSET 0x10000
15 #else
16 #define STUBOFFSET 0
17 #endif
20 #define IRAMORIG IRAM_ORIG
21 #define DRAMORIG (DRAM_ORIG + STUBOFFSET)
23 /* End of the audio buffer, where the codec buffer starts */
24 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
26 #define CODEC_BUFFER_FILLS_IRAM defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
28 #if CODEC_BUFFER_FILLS_IRAM
29 /* Entire codec buffer in IRAM */
30 #define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE)
31 #define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE))
32 #define IRAMSIZE (IRAM_SIZE - CODEC_SIZE)
33 #else
34 #define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - CODECSIZE - TTB_SIZE)
35 #define CODECORIG (ENDAUDIOADDR)
36 #define IRAMSIZE (0x20000)
37 #endif
40 /* Where the codec buffer ends, and the plugin buffer starts */
41 #if CODEC_BUFFER_FILLS_IRAM
42 #define ENDADDR (ENDAUDIOADDR)
43 #else
44 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
45 #endif
47 MEMORY
49 #if CODEC_BUFFER_FILLS_IRAM
50     CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE
51 #endif
52     IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
53     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
56 SECTIONS
58     loadaddress = DRAM_ORIG;
60     .vectors :
61     {
62         _vectors_start = .;
63         *(.init.text)
64     } > DRAM
66     .text :
67     {
68         _loadaddress = .;
69         _textstart = .;
70         *(.text)
71         *(.text*)
72         *(.glue_7)
73         *(.glue_7t)
74         . = ALIGN(0x4);
75     } > DRAM
77     .rodata :
78     {
79         *(.rodata*)
80         . = ALIGN(0x4);
81     } > DRAM
83     .data :
84     {
85         *(.data*)
86         . = ALIGN(0x4);
87     } > DRAM
89     /DISCARD/ :
90     {
91         *(.eh_frame)
92     }
94     .iram :
95     {
96         _iramstart = .;
97         *(.icode)
98         *(.irodata)
99         *(.idata)
100         . = ALIGN(0x4);
101         _iramend = .;
102     } > IRAM AT> DRAM
104     _iramcopy = LOADADDR(.iram);
106     .ibss (NOLOAD) :
107     {
108         _iedata = .;
109         *(.qharray)
110         *(.ibss)
111         . = ALIGN(0x4);
112         _iend = .;
113     } > IRAM
115     .init CODECORIG :
116     {
117         . = ALIGN(4);
118         _initstart = .;
119         *(.init)
120         _initend = .;
121     } AT> DRAM
123     _initcopy = LOADADDR(.init);
125     .stack _iramcopy (NOLOAD) :
126     {
127        *(.stack)
128        stackbegin = .;
129        . += 0x2000;
130        stackend = .;
131     } > DRAM
133     .bss (NOLOAD) :
134     {
135        _edata = .;
136         *(.bss*)
137         *(COMMON)
138         . = ALIGN(0x4);
139        _end = .;
140     } > DRAM
142     .audiobuf (NOLOAD) :
143     {
144         . = ALIGN(4);
145         _audiobuffer = .;
146         audiobuffer = .;
147     } > DRAM
149     .audiobufend ENDAUDIOADDR (NOLOAD) :
150     {
151         audiobufend = .;
152         _audiobufend = .;
153     } > DRAM
155     .codec CODECORIG (NOLOAD) :
156     {
157         codecbuf = .;
158         _codecbuf = .;
159 #if CODEC_BUFFER_FILLS_IRAM
160     } > CODEC_IRAM
161 #else
162     } > DRAM
163 #endif
165     .plugin ENDADDR (NOLOAD) :
166     {
167         _pluginbuf = .;
168         pluginbuf = .;
169     }