summaryrefslogtreecommitdiff
path: root/apps/plugins/plugin.lds
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-04-06 04:34:57 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-04-06 04:34:57 +0000
commit05099149f193cac0c81b0129c17feb78b1a9681a (patch)
tree3dd5494dd494bcb4490ddcedef99e9f3a895cd3f /apps/plugins/plugin.lds
parentbe698f086de4641a45dffd9289671588c2391a3c (diff)
downloadrockbox-05099149f193cac0c81b0129c17feb78b1a9681a.tar.gz
rockbox-05099149f193cac0c81b0129c17feb78b1a9681a.zip
Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now with shared variables in DRAM (it seems swp(b) is at least partially broken on all PP or I'm doing something very wrong here :\). For core-shared data use SHAREDBSS/DATA_ATTR. NOCACHEBSS/DATA_ATTR is available whether or not single core is forced for static peripheral-DMA buffer allocation without use of the UNCACHED_ADDR macro in code and is likely useful on a non-PP target with a data cache (although not actually enabled in config.h and the .lds's in this commit).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16981 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/plugin.lds')
-rw-r--r--apps/plugins/plugin.lds47
1 files changed, 43 insertions, 4 deletions
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 9659412730..8699ca1c25 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -16,6 +16,20 @@ OUTPUT_FORMAT(elf32-sh)
16#define STUBOFFSET 0 16#define STUBOFFSET 0
17#endif 17#endif
18 18
19#if defined(CPU_PP)
20#ifdef CPU_PP502x
21#define NOCACHE_BASE 0x10000000
22#else
23#define NOCACHE_BASE 0x28000000
24#endif /* CPU_* */
25#define CACHEALIGN_SIZE 16
26#endif /* CPU_PP */
27
28#ifndef NOCACHE_BASE
29/* Default to no offset if target doesn't define this */
30#define NOCACHE_BASE 0x00000000
31#endif
32
19#if CONFIG_CPU==S3C2440 33#if CONFIG_CPU==S3C2440
20#include "s3c2440.h" 34#include "s3c2440.h"
21#define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE 35#define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
@@ -119,10 +133,20 @@ SECTIONS
119 .data : 133 .data :
120 { 134 {
121 *(.data*) 135 *(.data*)
136 } > PLUGIN_RAM
137
138#if NOCACHE_BASE != 0
139 .ncdata . + NOCACHE_BASE :
140 {
141 . = ALIGN(CACHEALIGN_SIZE);
142 *(.ncdata*)
143 . = ALIGN(CACHEALIGN_SIZE);
144 } AT> PLUGIN_RAM
145#endif
146
122#if defined(IRAMSIZE) 147#if defined(IRAMSIZE)
123 iramcopy = .; 148 iramcopy = . - NOCACHE_BASE;
124#endif 149#endif
125 } > PLUGIN_RAM
126 150
127 /DISCARD/ : 151 /DISCARD/ :
128 { 152 {
@@ -139,6 +163,7 @@ SECTIONS
139 iramend = .; 163 iramend = .;
140 } > PLUGIN_IRAM 164 } > PLUGIN_IRAM
141 165
166
142 .ibss (NOLOAD) : 167 .ibss (NOLOAD) :
143 { 168 {
144 iedata = .; 169 iedata = .;
@@ -150,13 +175,27 @@ SECTIONS
150 175
151 .bss (NOLOAD) : 176 .bss (NOLOAD) :
152 { 177 {
153 plugin_bss_start = .; 178 plugin_bss_start = .;
154 *(.bss*) 179 *(.bss*)
155 *(COMMON) 180 *(COMMON)
156 . = ALIGN(0x4); 181 . = ALIGN(0x4);
182 } > PLUGIN_RAM
183
184#if NOCACHE_BASE != 0
185 .ncbss . + NOCACHE_BASE (NOLOAD) :
186 {
187 . = ALIGN(CACHEALIGN_SIZE);
188 *(.ncbss*)
189 . = ALIGN(CACHEALIGN_SIZE);
190 } AT> PLUGIN_RAM
191#endif
192
193 /* Restore . */
194 .pluginend . - NOCACHE_BASE :
195 {
157 _plugin_end_addr = .; 196 _plugin_end_addr = .;
158 plugin_end_addr = .; 197 plugin_end_addr = .;
159 } > PLUGIN_RAM 198 }
160 199
161 /* Special trick to avoid a linker error when no other sections are 200 /* Special trick to avoid a linker error when no other sections are
162 left after garbage collection (plugin not for this platform) */ 201 left after garbage collection (plugin not for this platform) */