rockbox/firmware/target/coldfire/iaudio/boot.lds
Jens Arnold 91ce4b2a60 Optional dual-boot support in iAudio X5 and M5 bootloader, based on FS#5289.
In order to enable it, #define HAVE_DUALBOOT when building the bootloader.
Do not use the automatically created x5_fw.bin or m5_fw.bin, but use mkboot
to create a new firmware file from an OF x5_fw.bin resp. m5_fw.bin and
bootloader.bin.

The dual-boot bootloader boots the OF when pressing Play (main or remote) for
more than 3 seconds. Hold it a bit longer because the OF also checks buttons.
Short press boots rockbox.

As a bonus, the Play button read (for hold check) is done a bit earlier for
single-boot mode as well.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30018 a1c6a512-1295-4272-9138-f99709370657
2011-06-19 17:23:18 +00:00

91 lines
1.8 KiB
Text

#include "config.h"
ENTRY(start)
OUTPUT_FORMAT(elf32-m68k)
STARTUP(target/coldfire/crt0.o)
#define DRAMSIZE (MEMORYSIZE * 0x100000)
#if defined(IAUDIO_X5) || defined(IAUDIO_M5)
#define IRAMORIG 0x10000000
#define IRAMSIZE 0x20000
#elif defined(IAUDIO_M3)
#define IRAMORIG 0x10000000
#define IRAMSIZE 0x18000
#endif
#define DRAMORIG 0x31000000
#ifdef HAVE_DUALBOOT
#define FLASHORIG 0x00150000
#else
#define FLASHORIG 0x00010000
#endif
#define FLASHSIZE 4M - FLASHORIG
MEMORY
{
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
}
SECTIONS
{
.vectors :
{
*(.init.text)
_datacopy = .;
} > FLASH
.data : AT ( _datacopy )
{
_datastart = .;
KEEP(*(.resetvectors));
*(.resetvectors);
KEEP(*(.vectors));
*(.vectors);
. = ALIGN(0x200);
*(.icode)
*(.irodata)
*(.idata)
*(.data*)
. = ALIGN(0x4);
_dataend = .;
. = ALIGN(0x10); /* Maintain proper alignment for .text section */
} > IRAM
/* TRICK ALERT! Newer versions of the linker don't allow output sections
to overlap even if one of them is empty, so advance the location pointer
"by hand" */
.text LOADADDR(.data) + SIZEOF(.data) :
{
*(.init.text)
*(.text*)
. = ALIGN(0x4);
} > FLASH
.rodata :
{
*(.rodata*)
. = ALIGN(0x4);
_iramcopy = .;
} > FLASH
.stack :
{
*(.stack)
_stackbegin = .;
stackbegin = .;
. += 0x2000;
_stackend = .;
stackend = .;
} > IRAM
.bss DRAMORIG+0x800000 (NOLOAD) :
{
_edata = .;
*(.ibss)
*(.bss*)
*(COMMON)
_end = .;
} > DRAM
}