diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2011-02-06 20:10:45 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2011-02-06 20:10:45 +0000 |
commit | 924121005083bf6f07f877dfc6eb6c0e2908316d (patch) | |
tree | dfe3b9140965dca6c0b2adfc71a46dcad693bc98 /firmware/target/arm/tms320dm320/app.lds | |
parent | 02dbde70970b002f1a77583a496c1d669e6c0537 (diff) | |
download | rockbox-924121005083bf6f07f877dfc6eb6c0e2908316d.tar.gz rockbox-924121005083bf6f07f877dfc6eb6c0e2908316d.zip |
DM320: Re-write of crt0.S and update to app linker script.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29224 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tms320dm320/app.lds')
-rw-r--r-- | firmware/target/arm/tms320dm320/app.lds | 164 |
1 files changed, 99 insertions, 65 deletions
diff --git a/firmware/target/arm/tms320dm320/app.lds b/firmware/target/arm/tms320dm320/app.lds index 3a9c01708a..ab871bb9c5 100644 --- a/firmware/target/arm/tms320dm320/app.lds +++ b/firmware/target/arm/tms320dm320/app.lds | |||
@@ -1,6 +1,6 @@ | |||
1 | #include "config.h" | 1 | #include "config.h" |
2 | 2 | ||
3 | ENTRY(start) | 3 | ENTRY(_start) |
4 | 4 | ||
5 | OUTPUT_FORMAT(elf32-littlearm) | 5 | OUTPUT_FORMAT(elf32-littlearm) |
6 | OUTPUT_ARCH(arm) | 6 | OUTPUT_ARCH(arm) |
@@ -16,7 +16,7 @@ STARTUP(target/arm/tms320dm320/crt0.o) | |||
16 | 16 | ||
17 | #define LCD_FUDGE LCD_NATIVE_WIDTH%32 | 17 | #define LCD_FUDGE LCD_NATIVE_WIDTH%32 |
18 | 18 | ||
19 | #define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2) | 19 | #define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2) |
20 | 20 | ||
21 | /* must be 16Kb (0x4000) aligned */ | 21 | /* must be 16Kb (0x4000) aligned */ |
22 | #define TTB_SIZE 0x4000 | 22 | #define TTB_SIZE 0x4000 |
@@ -30,112 +30,144 @@ STARTUP(target/arm/tms320dm320/crt0.o) | |||
30 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | 30 | #define DRAMSIZE (MEMORYSIZE * 0x100000) |
31 | 31 | ||
32 | #define DRAMORIG 0x00900000 | 32 | #define DRAMORIG 0x00900000 |
33 | #define IRAMORIG 0x00000000 | 33 | |
34 | #define IRAMSIZE 0x4000 | 34 | #define FLASHORIG 0x00100000 |
35 | #define FLASHSIZE 0x00800000 | ||
36 | |||
37 | #define ITCMORIG 0x00000000 | ||
38 | #define ITCMSIZE 0x4000 | ||
39 | |||
40 | #define DTCMORIG 0x00020000 | ||
41 | #define DTCMSIZE 0x4000 | ||
42 | |||
43 | PRO_STACK_SIZE = 0x2000; | ||
44 | IRQ_STACK_SIZE = 0x600; | ||
45 | FIQ_STACK_SIZE = 0x400; | ||
35 | 46 | ||
36 | /* End of the audio buffer, where the codec buffer starts */ | 47 | /* End of the audio buffer, where the codec buffer starts */ |
37 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA) | 48 | #define ENDAUDIOADDR \ |
49 | (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA) | ||
38 | 50 | ||
39 | MEMORY | 51 | MEMORY |
40 | { | 52 | { |
41 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | 53 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE |
42 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | 54 | ITCM : ORIGIN = ITCMORIG, LENGTH = ITCMSIZE |
55 | DTCM : ORIGIN = DTCMORIG, LENGTH = DTCMSIZE | ||
43 | } | 56 | } |
44 | 57 | ||
45 | SECTIONS | 58 | SECTIONS |
46 | { | 59 | { |
47 | .text : | 60 | /* Set up variables needed for memory initialization */ |
61 | _sdram_start = DRAMORIG; | ||
62 | _sdram_sizem = ((_endsdram - _sdram_start) / 0x100000); | ||
63 | |||
64 | _flash_start = FLASHORIG; | ||
65 | _flash_sizem = (FLASHSIZE / 0x100000); | ||
66 | |||
67 | /* crt0.S initialization */ | ||
68 | .init : | ||
48 | { | 69 | { |
70 | . = ALIGN(0x4); | ||
49 | loadaddress = .; | 71 | loadaddress = .; |
50 | _loadaddress = .; | 72 | *(.init) |
51 | *(.init.text) | 73 | } > DRAM |
52 | *(.text*) | 74 | |
53 | *(.glue_7) | 75 | .vectors ITCMORIG : |
54 | *(.glue_7t) | 76 | { |
55 | . = ALIGN(0x4); | 77 | . = ALIGN(0x4); |
78 | _vectorsstart = .; | ||
79 | *(.vectors); | ||
80 | _vectorsend = .; | ||
81 | } > ITCM AT> DRAM | ||
82 | |||
83 | _vectorscopy = LOADADDR(.vectors); | ||
84 | |||
85 | .text : | ||
86 | { | ||
87 | . = ALIGN(0x4); | ||
88 | *(.text*) | ||
89 | } > DRAM | ||
90 | |||
91 | /* Thumb interworking sections - for some reason LD dies even if these | ||
92 | * sections are empty. | ||
93 | */ | ||
94 | .glue : | ||
95 | { | ||
96 | . = ALIGN(0x4); | ||
97 | *(.glue_7) /* ARM calling Thumb */ | ||
98 | *(.glue_7t) /* Thumb calling ARM */ | ||
56 | } > DRAM | 99 | } > DRAM |
57 | 100 | ||
58 | .rodata : | 101 | .rodata : |
59 | { | 102 | { |
60 | *(.rodata) /* problems without this, dunno why */ | ||
61 | *(.rodata*) | ||
62 | . = ALIGN(0x4); | 103 | . = ALIGN(0x4); |
104 | *(.rodata*) | ||
63 | } > DRAM | 105 | } > DRAM |
64 | 106 | ||
65 | .data : | 107 | .data : |
66 | { | 108 | { |
67 | *(.data*) | ||
68 | . = ALIGN(0x4); | 109 | . = ALIGN(0x4); |
110 | *(.data*) | ||
69 | } > DRAM | 111 | } > DRAM |
70 | 112 | ||
71 | /DISCARD/ : | 113 | .bss (NOLOAD) : |
72 | { | ||
73 | *(.eh_frame) | ||
74 | } | ||
75 | |||
76 | .vectors IRAMORIG : | ||
77 | { | 114 | { |
78 | _vectorsstart = .; | 115 | . = ALIGN(0x4); |
79 | *(.vectors); | 116 | _bss_start = .; |
80 | _vectorsend = .; | 117 | *(.bss*) |
81 | } > IRAM AT> DRAM | 118 | *(COMMON) |
82 | 119 | _bss_end = .; | |
83 | _vectorscopy = LOADADDR(.vectors); | 120 | } > DRAM |
84 | 121 | ||
85 | .iram : | 122 | .iram : |
86 | { | 123 | { |
124 | . = ALIGN(0x4); | ||
87 | _iramstart = .; | 125 | _iramstart = .; |
88 | *(.icode) | 126 | *(.icode) |
89 | *(.irodata*) | 127 | *(.irodata) |
90 | *(.idata) | 128 | *(.idata) |
91 | . = ALIGN(0x4); | ||
92 | _iramend = .; | 129 | _iramend = .; |
93 | } > IRAM AT> DRAM | 130 | } > ITCM AT> DRAM |
94 | 131 | ||
95 | _iramcopy = LOADADDR(.iram); | 132 | _iramcopy = LOADADDR(.iram); |
96 | 133 | ||
97 | .ibss (NOLOAD) : | 134 | .ibss DTCMORIG + _iramend (NOLOAD) : |
98 | { | 135 | { |
99 | _iedata = .; | ||
100 | *(.ibss) | ||
101 | . = ALIGN(0x4); | 136 | . = ALIGN(0x4); |
102 | _iend = .; | 137 | _ibss_start = .; |
103 | } > IRAM | 138 | *(.ibss) |
139 | _ibss_end = .; | ||
140 | } > DTCM | ||
104 | 141 | ||
105 | .stack (NOLOAD) : | 142 | /* Program stack space */ |
143 | .pro_stack (NOLOAD): | ||
106 | { | 144 | { |
107 | *(.stack) | 145 | . = ALIGN(0x4); |
108 | stackbegin = .; | 146 | *(.stack) |
109 | . += 0x2000; | 147 | stackbegin = .; /* Variable for thread.c */ |
110 | stackend = .; | 148 | _pro_stack_end = .; |
111 | } > IRAM | 149 | . += PRO_STACK_SIZE; |
150 | _pro_stack_start = .; | ||
151 | stackend = .; /* Variable for tread.c */ | ||
152 | } > DTCM | ||
112 | 153 | ||
113 | .irqstack (NOLOAD) : | 154 | /* IRQ stack space */ |
155 | .irq_stack (NOLOAD): | ||
114 | { | 156 | { |
115 | *(.stack) | 157 | . = ALIGN(0x4); |
116 | . += 0x400; | 158 | _irq_stack_end = .; |
117 | irq_stack = .; | 159 | . += IRQ_STACK_SIZE; |
118 | } > IRAM | 160 | _irq_stack_start = .; |
119 | 161 | } > DTCM | |
120 | .fiqstack (NOLOAD) : | 162 | |
121 | { | 163 | /* FIQ stack space */ |
122 | *(.stack) | 164 | .fiq_stack (NOLOAD): |
123 | . += 0x400; | ||
124 | fiq_stack = .; | ||
125 | } > IRAM | ||
126 | |||
127 | /* This overwrites the iram (in ram), so make sure that the iram is copied | ||
128 | * out in crt0.s before the bss section and the rest are used. | ||
129 | */ | ||
130 | .bss (NOLOAD) : | ||
131 | { | 165 | { |
132 | . = ADDR(.data) + SIZEOF(.data); | ||
133 | _edata = .; | ||
134 | *(.bss*) | ||
135 | *(COMMON) | ||
136 | . = ALIGN(0x4); | 166 | . = ALIGN(0x4); |
137 | _end = .; | 167 | _fiq_stack_end = .; |
138 | } > DRAM | 168 | . += FIQ_STACK_SIZE; |
169 | _fiq_stack_start = .; | ||
170 | } > DTCM | ||
139 | 171 | ||
140 | .audiobuf (NOLOAD) : | 172 | .audiobuf (NOLOAD) : |
141 | { | 173 | { |
@@ -160,6 +192,8 @@ SECTIONS | |||
160 | . += PLUGIN_BUFFER_SIZE; | 192 | . += PLUGIN_BUFFER_SIZE; |
161 | } > DRAM | 193 | } > DRAM |
162 | 194 | ||
195 | _endsdram = .; | ||
196 | |||
163 | .ttbtable (NOLOAD) : | 197 | .ttbtable (NOLOAD) : |
164 | { | 198 | { |
165 | . = ALIGN (0x4000); | 199 | . = ALIGN (0x4000); |