Gigabeat S: Place SDMA code load address starting in uninitialized section address and copy it to the plugin buffer since it only needed very early in initialization. Will save about 6K in RAM.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19963 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2009-02-10 11:34:15 +00:00
parent ca07873607
commit e1e8101837
3 changed files with 41 additions and 9 deletions

View file

@ -91,16 +91,18 @@ SECTIONS
} AT> DRAM } AT> DRAM
_vectorscopy = LOADADDR(.vectors); _vectorscopy = LOADADDR(.vectors);
.stack : .stack (NOLOAD) :
{ {
*(.stack) *(.stack)
stackbegin = .; stackbegin = .;
. += 0x2000; . += 0x2000;
stackend = .; stackend = .;
} > DRAM } > DRAM
_sdmacodecopy = stackbegin;
.bss : .bss (NOLOAD) :
{ {
_edata = .; _edata = .;
*(.bss*) *(.bss*)
@ -110,30 +112,38 @@ SECTIONS
_end = .; _end = .;
} > DRAM } > DRAM
.audiobuf ALIGN(4) : .audiobuf (NOLOAD) :
{ {
. = ALIGN(0x4);
_audiobuffer = .; _audiobuffer = .;
audiobuffer = .; audiobuffer = .;
} > DRAM } > DRAM
.audiobufend ENDAUDIOADDR: .audiobufend ENDAUDIOADDR (NOLOAD) :
{ {
audiobufend = .; audiobufend = .;
_audiobufend = .; _audiobufend = .;
} > DRAM } > DRAM
.codec ENDAUDIOADDR: .codec ENDAUDIOADDR (NOLOAD) :
{ {
codecbuf = .; codecbuf = .;
_codecbuf = .; _codecbuf = .;
} }
.plugin ENDADDR: .plugin ENDADDR (NOLOAD) :
{ {
_pluginbuf = .; _pluginbuf = .;
pluginbuf = .; pluginbuf = .;
} }
.sdma _pluginbuf : AT( _sdmacodecopy )
{
_sdmacodestart = .;
*(.sdmacode);
_sdmacodeend = .;
}
.devbss (NOLOAD) : .devbss (NOLOAD) :
{ {
_devbssdata = .; _devbssdata = .;

View file

@ -231,6 +231,26 @@ remap_end:
bhi 1b bhi 1b
#endif /* BOOTLOADER */ #endif /* BOOTLOADER */
#ifndef BOOTLOADER
/* Copy discardable SDMA code - loaded in the stack section
* and so must be done first. Destination is the plugin buffer
* which is safe when SDMA init takes place just after kernel
* init. */
ldr r4, =_sdmacodecopy
ldr r3, =_sdmacodeend
ldr r2, =_sdmacodestart
1:
cmp r3, r2
ldrhi r5, [r4], #4
strhi r5, [r2], #4
bhi 1b
/* Make buffer coherent */
ldr r0, =_sdmacodestart
sub r1, r3, r0
bl clean_dcache_range
#endif /* BOOTLOADER */
/* Initialise bss section to zero */ /* Initialise bss section to zero */
ldr r2, =_edata ldr r2, =_edata
ldr r3, =_end ldr r3, =_end

View file

@ -356,7 +356,8 @@
/*! /*!
* Code download for i.MX system revision = 1.0 * Code download for i.MX system revision = 1.0
*/ */
static __attribute__((aligned(4))) const short sdma_code_1[RAM_CODE_SIZE_1] = static __attribute__((aligned(4), section(".sdmacode")))
const short sdma_code_1[RAM_CODE_SIZE_1] =
{ {
0xc0ec, 0x7d59, 0x0970, 0x0111, 0x5111, 0x5ad1, 0x5bd9, 0xc0fe, 0xc0ec, 0x7d59, 0x0970, 0x0111, 0x5111, 0x5ad1, 0x5bd9, 0xc0fe,
0x5ce1, 0x7d02, 0x0200, 0x9806, 0x08ff, 0x0011, 0x28ff, 0x00bc, 0x5ce1, 0x7d02, 0x0200, 0x9806, 0x08ff, 0x0011, 0x28ff, 0x00bc,
@ -851,7 +852,8 @@ static __attribute__((aligned(4))) const short sdma_code_1[RAM_CODE_SIZE_1] =
/*! /*!
* Code download for i.MX system revision > 1.0 * Code download for i.MX system revision > 1.0
*/ */
static __attribute__((aligned(4))) const short sdma_code_2[RAM_CODE_SIZE_2] = static __attribute__((aligned(4), section(".sdmacode")))
const short sdma_code_2[RAM_CODE_SIZE_2] =
{ {
0x0870, 0x0011, 0x5010, 0xc0ec, 0x7d61, 0x5ac0, 0x5bc8, 0x5ef8, 0x0870, 0x0011, 0x5010, 0xc0ec, 0x7d61, 0x5ac0, 0x5bc8, 0x5ef8,
0xc0fe, 0x56f8, 0x7d02, 0x0200, 0x9806, 0x6ec3, 0x6d07, 0x5df0, 0xc0fe, 0x56f8, 0x7d02, 0x0200, 0x9806, 0x6ec3, 0x6d07, 0x5df0,