FS#11417 by Joe Balough: fix audio/tuner on philips hdd6330
[kugel-rb.git] / firmware / target / arm / pnx0101 / app.lds
blob6464b0d6082c88b0ae7b1828c630461eaf73e988
1 #include "config.h"
3 ENTRY(start)
5 OUTPUT_FORMAT(elf32-littlearm)
6 OUTPUT_ARCH(arm)
7 STARTUP(target/arm/pnx0101/crt0-pnx0101.o)
9 #define PLUGINSIZE PLUGIN_BUFFER_SIZE
10 #define CODECSIZE CODEC_SIZE
12 #ifdef DEBUG
13 #define STUBOFFSET 0x10000
14 #else
15 #define STUBOFFSET 0
16 #endif
18 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
20 #define DRAMORIG 0xc00000 + STUBOFFSET
21 #define IRAM0ORIG 0x000000
22 #define IRAM0SIZE 0x7000
23 #define IRAMORIG 0x400000
24 #define IRAMSIZE 0x7000
26 /* End of the audio buffer, where the codec buffer starts */
27 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
29 /* Where the codec buffer ends, and the plugin buffer starts */
30 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
32 MEMORY
34     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
35     IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
36     IRAM0 : ORIGIN = IRAM0ORIG, LENGTH = IRAM0SIZE
39 SECTIONS
41     .text :
42     {
43         loadaddress = .;
44         _loadaddress = .;
45         . = ALIGN(0x200);
46         *(.init.text)
47         *(.text*)
48         *(.glue_7)
49         *(.glue_7t)
50         . = ALIGN(0x4);
51     } > DRAM
53     .rodata :
54     {
55         *(.rodata)  /* problems without this, dunno why */
56         *(.rodata*)
57         *(.rodata.str1.1)
58         *(.rodata.str1.4)
59         . = ALIGN(0x4);
61         /* Pseudo-allocate the copies of the data sections */
62         _datacopy = .;
63     } > DRAM
65     /* TRICK ALERT! For RAM execution, we put the .data section at the
66        same load address as the copy. Thus, we don't waste extra RAM
67        when we don't actually need the copy.  */
68     .data : AT ( _datacopy )
69     {
70         _datastart = .;
71         *(.data*)
72         . = ALIGN(0x4);
73         _dataend  = .;
74     } > DRAM
76     /DISCARD/ :
77     {
78         *(.eh_frame)
79     }
81     .vectors 0x0 :
82     {
83         _vectorsstart = .;
84         *(.vectors);
85         _vectorsend = .;
86         *(.dmabuf)
87     } >IRAM0 AT> DRAM
89     _vectorscopy = LOADADDR(.vectors);
91     .iram IRAMORIG + SIZEOF(.vectors) :
92     {
93         _iramstart = .;
94         *(.icode)
95         *(.irodata)
96         *(.idata)
97         . = ALIGN(0x4);
98         _iramend = .;
99     } > IRAM AT> DRAM
101     _iramcopy = LOADADDR(.iram);
103     .ibss (NOLOAD) :
104     {
105         _iedata = .;
106         *(.ibss)
107         . = ALIGN(0x4);
108         _iend = .;
109     } > IRAM
111    .stack :
112     {
113        *(.stack)
114        stackbegin = .;
115        . += 0x2000;
116        stackend = .;
117     } > IRAM
119     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram) + SIZEOF(.vectors):
120     {
121        _edata = .;
122         *(.bss*)
123         *(COMMON)
124         . = ALIGN(0x4);
125        _end = .;
126     } > DRAM
128     .audiobuf ALIGN(4) :
129     {
130         _audiobuffer = .;
131         audiobuffer = .;
132     } > DRAM
134     .audiobufend ENDAUDIOADDR:
135     {
136         audiobufend = .;
137         _audiobufend = .;
138     } > DRAM
140     .codec ENDAUDIOADDR:
141     {
142         codecbuf = .;
143         _codecbuf = .;
144     }
146     .plugin ENDADDR:
147     {
148         _pluginbuf = .;
149         pluginbuf = .;
150     }