forked from len0rd/rockbox
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
This commit is contained in:
parent
fba4be213f
commit
4633446517
5 changed files with 56 additions and 39 deletions
|
@ -1,4 +1,5 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "cpu.h"
|
||||||
|
|
||||||
/* These output formats should be in the config-files */
|
/* These output formats should be in the config-files */
|
||||||
|
|
||||||
|
@ -47,10 +48,11 @@ OUTPUT_FORMAT(elf32-littlemips)
|
||||||
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
|
||||||
|
|
||||||
#elif CONFIG_CPU==AS3525
|
#elif CONFIG_CPU==AS3525
|
||||||
#if MEMORYSIZE <= 2
|
#define DRAMORIG DRAM_ORIG
|
||||||
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET
|
#ifdef AMS_LOWMEM
|
||||||
|
#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE)
|
||||||
#else
|
#else
|
||||||
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
|
#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -110,15 +112,14 @@ OUTPUT_FORMAT(elf32-littlemips)
|
||||||
#define IRAMSIZE 0
|
#define IRAMSIZE 0
|
||||||
|
|
||||||
#elif CONFIG_CPU==AS3525
|
#elif CONFIG_CPU==AS3525
|
||||||
#if MEMORYSIZE <= 2
|
#ifdef AMS_LOWMEM
|
||||||
#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 (0x50000 - CODEC_SIZE)
|
#define CODEC_ORIGIN (IRAM_ORIG + IRAM_SIZE - CODEC_SIZE)
|
||||||
#define PLUGIN_ORIGIN (DRAMORIG + DRAMSIZE)
|
#define PLUGIN_ORIGIN (DRAM_ORIG + DRAMSIZE)
|
||||||
#else
|
#else
|
||||||
#define IRAMORIG 0x20000
|
#define IRAMORIG (IRAM_ORIG + 0x20000)
|
||||||
#define IRAMSIZE 0x30000
|
#define IRAMSIZE (IRAM_ORIG + IRAM_SIZE - IRAMORIG)
|
||||||
#endif
|
#endif
|
||||||
#define DRAMORIG 0x30000000
|
|
||||||
|
|
||||||
#elif CONFIG_CPU == JZ4732
|
#elif CONFIG_CPU == JZ4732
|
||||||
#define DRAMORIG 0x80004000 + STUBOFFSET
|
#define DRAMORIG 0x80004000 + STUBOFFSET
|
||||||
|
|
|
@ -93,8 +93,8 @@ void main(void)
|
||||||
|
|
||||||
printf("Loading firmware");
|
printf("Loading firmware");
|
||||||
|
|
||||||
loadbuffer = (unsigned char*)0x30000000; /* DRAM */
|
loadbuffer = (unsigned char*)DRAM_ORIG; /* DRAM */
|
||||||
buffer_size = (int)(loadbuffer + (MEM * 0x100000));
|
buffer_size = (int)(loadbuffer + (DRAM_SIZE) - TTB_SIZE);
|
||||||
|
|
||||||
ret = load_firmware(loadbuffer, BOOTFILE, buffer_size);
|
ret = load_firmware(loadbuffer, BOOTFILE, buffer_size);
|
||||||
if(ret < 0)
|
if(ret < 0)
|
||||||
|
|
|
@ -22,10 +22,28 @@
|
||||||
|
|
||||||
#define UART_CHANNELS 1
|
#define UART_CHANNELS 1
|
||||||
|
|
||||||
|
|
||||||
|
#if MEMORYSIZE <= 2
|
||||||
|
/* we put the codec buffer in IRAM */
|
||||||
|
#define AMS_LOWMEM
|
||||||
|
#endif
|
||||||
|
/* these addresses are valid after mapping through the MMU */
|
||||||
|
#define DRAM_ORIG 0x30000000
|
||||||
|
#define IRAM_ORIG 0x0
|
||||||
|
|
||||||
|
#define DRAM_SIZE (MEMORYSIZE * 0x100000)
|
||||||
|
#define IRAM_SIZE 0x50000
|
||||||
|
|
||||||
|
|
||||||
/* AS352X only supports 512 Byte HW ECC */
|
/* AS352X only supports 512 Byte HW ECC */
|
||||||
#define ECCSIZE 512
|
#define ECCSIZE 512
|
||||||
#define ECCBYTES 3
|
#define ECCBYTES 3
|
||||||
|
|
||||||
|
/* AS352X MMU Page Table Entries */
|
||||||
|
/* to be implemented */
|
||||||
|
#define TTB_SIZE 0x0 /* Mimics OF */
|
||||||
|
#define TTB_BASE_ADDR (DRAM_ORIG + DRAM_SIZE - TTB_SIZE)
|
||||||
|
|
||||||
|
|
||||||
/* AS352X device base addresses */
|
/* AS352X device base addresses */
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "cpu.h"
|
||||||
|
|
||||||
ENTRY(start)
|
ENTRY(start)
|
||||||
|
|
||||||
|
@ -6,11 +7,6 @@ OUTPUT_FORMAT(elf32-littlearm)
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
STARTUP(target/arm/crt0.o)
|
STARTUP(target/arm/crt0.o)
|
||||||
|
|
||||||
#if MEMORYSIZE <= 2
|
|
||||||
/* we put the codec buffer in IRAM */
|
|
||||||
#define LOWMEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
|
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
|
||||||
#define CODECSIZE CODEC_SIZE
|
#define CODECSIZE CODEC_SIZE
|
||||||
|
|
||||||
|
@ -20,26 +16,27 @@ STARTUP(target/arm/crt0.o)
|
||||||
#define STUBOFFSET 0
|
#define STUBOFFSET 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "cpu.h"
|
|
||||||
|
|
||||||
#ifdef LOWMEM
|
#define IRAMORIG IRAM_ORIG
|
||||||
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE
|
#define DRAMORIG (DRAM_ORIG + STUBOFFSET)
|
||||||
#define CODECORIG (IRAMORIG + 0x50000 - CODEC_SIZE)
|
|
||||||
#define IRAMSIZE (0x50000 - CODEC_SIZE)
|
|
||||||
#else
|
|
||||||
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE - CODECSIZE
|
|
||||||
#define CODECORIG (ENDAUDIOADDR)
|
|
||||||
#define IRAMSIZE (0x20000)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IRAMORIG 0x0
|
|
||||||
#define DRAMORIG 0x30000000 + STUBOFFSET
|
|
||||||
|
|
||||||
/* 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)
|
||||||
|
|
||||||
|
|
||||||
|
#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 (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - CODECSIZE - TTB_SIZE)
|
||||||
|
#define CODECORIG (ENDAUDIOADDR)
|
||||||
|
#define IRAMSIZE (0x20000)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Where the codec buffer ends, and the plugin buffer starts */
|
/* Where the codec buffer ends, and the plugin buffer starts */
|
||||||
#ifdef LOWMEM
|
#ifdef AMS_LOWMEM
|
||||||
#define ENDADDR (ENDAUDIOADDR)
|
#define ENDADDR (ENDAUDIOADDR)
|
||||||
#else
|
#else
|
||||||
#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
|
#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
|
||||||
|
@ -47,7 +44,7 @@ STARTUP(target/arm/crt0.o)
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
#ifdef LOWMEM
|
#ifdef AMS_LOWMEM
|
||||||
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
|
||||||
|
@ -56,7 +53,7 @@ MEMORY
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
loadaddress = 0x30000000;
|
loadaddress = DRAM_ORIG;
|
||||||
|
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
|
@ -71,10 +68,7 @@ SECTIONS
|
||||||
|
|
||||||
.rodata :
|
.rodata :
|
||||||
{
|
{
|
||||||
*(.rodata) /* problems without this, dunno why */
|
|
||||||
*(.rodata*)
|
*(.rodata*)
|
||||||
*(.rodata.str1.1)
|
|
||||||
*(.rodata.str1.4)
|
|
||||||
. = ALIGN(0x4);
|
. = ALIGN(0x4);
|
||||||
} > DRAM
|
} > DRAM
|
||||||
|
|
||||||
|
@ -152,7 +146,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
codecbuf = .;
|
codecbuf = .;
|
||||||
_codecbuf = .;
|
_codecbuf = .;
|
||||||
#ifdef LOWMEM
|
#ifdef AMS_LOWMEM
|
||||||
} > CODEC_IRAM
|
} > CODEC_IRAM
|
||||||
#else
|
#else
|
||||||
} > DRAM
|
} > DRAM
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "cpu.h"
|
||||||
|
|
||||||
ENTRY(start)
|
ENTRY(start)
|
||||||
OUTPUT_FORMAT(elf32-littlearm)
|
OUTPUT_FORMAT(elf32-littlearm)
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
STARTUP(target/arm/crt0.o)
|
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 DRAMORIG 0x30000000
|
||||||
#define IRAMORIG 0
|
*/
|
||||||
|
#define IRAMORIG 0x81000000
|
||||||
#define IRAMSIZE 0x50000
|
#define IRAMSIZE 0x50000
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
/*DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE*/
|
||||||
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue