1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thomas Martitz 2010-04-05 19:18:15 +00:00
parent 527a2e64ab
commit 02afc271c9
6 changed files with 18 additions and 14 deletions

View file

@ -68,7 +68,7 @@ OUTPUT_FORMAT(elf32-littlemips)
#elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2
#include "cpu.h" #include "cpu.h"
#define DRAMORIG DRAM_ORIG #define DRAMORIG DRAM_ORIG
#ifdef AMS_LOWMEM #if defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE) #define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE)
#else #else
#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE) #define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE)
@ -131,7 +131,7 @@ OUTPUT_FORMAT(elf32-littlemips)
#define IRAMSIZE 0 #define IRAMSIZE 0
#elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2
#ifdef AMS_LOWMEM #if defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
#define IRAMSIZE 0 /* simulates no IRAM since codec is already entirely in IRAM */ #define IRAMSIZE 0 /* simulates no IRAM since codec is already entirely in IRAM */
#define CODEC_ORIGIN (IRAM_ORIG + IRAM_SIZE - CODEC_SIZE) #define CODEC_ORIGIN (IRAM_ORIG + IRAM_SIZE - CODEC_SIZE)
#define PLUGIN_ORIGIN (DRAM_ORIG + DRAMSIZE) #define PLUGIN_ORIGIN (DRAM_ORIG + DRAMSIZE)

View file

@ -719,8 +719,8 @@ Lyre prototype 1 */
defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \ defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \ defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
(CONFIG_CPU == AS3525 && MEMORYSIZE > 2) || /* AS3525 +2MB: core, plugins, codecs */ \ (CONFIG_CPU == AS3525 && MEMORYSIZE > 2) || /* AS3525 +2MB: core, plugins, codecs */ \
(CONFIG_CPU == AS3525v2) || /* AS3525v2: core, plugins, codecs */ \ (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525 2MB: core only */ \
(CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525 2MB:core only */ \ (CONFIG_CPU == AS3525v2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525v2: core only */ \
(CONFIG_CPU == PNX0101) || \ (CONFIG_CPU == PNX0101) || \
defined(CPU_S5L870X)) || /* Samsung S5L8700: core, plugins, codecs */ \ defined(CPU_S5L870X)) || /* Samsung S5L8700: core, plugins, codecs */ \
(CONFIG_CPU == JZ4732 && !defined(PLUGIN) && !defined(CODEC)) /* Jz4740: core only */ (CONFIG_CPU == JZ4732 && !defined(PLUGIN) && !defined(CODEC)) /* Jz4740: core only */
@ -729,7 +729,8 @@ Lyre prototype 1 */
#define IDATA_ATTR __attribute__ ((section(".idata"))) #define IDATA_ATTR __attribute__ ((section(".idata")))
#define IBSS_ATTR __attribute__ ((section(".ibss"))) #define IBSS_ATTR __attribute__ ((section(".ibss")))
#define USE_IRAM #define USE_IRAM
#if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) && CONFIG_CPU != JZ4732 #if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) \
&& CONFIG_CPU != JZ4732
#define PLUGIN_USE_IRAM #define PLUGIN_USE_IRAM
#endif #endif
#if defined(CPU_ARM) #if defined(CPU_ARM)
@ -747,7 +748,8 @@ Lyre prototype 1 */
#define IBSS_ATTR #define IBSS_ATTR
#define STATICIRAM static #define STATICIRAM static
#endif #endif
#if (defined(CPU_PP) || (CONFIG_CPU == AS3525)) && !defined(SIMULATOR) && !defined(BOOTLOADER) #if (defined(CPU_PP) || (CONFIG_CPU == AS3525)) \
&& !defined(SIMULATOR) && !defined(BOOTLOADER)
/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after /* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
* root_menu() has been called. Their code may be overwritten by other data or * root_menu() has been called. Their code may be overwritten by other data or
* code in order to save RAM, and references to them might point into * code in order to save RAM, and references to them might point into

View file

@ -112,7 +112,7 @@
#define HAVE_FAT16SUPPORT #define HAVE_FAT16SUPPORT
/* The number of bytes reserved for loadable codecs */ /* The number of bytes reserved for loadable codecs */
#define CODEC_SIZE 0x100000 #define CODEC_SIZE (0x100000-0x8000)
/* The number of bytes reserved for loadable plugins */ /* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000 #define PLUGIN_BUFFER_SIZE 0x80000

View file

@ -108,7 +108,7 @@
#define HAVE_FAT16SUPPORT #define HAVE_FAT16SUPPORT
/* The number of bytes reserved for loadable codecs */ /* The number of bytes reserved for loadable codecs */
#define CODEC_SIZE 0x100000 #define CODEC_SIZE (0x100000-0x8000)
/* The number of bytes reserved for loadable plugins */ /* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000 #define PLUGIN_BUFFER_SIZE 0x80000

View file

@ -100,7 +100,7 @@
#define HAVE_FAT16SUPPORT #define HAVE_FAT16SUPPORT
/* The number of bytes reserved for loadable codecs */ /* The number of bytes reserved for loadable codecs */
#define CODEC_SIZE 0x100000 #define CODEC_SIZE (0x100000-0x8000)
/* The number of bytes reserved for loadable plugins */ /* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000 #define PLUGIN_BUFFER_SIZE 0x80000

View file

@ -23,8 +23,10 @@ STARTUP(target/arm/crt0.o)
/* End of the audio buffer, where the codec buffer starts */ /* End of the audio buffer, where the codec buffer starts */
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
#define CODEC_BUFFER_FILLS_IRAM defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
#ifdef AMS_LOWMEM #if CODEC_BUFFER_FILLS_IRAM
/* Entire codec buffer in IRAM */
#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE) #define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE)
#define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE)) #define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE))
#define IRAMSIZE (IRAM_SIZE - CODEC_SIZE) #define IRAMSIZE (IRAM_SIZE - CODEC_SIZE)
@ -36,7 +38,7 @@ STARTUP(target/arm/crt0.o)
/* Where the codec buffer ends, and the plugin buffer starts */ /* Where the codec buffer ends, and the plugin buffer starts */
#ifdef AMS_LOWMEM #if CODEC_BUFFER_FILLS_IRAM
#define ENDADDR (ENDAUDIOADDR) #define ENDADDR (ENDAUDIOADDR)
#else #else
#define ENDADDR (ENDAUDIOADDR + CODECSIZE) #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
@ -44,7 +46,7 @@ STARTUP(target/arm/crt0.o)
MEMORY MEMORY
{ {
#ifdef AMS_LOWMEM #if CODEC_BUFFER_FILLS_IRAM
CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE
#endif #endif
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
@ -110,7 +112,7 @@ SECTIONS
_iend = .; _iend = .;
} > IRAM } > IRAM
.init CODECORIG : .init ENDADDR :
{ {
. = ALIGN(4); . = ALIGN(4);
_initstart = .; _initstart = .;
@ -154,7 +156,7 @@ SECTIONS
{ {
codecbuf = .; codecbuf = .;
_codecbuf = .; _codecbuf = .;
#ifdef AMS_LOWMEM #if CODEC_BUFFER_FILLS_IRAM
} > CODEC_IRAM } > CODEC_IRAM
#else #else
} > DRAM } > DRAM