2011-01-02 23:16:27 +00:00
|
|
|
#define ASM
|
|
|
|
#include "config.h"
|
2016-02-05 01:02:02 +00:00
|
|
|
#include "cpu.h"
|
2011-01-02 23:16:27 +00:00
|
|
|
|
|
|
|
ENTRY(start)
|
|
|
|
#ifdef ROCKBOX_LITTLE_ENDIAN
|
|
|
|
OUTPUT_FORMAT(elf32-littlearm)
|
|
|
|
#else
|
|
|
|
OUTPUT_FORMAT(elf32-bigarm)
|
|
|
|
#endif
|
|
|
|
OUTPUT_ARCH(arm)
|
|
|
|
STARTUP(target/arm/s5l8702/crt0.o)
|
|
|
|
|
2016-02-05 01:02:02 +00:00
|
|
|
#define MAX_LOADSIZE 8M /* reserved for loading Rockbox binary */
|
|
|
|
|
2011-01-02 23:16:27 +00:00
|
|
|
#ifdef IPOD_NANO2G
|
|
|
|
#define DRAMORIG 0x08000000 + ((MEMORYSIZE - 1) * 0x100000)
|
|
|
|
#define DRAMSIZE 0x00100000
|
|
|
|
|
|
|
|
#define IRAMORIG 0x22000000
|
|
|
|
#define IRAMSIZE 256K
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
|
|
|
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
|
|
|
}
|
|
|
|
#define LOAD_AREA IRAM
|
2016-02-05 01:02:02 +00:00
|
|
|
#define VECT_AREA IRAM
|
|
|
|
#define BSS_AREA DRAM
|
|
|
|
|
|
|
|
#elif defined(IPOD_6G)
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
DRAM : ORIGIN = DRAM_ORIG, LENGTH = DRAM_SIZE
|
|
|
|
IRAM : ORIGIN = IRAM_ORIG, LENGTH = IRAM_SIZE
|
|
|
|
|
|
|
|
/* s5l8702 maps address 0 to ROM, IRAM or DRAM */
|
|
|
|
VECT_AREA : ORIGIN = 0, LENGTH = 1K
|
|
|
|
|
|
|
|
/* IRAM region where loaded IM3 body will be moved and executed,
|
|
|
|
preserving the loaded IM3 header (0x800 bytes) at IRAM1_ORIG */
|
|
|
|
MOVE_AREA : ORIGIN = IRAM1_ORIG + 0x800,
|
|
|
|
LENGTH = IRAM1_SIZE - 0x800
|
|
|
|
|
|
|
|
/* DRAM region for BSS */
|
|
|
|
BSS_AREA : ORIGIN = DRAM_ORIG + MAX_LOADSIZE,
|
|
|
|
LENGTH = DRAM_SIZE - MAX_LOADSIZE - TTB_SIZE
|
|
|
|
}
|
|
|
|
#define LOAD_AREA MOVE_AREA
|
|
|
|
|
|
|
|
#else
|
|
|
|
#error No target defined!
|
|
|
|
#endif
|
|
|
|
|
2011-01-02 23:16:27 +00:00
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
2016-02-05 01:02:02 +00:00
|
|
|
_dfuloadaddr = IRAM0_ORIG ;
|
|
|
|
_movestart = LOADADDR(.text) ;
|
|
|
|
_moveend = LOADADDR(.data) + SIZEOF(.data) ;
|
|
|
|
|
2011-01-02 23:16:27 +00:00
|
|
|
#ifdef NEEDS_INTVECT_COPYING
|
|
|
|
.intvect : {
|
|
|
|
_intvectstart = . ;
|
|
|
|
*(.intvect)
|
2016-02-05 01:02:02 +00:00
|
|
|
_intvectend = _newstart ;
|
|
|
|
} >VECT_AREA AT> LOAD_AREA
|
2011-01-02 23:16:27 +00:00
|
|
|
_intvectcopy = LOADADDR(.intvect) ;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
.text : {
|
|
|
|
#ifndef NEEDS_INTVECT_COPYING
|
|
|
|
*(.intvect)
|
|
|
|
#endif
|
|
|
|
*(.init.text)
|
|
|
|
*(.text*)
|
|
|
|
*(.glue_7*)
|
|
|
|
} > LOAD_AREA
|
|
|
|
|
|
|
|
.rodata : {
|
|
|
|
*(.rodata*)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > LOAD_AREA
|
|
|
|
|
|
|
|
.data : {
|
|
|
|
_datastart = . ;
|
2011-12-17 02:00:59 +00:00
|
|
|
*(.irodata*)
|
|
|
|
*(.icode*)
|
|
|
|
*(.idata*)
|
2011-01-02 23:16:27 +00:00
|
|
|
*(.data*)
|
|
|
|
*(.ncdata*);
|
2016-02-05 01:02:02 +00:00
|
|
|
. = ALIGN(0x20); /* align move size */
|
2011-01-02 23:16:27 +00:00
|
|
|
_dataend = . ;
|
2016-02-05 01:02:02 +00:00
|
|
|
} > LOAD_AREA
|
2011-01-02 23:16:27 +00:00
|
|
|
|
|
|
|
.stack (NOLOAD) :
|
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
_stackbegin = .;
|
|
|
|
stackbegin = .;
|
|
|
|
. += 0x2000;
|
|
|
|
_stackend = .;
|
|
|
|
stackend = .;
|
|
|
|
_irqstackbegin = .;
|
|
|
|
. += 0x400;
|
|
|
|
_irqstackend = .;
|
|
|
|
_fiqstackbegin = .;
|
|
|
|
. += 0x400;
|
|
|
|
_fiqstackend = .;
|
2016-02-05 01:02:02 +00:00
|
|
|
} > LOAD_AREA
|
2011-01-02 23:16:27 +00:00
|
|
|
|
|
|
|
.bss (NOLOAD) : {
|
|
|
|
_edata = .;
|
|
|
|
*(.bss*);
|
2011-12-17 02:00:59 +00:00
|
|
|
*(.ibss*);
|
2011-01-02 23:16:27 +00:00
|
|
|
*(.ncbss*);
|
|
|
|
*(COMMON);
|
2016-02-05 01:02:02 +00:00
|
|
|
. = ALIGN(0x20); /* align bzero size */
|
2011-01-02 23:16:27 +00:00
|
|
|
_end = .;
|
2016-02-05 01:02:02 +00:00
|
|
|
} > BSS_AREA
|
2011-01-02 23:16:27 +00:00
|
|
|
}
|