diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-05-20 21:09:53 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-05-20 21:09:53 +0000 |
commit | 4633446517c002ed81cdbbc6acb9b8ffd9becc85 (patch) | |
tree | aa2e1dc82908bd4568e885a37545f94f07579a2a /firmware/target | |
parent | fba4be213f399f19933aadcce25498ea1fb0c176 (diff) |
Sansa AMS: Centralise mapping of RAM and IRAM in as3525.h via #defines. This will hopefully make ongoing mmu work easier as less places need to be changed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21000 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/as3525/app.lds | 40 | ||||
-rw-r--r-- | firmware/target/arm/as3525/boot.lds | 10 |
2 files changed, 24 insertions, 26 deletions
diff --git a/firmware/target/arm/as3525/app.lds b/firmware/target/arm/as3525/app.lds index 7f37cc5d7c..45ae30f9f3 100644 --- a/firmware/target/arm/as3525/app.lds +++ b/firmware/target/arm/as3525/app.lds @@ -1,4 +1,5 @@ #include "config.h" +#include "cpu.h" ENTRY(start) @@ -6,11 +7,6 @@ OUTPUT_FORMAT(elf32-littlearm) OUTPUT_ARCH(arm) STARTUP(target/arm/crt0.o) -#if MEMORYSIZE <= 2 -/* we put the codec buffer in IRAM */ -#define LOWMEM -#endif - #define PLUGINSIZE PLUGIN_BUFFER_SIZE #define CODECSIZE CODEC_SIZE @@ -20,26 +16,27 @@ STARTUP(target/arm/crt0.o) #define STUBOFFSET 0 #endif -#include "cpu.h" -#ifdef LOWMEM -#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE -#define CODECORIG (IRAMORIG + 0x50000 - CODEC_SIZE) -#define IRAMSIZE (0x50000 - CODEC_SIZE) +#define IRAMORIG IRAM_ORIG +#define DRAMORIG (DRAM_ORIG + STUBOFFSET) + +/* End of the audio buffer, where the codec buffer starts */ +#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) + + +#ifdef AMS_LOWMEM +#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE) +#define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE)) +#define IRAMSIZE (IRAM_SIZE - CODEC_SIZE) #else -#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE - CODECSIZE +#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - CODECSIZE - TTB_SIZE) #define CODECORIG (ENDAUDIOADDR) #define IRAMSIZE (0x20000) #endif -#define IRAMORIG 0x0 -#define DRAMORIG 0x30000000 + STUBOFFSET - -/* End of the audio buffer, where the codec buffer starts */ -#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) /* Where the codec buffer ends, and the plugin buffer starts */ -#ifdef LOWMEM +#ifdef AMS_LOWMEM #define ENDADDR (ENDAUDIOADDR) #else #define ENDADDR (ENDAUDIOADDR + CODECSIZE) @@ -47,7 +44,7 @@ STARTUP(target/arm/crt0.o) MEMORY { -#ifdef LOWMEM +#ifdef AMS_LOWMEM CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE #endif IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE @@ -56,7 +53,7 @@ MEMORY SECTIONS { - loadaddress = 0x30000000; + loadaddress = DRAM_ORIG; .text : { @@ -71,10 +68,7 @@ SECTIONS .rodata : { - *(.rodata) /* problems without this, dunno why */ *(.rodata*) - *(.rodata.str1.1) - *(.rodata.str1.4) . = ALIGN(0x4); } > DRAM @@ -152,7 +146,7 @@ SECTIONS { codecbuf = .; _codecbuf = .; -#ifdef LOWMEM +#ifdef AMS_LOWMEM } > CODEC_IRAM #else } > DRAM diff --git a/firmware/target/arm/as3525/boot.lds b/firmware/target/arm/as3525/boot.lds index 7a13d67a43..a98763e8f6 100644 --- a/firmware/target/arm/as3525/boot.lds +++ b/firmware/target/arm/as3525/boot.lds @@ -1,18 +1,22 @@ #include "config.h" +#include "cpu.h" ENTRY(start) OUTPUT_FORMAT(elf32-littlearm) OUTPUT_ARCH(arm) STARTUP(target/arm/crt0.o) -#define DRAMSIZE (MEMORYSIZE * 0x100000) +/* +No need for DRAM in our bootloader +#define DRAMSIZE (MEMORYSIZE * 0x100000) - TTB_SIZE #define DRAMORIG 0x30000000 -#define IRAMORIG 0 +*/ +#define IRAMORIG 0x81000000 #define IRAMSIZE 0x50000 MEMORY { - DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE + /*DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE*/ IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE } |