Index: bootloader/main-pp.c =================================================================== --- bootloader/main-pp.c (revision 17294) +++ bootloader/main-pp.c (working copy) @@ -43,7 +43,6 @@ #include "usb_drv.h" #endif - /* Button definitions */ #if CONFIG_KEYPAD == IRIVER_H10_PAD #define BOOTLOADER_BOOT_OF BUTTON_LEFT @@ -442,7 +441,17 @@ system_init(); kernel_init(); + lcd_init(); +#if LCD_DEPTH > 1 + lcd_set_foreground(LCD_WHITE); + lcd_set_background(LCD_BLACK); +#endif + lcd_clear_display(); +#ifdef HAVE_BOOTLOADER_LOGO + show_logo(); +#endif + font_init(); button_init(); #if defined(SANSA_E200) @@ -450,15 +459,13 @@ _backlight_on(); #endif -#if LCD_DEPTH > 1 - lcd_set_foreground(LCD_WHITE); - lcd_set_background(LCD_BLACK); -#endif - lcd_clear_display(); if (button_hold()) { verbose = true; +#ifdef HAVE_BOOTLOADER_LOGO + lcd_clear_display(); +#endif printf("Hold switch on"); printf("Shutting down..."); sleep(HZ); @@ -468,8 +475,12 @@ btn = button_read_device(); /* Enable bootloader messages if any button is pressed */ - if (btn) + if (btn) { +#ifdef HAVE_BOOTLOADER_LOGO + lcd_clear_display(); +#endif verbose = true; + } #if defined(SANSA_E200) || defined(SANSA_C200) #if !defined(USE_ROCKBOX_USB) Index: bootloader/common.c =================================================================== --- bootloader/common.c (revision 17294) +++ bootloader/common.c (working copy) @@ -23,11 +23,33 @@ #include #include #include +#include #include "cpu.h" #include "common.h" #include "power.h" #include "kernel.h" +#ifdef HAVE_BOOTLOADER_LOGO +#include "rockboxlogo.h" + +int show_logo( void ) +{ + char boot_version[32]; + + snprintf(boot_version, sizeof(boot_version), "Boot Ver. %s", APPSVERSION); + + lcd_clear_display(); + lcd_bitmap(rockboxlogo, 0, 10, BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo); + lcd_setfont(FONT_SYSFIXED); + lcd_putsxy((LCD_WIDTH/2) - ((strlen(boot_version)*SYSFONT_WIDTH)/2), + LCD_HEIGHT-SYSFONT_HEIGHT, (unsigned char *)boot_version); + + lcd_update(); + + return 0; +} +#endif + /* TODO: Other bootloaders need to be adjusted to set this variable to true on a button press - currently only the ipod, H10 and Sansa versions do. */ #if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \ Index: bootloader/Makefile =================================================================== --- bootloader/Makefile (revision 17294) +++ bootloader/Makefile (working copy) @@ -8,11 +8,31 @@ # INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \ - -I$(BUILDDIR) + -I$(BUILDDIR) -I$(BUILDDIR)/bitmaps DEPFILE = $(OBJDIR)/dep-bootloader LDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/boot.lds +# Set up the bitmap libraries +BITMAPLIBS = +LINKBITMAPS = +ifneq ($(strip $(BMP2RB_MONO)),) + BITMAPLIBS += $(BUILDDIR)/libbitmapsmono.a + LINKBITMAPS += -lbitmapsmono +endif +ifneq ($(strip $(BMP2RB_NATIVE)),) + BITMAPLIBS += $(BUILDDIR)/libbitmapsnative.a + LINKBITMAPS += -lbitmapsnative +endif +ifneq ($(strip $(BMP2RB_REMOTEMONO)),) + BITMAPLIBS += $(BUILDDIR)/libbitmapsremotemono.a + LINKBITMAPS += -lbitmapsremotemono +endif +ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) + BITMAPLIBS += $(BUILDDIR)/libbitmapsremotenative.a + LINKBITMAPS += -lbitmapsremotenative +endif + ifdef DEBUG DEFINES := -DDEBUG CFLAGS += -g @@ -47,6 +67,8 @@ all: $(BUILDDIR)/$(BINARY) $(FLASHFILE) endif +$(DEPFILE): $(BITMAPLIBS) + dep: $(DEPFILE) $(LINKFILE): $(LDS) @@ -58,9 +80,23 @@ $(SILENT)cat $(MAXINFILE) | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - > $(MAXOUTFILE) $(SILENT)rm $(MAXINFILE) -$(OBJDIR)/bootloader.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX) - $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Wl,--gc-sections -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/bootloader.map +build-bitmapsmono: + $(call PRINTS,MAKE in bitmaps/mono)$(MAKE) -C ../apps/bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono + +build-bitmapsnative: + $(call PRINTS,MAKE in bitmaps/native)$(MAKE) -C ../apps/bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native +build-bitmapsremotemono: + $(call PRINTS,MAKE in bitmaps/remote_mono)$(MAKE) -C ../apps/bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono + +build-bitmapsremotenative: + $(call PRINTS,MAKE in bitmaps/remote_native)$(MAKE) -C ../apps/bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native + +$(BITMAPLIBS): $(BUILDDIR)/lib%.a: build-% + +$(OBJDIR)/bootloader.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX) $(BITMAPLIBS) + $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Wl,--gc-sections -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox $(LINKBITMAPS) -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/bootloader.map + $(OBJDIR)/bootloader.bin : $(OBJDIR)/bootloader.elf $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ @@ -76,5 +112,9 @@ $(call PRINTS,cleaning bootloader)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/bootloader.asm \ $(OBJDIR)/bootloader.bin $(OBJDIR)/bootloader.elf $(OBJDIR)/*.map \ $(LINKFILE) $(MAXOUTFILE) $(DEPFILE) + $(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono + $(SILENT)$(MAKE) -C bitmaps/native clean OBJDIR=$(OBJDIR)/bitmaps/native + $(SILENT)$(MAKE) -C bitmaps/remote_mono clean OBJDIR=$(OBJDIR)/bitmaps/remote_mono + $(SILENT)$(MAKE) -C bitmaps/remote_native clean OBJDIR=$(OBJDIR)/bitmaps/remote_native -include $(DEPFILE) Index: bootloader/common.h =================================================================== --- bootloader/common.h (revision 17294) +++ bootloader/common.h (working copy) @@ -16,7 +16,7 @@ * KIND, either express or implied. * ****************************************************************************/ - +#include "config.h" #include /* Error codes */ @@ -44,3 +44,7 @@ void error(int errortype, int error); int load_firmware(unsigned char* buf, char* firmware, int buffer_size); int load_raw_firmware(unsigned char* buf, char* firmware, int buffer_size); + +#ifdef HAVE_BOOTLOADER_LOGO +int show_logo(void); +#endif Index: apps/bitmaps/remote_native/SOURCES =================================================================== --- apps/bitmaps/remote_native/SOURCES (revision 17294) +++ apps/bitmaps/remote_native/SOURCES (working copy) @@ -1,5 +1,7 @@ #ifdef HAVE_REMOTE_LCD +#ifndef BOOTLOADER /* We don't need these for the bootloader */ + #if (LCD_REMOTE_DEPTH == 1) remote_rockboxlogo.128x42x1.bmp remote_usblogo.104x27x1.bmp @@ -10,4 +12,6 @@ remote_default_icons.6x8x2.bmp #endif +#endif /* BOOTLOADER */ + #endif /* HAVE_REMOTE_LCD */ Index: apps/bitmaps/native/SOURCES =================================================================== --- apps/bitmaps/native/SOURCES (revision 17297) +++ apps/bitmaps/native/SOURCES (working copy) @@ -31,6 +31,8 @@ rockboxlogo.320x98x16.bmp #endif +#ifndef BOOTLOADER /* We don't need these for the bootloader */ + /* USB logo */ #ifdef HAVE_LCD_COLOR #if LCD_WIDTH > 176 @@ -61,4 +63,6 @@ default_icons.6x8x1.bmp #endif +#endif /* BOOTLOADER */ + #endif /* HAVE_LCD_BITMAP */ Index: firmware/export/config-e200.h =================================================================== --- firmware/export/config-e200.h (revision 17294) +++ firmware/export/config-e200.h (working copy) @@ -47,6 +47,9 @@ #define LCD_DEPTH 16 /* 65536 colours */ #define LCD_PIXELFORMAT RGB565 /* rgb565 */ +/* Define this for a bootloader logo */ +#define HAVE_BOOTLOADER_LOGO + /* define this if you have LCD enable function */ #define HAVE_LCD_ENABLE Index: firmware/target/arm/sandisk/boot.lds =================================================================== --- firmware/target/arm/sandisk/boot.lds (revision 17294) +++ firmware/target/arm/sandisk/boot.lds (working copy) @@ -15,6 +15,11 @@ #define FLASHORIG 0x001f0000 #define FLASHSIZE 2M +MEMORY +{ + DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE + IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE +} SECTIONS { @@ -23,7 +28,9 @@ .text : { *(.init.text) *(.text*) - } + *(.glue_7) + *(.glue_7t) + } > IRAM .data : { *(.icode) @@ -31,8 +38,9 @@ *(.idata) *(.data*) *(.ncdata*) + *(.rodata*) _dataend = . ; - } + } > IRAM .stack : { @@ -42,7 +50,7 @@ . += 0x2000; _stackend = .; stackend = .; - } + } > IRAM /* The bss section is too large for IRAM - we just move it 16MB into the DRAM */ @@ -54,5 +62,5 @@ *(.ibss); *(.ncbss*); _end = .; - } + } > DRAM }