summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2014-01-10 16:12:38 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2014-01-15 21:15:14 +0100
commita02f863eefd0878a539df0e0f757597af0e80c98 (patch)
tree12136d470f4d5829dae382d2553ef0fff69a40d1
parent2eb873cea62805f232e4633c73e67c4e2b116cd4 (diff)
downloadrockbox-a02f863eefd0878a539df0e0f757597af0e80c98.tar.gz
rockbox-a02f863eefd0878a539df0e0f757597af0e80c98.zip
coldfire: Use single app.lds script for all coldfires.
The only true difference in this platform is the amount of iram between MCF5249 and MCF5250. Instead of duplicating the file simply use one with proper ifdefs. Change-Id: Ifd56ebd2666813633502e3b5d83669424659c039 Reviewed-on: http://gerrit.rockbox.org/713 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
-rw-r--r--firmware/target/coldfire/app.lds (renamed from firmware/target/coldfire/iaudio/app.lds)2
-rw-r--r--firmware/target/coldfire/iriver/app.lds139
-rw-r--r--firmware/target/coldfire/mpio/app.lds139
-rw-r--r--tools/root.make4
4 files changed, 5 insertions, 279 deletions
diff --git a/firmware/target/coldfire/iaudio/app.lds b/firmware/target/coldfire/app.lds
index 6a733ed07e..5364157fdd 100644
--- a/firmware/target/coldfire/iaudio/app.lds
+++ b/firmware/target/coldfire/app.lds
@@ -117,7 +117,7 @@ SECTIONS
117 117
118 .audiobuf (NOLOAD) : 118 .audiobuf (NOLOAD) :
119 { 119 {
120 . = ALIGN(4); 120 . = ALIGN(4);
121 _audiobuffer = .; 121 _audiobuffer = .;
122 audiobuffer = .; 122 audiobuffer = .;
123 } > DRAM 123 } > DRAM
diff --git a/firmware/target/coldfire/iriver/app.lds b/firmware/target/coldfire/iriver/app.lds
deleted file mode 100644
index 56ccfca509..0000000000
--- a/firmware/target/coldfire/iriver/app.lds
+++ /dev/null
@@ -1,139 +0,0 @@
1#include "config.h"
2
3ENTRY(start)
4
5OUTPUT_FORMAT(elf32-m68k)
6STARTUP(target/coldfire/crt0.o)
7
8#define PLUGINSIZE PLUGIN_BUFFER_SIZE
9#define CODECSIZE CODEC_SIZE
10
11#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE
12
13#define DRAMORIG 0x31000000
14#define IRAMORIG 0x10000000
15#define IRAMSIZE 0xc000
16
17/* End of the audio buffer, where the codec buffer starts */
18#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
19
20/* Where the codec buffer ends, and the plugin buffer starts */
21#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
22
23MEMORY
24{
25 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
26 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
27}
28
29SECTIONS
30{
31 .vectors :
32 {
33 loadaddress = .;
34 _loadaddress = .;
35 KEEP(*(.resetvectors));
36 *(.resetvectors);
37 KEEP(*(.vectors));
38 *(.vectors);
39 } > DRAM
40
41 .text :
42 {
43 . = ALIGN(0x200);
44 *(.init.text)
45 *(.text*)
46 . = ALIGN(0x4);
47 } > DRAM
48
49 .rodata :
50 {
51 *(.rodata) /* problems without this, dunno why */
52 *(.rodata*)
53 *(.rodata.str1.1)
54 *(.rodata.str1.4)
55 . = ALIGN(0x4);
56
57 /* Pseudo-allocate the copies of the data sections */
58 _datacopy = .;
59 } > DRAM
60
61 /* TRICK ALERT! For RAM execution, we put the .data section at the
62 same load address as the copy. Thus, we don't waste extra RAM
63 when we don't actually need the copy. */
64 .data : AT ( _datacopy )
65 {
66 _datastart = .;
67 *(.data*)
68 . = ALIGN(0x4);
69 _dataend = .;
70 } > DRAM
71
72 /DISCARD/ :
73 {
74 *(.eh_frame)
75 }
76
77 .iram IRAMORIG :
78 {
79 _iramstart = .;
80 *(.icode)
81 *(.irodata)
82 *(.idata)
83 _iramend = .;
84 } > IRAM AT> DRAM
85
86 _iramcopy = LOADADDR(.iram);
87 _noloaddram = LOADADDR(.iram);
88
89 .ibss (NOLOAD) :
90 {
91 _iedata = .;
92 *(.ibss)
93 . = ALIGN(0x4);
94 _iend = .;
95 } > IRAM
96
97 .stack (NOLOAD) :
98 {
99 *(.stack)
100 stackbegin = .;
101 . += 0x2000;
102 stackend = .;
103 } > IRAM
104
105 .bss _noloaddram (NOLOAD) :
106 {
107 _edata = .;
108 *(.bss*)
109 *(COMMON)
110 . = ALIGN(0x4);
111 _end = .;
112 } > DRAM
113
114 .audiobuf (NOLOAD) :
115 {
116 . = ALIGN(4);
117 _audiobuffer = .;
118 audiobuffer = .;
119 } > DRAM
120
121 .audiobufend ENDAUDIOADDR (NOLOAD) :
122 {
123 audiobufend = .;
124 _audiobufend = .;
125 } > DRAM
126
127 .codec ENDAUDIOADDR (NOLOAD) :
128 {
129 codecbuf = .;
130 _codecbuf = .;
131 }
132
133 .plugin ENDADDR (NOLOAD) :
134 {
135 _pluginbuf = .;
136 pluginbuf = .;
137 }
138}
139
diff --git a/firmware/target/coldfire/mpio/app.lds b/firmware/target/coldfire/mpio/app.lds
deleted file mode 100644
index 56ccfca509..0000000000
--- a/firmware/target/coldfire/mpio/app.lds
+++ /dev/null
@@ -1,139 +0,0 @@
1#include "config.h"
2
3ENTRY(start)
4
5OUTPUT_FORMAT(elf32-m68k)
6STARTUP(target/coldfire/crt0.o)
7
8#define PLUGINSIZE PLUGIN_BUFFER_SIZE
9#define CODECSIZE CODEC_SIZE
10
11#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE
12
13#define DRAMORIG 0x31000000
14#define IRAMORIG 0x10000000
15#define IRAMSIZE 0xc000
16
17/* End of the audio buffer, where the codec buffer starts */
18#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
19
20/* Where the codec buffer ends, and the plugin buffer starts */
21#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
22
23MEMORY
24{
25 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
26 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
27}
28
29SECTIONS
30{
31 .vectors :
32 {
33 loadaddress = .;
34 _loadaddress = .;
35 KEEP(*(.resetvectors));
36 *(.resetvectors);
37 KEEP(*(.vectors));
38 *(.vectors);
39 } > DRAM
40
41 .text :
42 {
43 . = ALIGN(0x200);
44 *(.init.text)
45 *(.text*)
46 . = ALIGN(0x4);
47 } > DRAM
48
49 .rodata :
50 {
51 *(.rodata) /* problems without this, dunno why */
52 *(.rodata*)
53 *(.rodata.str1.1)
54 *(.rodata.str1.4)
55 . = ALIGN(0x4);
56
57 /* Pseudo-allocate the copies of the data sections */
58 _datacopy = .;
59 } > DRAM
60
61 /* TRICK ALERT! For RAM execution, we put the .data section at the
62 same load address as the copy. Thus, we don't waste extra RAM
63 when we don't actually need the copy. */
64 .data : AT ( _datacopy )
65 {
66 _datastart = .;
67 *(.data*)
68 . = ALIGN(0x4);
69 _dataend = .;
70 } > DRAM
71
72 /DISCARD/ :
73 {
74 *(.eh_frame)
75 }
76
77 .iram IRAMORIG :
78 {
79 _iramstart = .;
80 *(.icode)
81 *(.irodata)
82 *(.idata)
83 _iramend = .;
84 } > IRAM AT> DRAM
85
86 _iramcopy = LOADADDR(.iram);
87 _noloaddram = LOADADDR(.iram);
88
89 .ibss (NOLOAD) :
90 {
91 _iedata = .;
92 *(.ibss)
93 . = ALIGN(0x4);
94 _iend = .;
95 } > IRAM
96
97 .stack (NOLOAD) :
98 {
99 *(.stack)
100 stackbegin = .;
101 . += 0x2000;
102 stackend = .;
103 } > IRAM
104
105 .bss _noloaddram (NOLOAD) :
106 {
107 _edata = .;
108 *(.bss*)
109 *(COMMON)
110 . = ALIGN(0x4);
111 _end = .;
112 } > DRAM
113
114 .audiobuf (NOLOAD) :
115 {
116 . = ALIGN(4);
117 _audiobuffer = .;
118 audiobuffer = .;
119 } > DRAM
120
121 .audiobufend ENDAUDIOADDR (NOLOAD) :
122 {
123 audiobufend = .;
124 _audiobufend = .;
125 } > DRAM
126
127 .codec ENDAUDIOADDR (NOLOAD) :
128 {
129 codecbuf = .;
130 _codecbuf = .;
131 }
132
133 .plugin ENDADDR (NOLOAD) :
134 {
135 _pluginbuf = .;
136 pluginbuf = .;
137 }
138}
139
diff --git a/tools/root.make b/tools/root.make
index 9e8513ba48..dcdbba23c1 100644
--- a/tools/root.make
+++ b/tools/root.make
@@ -201,7 +201,11 @@ ifndef APP_TYPE
201 201
202## target build 202## target build
203CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h 203CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h
204ifeq ($(wildcard $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds),)
205RAMLDS := $(FIRMDIR)/target/$(CPU)/app.lds
206else
204RAMLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds 207RAMLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds
208endif
205LINKRAM := $(BUILDDIR)/ram.link 209LINKRAM := $(BUILDDIR)/ram.link
206ROMLDS := $(FIRMDIR)/rom.lds 210ROMLDS := $(FIRMDIR)/rom.lds
207LINKROM := $(BUILDDIR)/rom.link 211LINKROM := $(BUILDDIR)/rom.link