mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
bootloader: Share definition of show_logo via common.h
For some reason it was locally defined everywhere. Move a single definition into common.h instead. Change-Id: Ie2fad74acccd89e40fcbb0f47258d2e14e0f8285
This commit is contained in:
parent
5af0a50031
commit
7f0bc4bd95
10 changed files with 25 additions and 44 deletions
|
|
@ -39,3 +39,4 @@ int load_raw_firmware(unsigned char* buf, char* firmware, int buffer_size);
|
||||||
#ifdef ROCKBOX_HAS_LOGF
|
#ifdef ROCKBOX_HAS_LOGF
|
||||||
void display_logf(void);
|
void display_logf(void);
|
||||||
#endif
|
#endif
|
||||||
|
void show_logo(void);
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,6 @@
|
||||||
|
|
||||||
static bool is_usb_connected = false;
|
static bool is_usb_connected = false;
|
||||||
|
|
||||||
extern void show_logo(void);
|
|
||||||
|
|
||||||
static void demo_rtc(void)
|
static void demo_rtc(void)
|
||||||
{
|
{
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,6 @@
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
/* Show the Rockbox logo - in show_logo.c */
|
|
||||||
extern void show_logo(void);
|
|
||||||
|
|
||||||
#define TAR_CHUNK 512
|
#define TAR_CHUNK 512
|
||||||
#define TAR_HEADER_SIZE 157
|
#define TAR_HEADER_SIZE 157
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@
|
||||||
#include "../kernel-internal.h"
|
#include "../kernel-internal.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
/* Show the Rockbox logo - in show_logo.c */
|
|
||||||
extern void show_logo(void);
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* Initialize Rockbox kernel */
|
/* Initialize Rockbox kernel */
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
*
|
*
|
||||||
* Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
|
* Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
|
||||||
* and the ipodlinux bootloader by Daniel Palffy and Bernard Leach
|
* and the ipodlinux bootloader by Daniel Palffy and Bernard Leach
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation; either version 2
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
|
@ -60,9 +60,6 @@
|
||||||
void lcd_reset(void);
|
void lcd_reset(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Show the Rockbox logo - in show_logo.c */
|
|
||||||
extern void show_logo(void);
|
|
||||||
|
|
||||||
/* Button definitions */
|
/* Button definitions */
|
||||||
#if CONFIG_KEYPAD == IRIVER_H10_PAD
|
#if CONFIG_KEYPAD == IRIVER_H10_PAD
|
||||||
#define BOOTLOADER_BOOT_OF BUTTON_LEFT
|
#define BOOTLOADER_BOOT_OF BUTTON_LEFT
|
||||||
|
|
@ -132,21 +129,21 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
|
||||||
struct mi4header_t mi4header;
|
struct mi4header_t mi4header;
|
||||||
struct ppmi_header_t ppmi_header;
|
struct ppmi_header_t ppmi_header;
|
||||||
unsigned long sum;
|
unsigned long sum;
|
||||||
|
|
||||||
/* Read header to find out how long the mi4 file is. */
|
/* Read header to find out how long the mi4 file is. */
|
||||||
storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET,
|
storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET,
|
||||||
PPMI_SECTORS, &ppmi_header);
|
PPMI_SECTORS, &ppmi_header);
|
||||||
|
|
||||||
/* The first four characters at 0x80000 (sector 1024) should be PPMI*/
|
/* The first four characters at 0x80000 (sector 1024) should be PPMI*/
|
||||||
if( memcmp(ppmi_header.magic, "PPMI", 4) )
|
if( memcmp(ppmi_header.magic, "PPMI", 4) )
|
||||||
return EFILE_NOT_FOUND;
|
return EFILE_NOT_FOUND;
|
||||||
|
|
||||||
printf("BL mi4 size: %x", ppmi_header.length);
|
printf("BL mi4 size: %x", ppmi_header.length);
|
||||||
|
|
||||||
/* Read mi4 header of the OF */
|
/* Read mi4 header of the OF */
|
||||||
storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
|
storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
|
||||||
+ (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header);
|
+ (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header);
|
||||||
|
|
||||||
/* We don't support encrypted mi4 files yet */
|
/* We don't support encrypted mi4 files yet */
|
||||||
if( (mi4header.plaintext) != (mi4header.mi4size-MI4_HEADER_SIZE))
|
if( (mi4header.plaintext) != (mi4header.mi4size-MI4_HEADER_SIZE))
|
||||||
return EINVALID_FORMAT;
|
return EINVALID_FORMAT;
|
||||||
|
|
@ -178,14 +175,14 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
|
||||||
|
|
||||||
if(sum != mi4header.crc32)
|
if(sum != mi4header.crc32)
|
||||||
return EBAD_CHKSUM;
|
return EBAD_CHKSUM;
|
||||||
|
|
||||||
#ifdef SANSA_E200
|
#ifdef SANSA_E200
|
||||||
if (disable_rebuild)
|
if (disable_rebuild)
|
||||||
{
|
{
|
||||||
char block[512];
|
char block[512];
|
||||||
|
|
||||||
printf("Disabling database rebuild");
|
printf("Disabling database rebuild");
|
||||||
|
|
||||||
storage_read_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block);
|
storage_read_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block);
|
||||||
block[0xe1] = 0;
|
block[0xe1] = 0;
|
||||||
storage_write_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block);
|
storage_write_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block);
|
||||||
|
|
@ -206,7 +203,7 @@ static int handle_usb(int connect_timeout)
|
||||||
struct queue_event ev;
|
struct queue_event ev;
|
||||||
int usb = USB_EXTRACTED;
|
int usb = USB_EXTRACTED;
|
||||||
long end_tick = 0;
|
long end_tick = 0;
|
||||||
|
|
||||||
if (!usb_plugged())
|
if (!usb_plugged())
|
||||||
return USB_EXTRACTED;
|
return USB_EXTRACTED;
|
||||||
|
|
||||||
|
|
@ -394,7 +391,7 @@ void* main(void)
|
||||||
error(EDISK,num_partitions, true);
|
error(EDISK,num_partitions, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Just list the first 2 partitions since we don't have any devices yet
|
/* Just list the first 2 partitions since we don't have any devices yet
|
||||||
that have more than that */
|
that have more than that */
|
||||||
for(i=0; i<NUM_PARTITIONS; i++)
|
for(i=0; i<NUM_PARTITIONS; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -496,7 +493,7 @@ void* main(void)
|
||||||
#endif
|
#endif
|
||||||
goto main_exit;
|
goto main_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
error(0, 0, true);
|
error(0, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@
|
||||||
#include "adc.h"
|
#include "adc.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
extern void show_logo(void);
|
|
||||||
extern void power_off(void);
|
extern void power_off(void);
|
||||||
|
|
||||||
static void show_splash(int timeout, const char *msg)
|
static void show_splash(int timeout, const char *msg)
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@
|
||||||
*/
|
*/
|
||||||
#define LOAD_SIZE 0x700000
|
#define LOAD_SIZE 0x700000
|
||||||
|
|
||||||
extern void show_logo( void );
|
|
||||||
|
|
||||||
/* This function setup bare minimum
|
/* This function setup bare minimum
|
||||||
* and jumps to rom in order to activate
|
* and jumps to rom in order to activate
|
||||||
* hardcoded rkusb mode
|
* hardcoded rkusb mode
|
||||||
|
|
@ -153,9 +151,9 @@ void main(void)
|
||||||
error(EDISK, ret, true);
|
error(EDISK, ret, true);
|
||||||
|
|
||||||
loadbuffer = (unsigned char*)DRAM_ORIG; /* DRAM */
|
loadbuffer = (unsigned char*)DRAM_ORIG; /* DRAM */
|
||||||
|
|
||||||
if (boot == rb)
|
if (boot == rb)
|
||||||
snprintf(filename,sizeof(filename), BOOTDIR "/%s", BOOTFILE);
|
snprintf(filename,sizeof(filename), BOOTDIR "/%s", BOOTFILE);
|
||||||
else if (boot == of)
|
else if (boot == of)
|
||||||
snprintf(filename,sizeof(filename), BOOTDIR "/%s", "BASE.RKW");
|
snprintf(filename,sizeof(filename), BOOTDIR "/%s", "BASE.RKW");
|
||||||
|
|
||||||
|
|
@ -170,7 +168,7 @@ void main(void)
|
||||||
|
|
||||||
/* if we boot rockbox we shutdown on error
|
/* if we boot rockbox we shutdown on error
|
||||||
* if we boot OF we fall back to rkusb mode on error
|
* if we boot OF we fall back to rkusb mode on error
|
||||||
*/
|
*/
|
||||||
if (boot == rb)
|
if (boot == rb)
|
||||||
{
|
{
|
||||||
power_off();
|
power_off();
|
||||||
|
|
@ -213,7 +211,7 @@ void main(void)
|
||||||
lcd_update();
|
lcd_update();
|
||||||
|
|
||||||
enter_rkusb();
|
enter_rkusb();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hang */
|
/* hang */
|
||||||
while(1);
|
while(1);
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,6 @@ static void handle_usb(int connect_timeout)
|
||||||
usb_close();
|
usb_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void show_logo(void);
|
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
unsigned char* loadbuffer;
|
unsigned char* loadbuffer;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
* Copyright (C) 2007 by Dave Chapman
|
* Copyright (C) 2007 by Dave Chapman
|
||||||
*
|
*
|
||||||
* Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
|
* Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation; either version 2
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
|
@ -46,9 +46,6 @@
|
||||||
#include "loader_strerror.h"
|
#include "loader_strerror.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
/* Show the Rockbox logo - in show_logo.c */
|
|
||||||
extern void show_logo(void);
|
|
||||||
|
|
||||||
/* Address to load main Rockbox image to */
|
/* Address to load main Rockbox image to */
|
||||||
#define LOAD_ADDRESS 0x20000000 /* DRAM_START */
|
#define LOAD_ADDRESS 0x20000000 /* DRAM_START */
|
||||||
|
|
||||||
|
|
@ -63,12 +60,12 @@ void show_debug_screen(void)
|
||||||
int power_count = 0;
|
int power_count = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
bool do_power_off = false;
|
bool do_power_off = false;
|
||||||
|
|
||||||
lcd_puts_scroll(0,0,"+++ this is a very very long line to test scrolling. ---");
|
lcd_puts_scroll(0,0,"+++ this is a very very long line to test scrolling. ---");
|
||||||
while (!do_power_off) {
|
while (!do_power_off) {
|
||||||
line = 1;
|
line = 1;
|
||||||
button = button_get(false);
|
button = button_get(false);
|
||||||
|
|
||||||
/* Power-off if POWER button has been held for a time
|
/* Power-off if POWER button has been held for a time
|
||||||
This loop is currently running at about 100 iterations/second
|
This loop is currently running at about 100 iterations/second
|
||||||
*/
|
*/
|
||||||
|
|
@ -131,10 +128,10 @@ void* main(void)
|
||||||
|
|
||||||
system_init();
|
system_init();
|
||||||
power_init();
|
power_init();
|
||||||
|
|
||||||
kernel_init();
|
kernel_init();
|
||||||
enable_irq();
|
enable_irq();
|
||||||
|
|
||||||
lcd_init();
|
lcd_init();
|
||||||
|
|
||||||
adc_init();
|
adc_init();
|
||||||
|
|
@ -143,7 +140,7 @@ void* main(void)
|
||||||
|
|
||||||
font_init();
|
font_init();
|
||||||
lcd_setfont(FONT_SYSFIXED);
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
show_logo();
|
show_logo();
|
||||||
|
|
||||||
backlight_hw_on();
|
backlight_hw_on();
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@
|
||||||
|
|
||||||
#define SHOW_LOGO
|
#define SHOW_LOGO
|
||||||
|
|
||||||
extern void show_logo(void);
|
|
||||||
extern void power_off(void);
|
extern void power_off(void);
|
||||||
|
|
||||||
static int lcd_inited = 0;
|
static int lcd_inited = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue