From b1af4e6cc8f5b0657348d206224f03ab5e44f1e9 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Mon, 8 Jan 2007 18:21:12 +0000 Subject: [PATCH] Enable ROM file generation for H120/H140. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11947 a1c6a512-1295-4272-9138-f99709370657 --- apps/Makefile | 3 ++ firmware/rom.lds | 70 +++++++++++++++++++++++++++++++++++------------ tools/buildzip.pl | 10 +++++++ tools/configure | 3 +- 4 files changed, 68 insertions(+), 18 deletions(-) diff --git a/apps/Makefile b/apps/Makefile index 00612fa499..c63fa825c9 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -190,6 +190,9 @@ $(BUILDDIR)/rombox.ucl: $(OBJDIR)/rombox.bin $(MAXOUTFILE) echo "fake" > $@; \ fi +$(BUILDDIR)/rombox.iriver: $(OBJDIR)/rombox.bin + $(call PRINTS,Build ROM file)$(MKFIRMWARE) $< $@ + include $(TOOLSDIR)/make.inc $(OBJDIR)/lang.o: lang/$(LANGUAGE).lang diff --git a/firmware/rom.lds b/firmware/rom.lds index 29e72d70c0..0967c6b88a 100644 --- a/firmware/rom.lds +++ b/firmware/rom.lds @@ -1,38 +1,39 @@ #include "config.h" ENTRY(start) + #ifdef CPU_COLDFIRE OUTPUT_FORMAT(elf32-m68k) -#else -OUTPUT_FORMAT(elf32-sh) -#endif -#ifdef CPU_COLDFIRE INPUT(target/coldfire/crt0.o) #elif defined(CPU_PP) +OUTPUT_FORMAT(elf32-littlearm) INPUT(target/arm/crt0-pp.o) #elif defined(CPU_ARM) +OUTPUT_FORMAT(elf32-littlearm) INPUT(target/arm/crt0.o) #elif CONFIG_CPU == SH7034 +OUTPUT_FORMAT(elf32-sh) INPUT(target/sh/crt0.o) #else +OUTPUT_FORMAT(elf32-sh) INPUT(crt0.o) #endif #if MEMORYSIZE >= 32 -#define PLUGINSIZE 0xC0000 +#define PLUGINSIZE PLUGIN_BUFFER_SIZE #else #define PLUGINSIZE 0x8000 #endif -#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE -#ifdef IRIVER_H100 +#ifdef IRIVER_H100_SERIES +#define CODECSIZE CODEC_SIZE #define DRAMORIG 0x31000000 #define IRAMORIG 0x10000000 -#define IRAMSIZE 0x18000 -#define FLASHORIG 0x001f0000 -#define FLASHSIZE 2M +#define IRAMSIZE 0xc000 +#define FLASHORIG 0x00100028 +#define FLASHSIZE 0x000eff80 #else #define DRAMORIG 0x09000000 #define IRAMORIG 0x0f000000 @@ -41,7 +42,18 @@ INPUT(crt0.o) #define FLASHSIZE 256K - ROM_START #endif -#define ENDADDR (DRAMORIG + DRAMSIZE) +#ifdef CODECSIZE +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE +/* Where the codec buffer ends, and the plugin buffer starts */ +#define ENDADDR (ENDAUDIOADDR + CODECSIZE) +#else +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE +/* Where the audio buffer ends, and the plugin buffer starts */ +#define ENDADDR ENDAUDIOADDR +#endif + +/* End of the audio buffer, where the codec/plugin buffer starts */ +#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) MEMORY { @@ -74,10 +86,15 @@ SECTIONS . = ALIGN(0x200); *(.data) . = ALIGN(0x4); - _dataend = .; + _dataend = .; . = ALIGN(0x10); /* Maintain proper alignment for .text section */ } > DRAM + /DISCARD/ : + { + *(.eh_frame) + } + /* 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" */ @@ -105,7 +122,7 @@ SECTIONS *(.idata) _iramend = .; } > IRAM - + .ibss (NOLOAD) : { _iedata = .; @@ -122,29 +139,48 @@ SECTIONS . += 0x2000; _stackend = .; stackend = .; - } > DRAM + } > IRAM +#ifdef CPU_COLDFIRE + .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram): +#else .bss : +#endif { _edata = .; - *(.bss) + *(.bss*) *(COMMON) + . = ALIGN(0x4); _end = .; } > DRAM - .audiobuf : + .audiobuf ALIGN(4): { - . = ALIGN(0x4); _audiobuffer = .; + audiobuffer = .; } > DRAM +#ifdef CODECSIZE + .audiobufend ENDAUDIOADDR: +#else .audiobufend ENDADDR: +#endif { _audiobufend = .; + audiobufend = .; } > DRAM +#ifdef CODECSIZE + .codec ENDAUDIOADDR: + { + codecbuf = .; + _codecbuf = .; + } +#endif + .plugin ENDADDR: { _pluginbuf = .; + pluginbuf = .; } } diff --git a/tools/buildzip.pl b/tools/buildzip.pl index a30eb28e67..3eb974c10d 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl @@ -216,6 +216,16 @@ sub buildzip { if( filesize("rombox.ucl") > 1000) { `cp rombox.ucl .rockbox/`; # UCL for flashing } + + # Check for rombox.target + if ($image=~/(.*)\.(\w+)$/) + { + my $romfile = "rombox.$2"; + if (filesize($romfile) > 1000) + { + `cp $romfile .rockbox/`; + } + } } mkdir ".rockbox/docs", 0777; diff --git a/tools/configure b/tools/configure index 53be8eee91..1cfc4cc104 100755 --- a/tools/configure +++ b/tools/configure @@ -767,7 +767,7 @@ EOF output="rockbox.iriver" appextra="recorder:gui" archosrom="" - flash="" + flash="$pwd/rombox.iriver" plugins="yes" codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a" # toolset is the tools within the tools directory that we build for @@ -1244,6 +1244,7 @@ fi extradefines="-DBOOTLOADER" # for target makefile symbol EXTRA_DEFINES appsdir='\$(ROOTDIR)/bootloader' apps="bootloader" + flash="" if test -n "$boottool"; then tool="$boottool" fi