summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-04-05 19:18:15 +0000
committerThomas Martitz <kugel@rockbox.org>2010-04-05 19:18:15 +0000
commit02afc271c92c9138a51c22ff723872c7a430f74e (patch)
treefa6e2487cfd351d684d28b36f392040a27654b5e
parent527a2e64ab23fee104bf447e06fdefb38c211418 (diff)
downloadrockbox-02afc271c92c9138a51c22ff723872c7a430f74e.tar.gz
rockbox-02afc271c92c9138a51c22ff723872c7a430f74e.zip
as3525v2: Move codec into iram freeing 1MB for the audio buffer and also a small decoding speedup (iram seems to be 50% faster than dram when boosted and the same when unboosed). 32k is still reserved for the core and can be readjusted if needed. Codecs don't appear to ever need the 1MB (usually <350k only).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25491 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/plugin.lds4
-rw-r--r--firmware/export/config.h10
-rw-r--r--firmware/export/config/sansaclipplus.h2
-rw-r--r--firmware/export/config/sansaclipv2.h2
-rw-r--r--firmware/export/config/sansafuzev2.h2
-rw-r--r--firmware/target/arm/as3525/app.lds12
6 files changed, 18 insertions, 14 deletions
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 0ef27603e9..3a88867fa1 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -68,7 +68,7 @@ OUTPUT_FORMAT(elf32-littlemips)
68#elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 68#elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2
69#include "cpu.h" 69#include "cpu.h"
70#define DRAMORIG DRAM_ORIG 70#define DRAMORIG DRAM_ORIG
71#ifdef AMS_LOWMEM 71#if defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
72#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE) 72#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE)
73#else 73#else
74#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE) 74#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE)
@@ -131,7 +131,7 @@ OUTPUT_FORMAT(elf32-littlemips)
131#define IRAMSIZE 0 131#define IRAMSIZE 0
132 132
133#elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 133#elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2
134#ifdef AMS_LOWMEM 134#if defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
135#define IRAMSIZE 0 /* simulates no IRAM since codec is already entirely in IRAM */ 135#define IRAMSIZE 0 /* simulates no IRAM since codec is already entirely in IRAM */
136#define CODEC_ORIGIN (IRAM_ORIG + IRAM_SIZE - CODEC_SIZE) 136#define CODEC_ORIGIN (IRAM_ORIG + IRAM_SIZE - CODEC_SIZE)
137#define PLUGIN_ORIGIN (DRAM_ORIG + DRAMSIZE) 137#define PLUGIN_ORIGIN (DRAM_ORIG + DRAMSIZE)
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 5bff51fbef..04bf15faaf 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -719,8 +719,8 @@ Lyre prototype 1 */
719 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \ 719 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
720 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \ 720 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
721 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2) || /* AS3525 +2MB: core, plugins, codecs */ \ 721 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2) || /* AS3525 +2MB: core, plugins, codecs */ \
722 (CONFIG_CPU == AS3525v2) || /* AS3525v2: core, plugins, codecs */ \ 722 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525 2MB: core only */ \
723 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525 2MB:core only */ \ 723 (CONFIG_CPU == AS3525v2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525v2: core only */ \
724 (CONFIG_CPU == PNX0101) || \ 724 (CONFIG_CPU == PNX0101) || \
725 defined(CPU_S5L870X)) || /* Samsung S5L8700: core, plugins, codecs */ \ 725 defined(CPU_S5L870X)) || /* Samsung S5L8700: core, plugins, codecs */ \
726 (CONFIG_CPU == JZ4732 && !defined(PLUGIN) && !defined(CODEC)) /* Jz4740: core only */ 726 (CONFIG_CPU == JZ4732 && !defined(PLUGIN) && !defined(CODEC)) /* Jz4740: core only */
@@ -729,7 +729,8 @@ Lyre prototype 1 */
729#define IDATA_ATTR __attribute__ ((section(".idata"))) 729#define IDATA_ATTR __attribute__ ((section(".idata")))
730#define IBSS_ATTR __attribute__ ((section(".ibss"))) 730#define IBSS_ATTR __attribute__ ((section(".ibss")))
731#define USE_IRAM 731#define USE_IRAM
732#if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) && CONFIG_CPU != JZ4732 732#if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) \
733 && CONFIG_CPU != JZ4732
733#define PLUGIN_USE_IRAM 734#define PLUGIN_USE_IRAM
734#endif 735#endif
735#if defined(CPU_ARM) 736#if defined(CPU_ARM)
@@ -747,7 +748,8 @@ Lyre prototype 1 */
747#define IBSS_ATTR 748#define IBSS_ATTR
748#define STATICIRAM static 749#define STATICIRAM static
749#endif 750#endif
750#if (defined(CPU_PP) || (CONFIG_CPU == AS3525)) && !defined(SIMULATOR) && !defined(BOOTLOADER) 751#if (defined(CPU_PP) || (CONFIG_CPU == AS3525)) \
752 && !defined(SIMULATOR) && !defined(BOOTLOADER)
751/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after 753/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
752 * root_menu() has been called. Their code may be overwritten by other data or 754 * root_menu() has been called. Their code may be overwritten by other data or
753 * code in order to save RAM, and references to them might point into 755 * code in order to save RAM, and references to them might point into
diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h
index c5e6aa5c34..ed8c7bb685 100644
--- a/firmware/export/config/sansaclipplus.h
+++ b/firmware/export/config/sansaclipplus.h
@@ -112,7 +112,7 @@
112#define HAVE_FAT16SUPPORT 112#define HAVE_FAT16SUPPORT
113 113
114/* The number of bytes reserved for loadable codecs */ 114/* The number of bytes reserved for loadable codecs */
115#define CODEC_SIZE 0x100000 115#define CODEC_SIZE (0x100000-0x8000)
116 116
117/* The number of bytes reserved for loadable plugins */ 117/* The number of bytes reserved for loadable plugins */
118#define PLUGIN_BUFFER_SIZE 0x80000 118#define PLUGIN_BUFFER_SIZE 0x80000
diff --git a/firmware/export/config/sansaclipv2.h b/firmware/export/config/sansaclipv2.h
index 8ac90ddcde..876d95ac22 100644
--- a/firmware/export/config/sansaclipv2.h
+++ b/firmware/export/config/sansaclipv2.h
@@ -108,7 +108,7 @@
108#define HAVE_FAT16SUPPORT 108#define HAVE_FAT16SUPPORT
109 109
110/* The number of bytes reserved for loadable codecs */ 110/* The number of bytes reserved for loadable codecs */
111#define CODEC_SIZE 0x100000 111#define CODEC_SIZE (0x100000-0x8000)
112 112
113/* The number of bytes reserved for loadable plugins */ 113/* The number of bytes reserved for loadable plugins */
114#define PLUGIN_BUFFER_SIZE 0x80000 114#define PLUGIN_BUFFER_SIZE 0x80000
diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h
index 73ac7ce17a..71d76f4725 100644
--- a/firmware/export/config/sansafuzev2.h
+++ b/firmware/export/config/sansafuzev2.h
@@ -100,7 +100,7 @@
100#define HAVE_FAT16SUPPORT 100#define HAVE_FAT16SUPPORT
101 101
102/* The number of bytes reserved for loadable codecs */ 102/* The number of bytes reserved for loadable codecs */
103#define CODEC_SIZE 0x100000 103#define CODEC_SIZE (0x100000-0x8000)
104 104
105/* The number of bytes reserved for loadable plugins */ 105/* The number of bytes reserved for loadable plugins */
106#define PLUGIN_BUFFER_SIZE 0x80000 106#define PLUGIN_BUFFER_SIZE 0x80000
diff --git a/firmware/target/arm/as3525/app.lds b/firmware/target/arm/as3525/app.lds
index 56a4b20fa6..f9d070e60d 100644
--- a/firmware/target/arm/as3525/app.lds
+++ b/firmware/target/arm/as3525/app.lds
@@ -23,8 +23,10 @@ STARTUP(target/arm/crt0.o)
23/* End of the audio buffer, where the codec buffer starts */ 23/* End of the audio buffer, where the codec buffer starts */
24#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) 24#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
25 25
26#define CODEC_BUFFER_FILLS_IRAM defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
26 27
27#ifdef AMS_LOWMEM 28#if CODEC_BUFFER_FILLS_IRAM
29/* Entire codec buffer in IRAM */
28#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE) 30#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE)
29#define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE)) 31#define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE))
30#define IRAMSIZE (IRAM_SIZE - CODEC_SIZE) 32#define IRAMSIZE (IRAM_SIZE - CODEC_SIZE)
@@ -36,7 +38,7 @@ STARTUP(target/arm/crt0.o)
36 38
37 39
38/* Where the codec buffer ends, and the plugin buffer starts */ 40/* Where the codec buffer ends, and the plugin buffer starts */
39#ifdef AMS_LOWMEM 41#if CODEC_BUFFER_FILLS_IRAM
40#define ENDADDR (ENDAUDIOADDR) 42#define ENDADDR (ENDAUDIOADDR)
41#else 43#else
42#define ENDADDR (ENDAUDIOADDR + CODECSIZE) 44#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
@@ -44,7 +46,7 @@ STARTUP(target/arm/crt0.o)
44 46
45MEMORY 47MEMORY
46{ 48{
47#ifdef AMS_LOWMEM 49#if CODEC_BUFFER_FILLS_IRAM
48 CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE 50 CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE
49#endif 51#endif
50 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE 52 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
@@ -110,7 +112,7 @@ SECTIONS
110 _iend = .; 112 _iend = .;
111 } > IRAM 113 } > IRAM
112 114
113 .init CODECORIG : 115 .init ENDADDR :
114 { 116 {
115 . = ALIGN(4); 117 . = ALIGN(4);
116 _initstart = .; 118 _initstart = .;
@@ -154,7 +156,7 @@ SECTIONS
154 { 156 {
155 codecbuf = .; 157 codecbuf = .;
156 _codecbuf = .; 158 _codecbuf = .;
157#ifdef AMS_LOWMEM 159#if CODEC_BUFFER_FILLS_IRAM
158 } > CODEC_IRAM 160 } > CODEC_IRAM
159#else 161#else
160 } > DRAM 162 } > DRAM