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:
Solomon Peachy 2026-01-24 07:54:24 -05:00
parent 5af0a50031
commit 7f0bc4bd95
10 changed files with 25 additions and 44 deletions

View file

@ -39,3 +39,4 @@ int load_raw_firmware(unsigned char* buf, char* firmware, int buffer_size);
#ifdef ROCKBOX_HAS_LOGF
void display_logf(void);
#endif
void show_logo(void);

View file

@ -33,8 +33,6 @@
static bool is_usb_connected = false;
extern void show_logo(void);
static void demo_rtc(void)
{
int y = 0;

View file

@ -43,9 +43,6 @@
#include "lcd.h"
#include "version.h"
/* Show the Rockbox logo - in show_logo.c */
extern void show_logo(void);
#define TAR_CHUNK 512
#define TAR_HEADER_SIZE 157

View file

@ -23,9 +23,6 @@
#include "../kernel-internal.h"
#include "system.h"
/* Show the Rockbox logo - in show_logo.c */
extern void show_logo(void);
int main(void)
{
/* Initialize Rockbox kernel */

View file

@ -11,7 +11,7 @@
*
* Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
* and the ipodlinux bootloader by Daniel Palffy and Bernard Leach
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@ -60,9 +60,6 @@
void lcd_reset(void);
#endif
/* Show the Rockbox logo - in show_logo.c */
extern void show_logo(void);
/* Button definitions */
#if CONFIG_KEYPAD == IRIVER_H10_PAD
#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 ppmi_header_t ppmi_header;
unsigned long sum;
/* Read header to find out how long the mi4 file is. */
storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET,
PPMI_SECTORS, &ppmi_header);
/* The first four characters at 0x80000 (sector 1024) should be PPMI*/
if( memcmp(ppmi_header.magic, "PPMI", 4) )
return EFILE_NOT_FOUND;
printf("BL mi4 size: %x", ppmi_header.length);
/* 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);
/* We don't support encrypted mi4 files yet */
if( (mi4header.plaintext) != (mi4header.mi4size-MI4_HEADER_SIZE))
return EINVALID_FORMAT;
@ -178,14 +175,14 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
if(sum != mi4header.crc32)
return EBAD_CHKSUM;
#ifdef SANSA_E200
#ifdef SANSA_E200
if (disable_rebuild)
{
char block[512];
printf("Disabling database rebuild");
storage_read_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block);
block[0xe1] = 0;
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;
int usb = USB_EXTRACTED;
long end_tick = 0;
if (!usb_plugged())
return USB_EXTRACTED;
@ -394,7 +391,7 @@ void* main(void)
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 */
for(i=0; i<NUM_PARTITIONS; i++)
{
@ -496,7 +493,7 @@ void* main(void)
#endif
goto main_exit;
}
error(0, 0, true);
}

View file

@ -39,7 +39,6 @@
#include "adc.h"
#include "version.h"
extern void show_logo(void);
extern void power_off(void);
static void show_splash(int timeout, const char *msg)

View file

@ -32,8 +32,6 @@
*/
#define LOAD_SIZE 0x700000
extern void show_logo( void );
/* This function setup bare minimum
* and jumps to rom in order to activate
* hardcoded rkusb mode
@ -153,9 +151,9 @@ void main(void)
error(EDISK, ret, true);
loadbuffer = (unsigned char*)DRAM_ORIG; /* DRAM */
if (boot == rb)
snprintf(filename,sizeof(filename), BOOTDIR "/%s", BOOTFILE);
snprintf(filename,sizeof(filename), BOOTDIR "/%s", BOOTFILE);
else if (boot == of)
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 OF we fall back to rkusb mode on error
*/
*/
if (boot == rb)
{
power_off();
@ -213,7 +211,7 @@ void main(void)
lcd_update();
enter_rkusb();
}
}
/* hang */
while(1);

View file

@ -215,8 +215,6 @@ static void handle_usb(int connect_timeout)
usb_close();
}
extern void show_logo(void);
void main(void)
{
unsigned char* loadbuffer;

View file

@ -10,7 +10,7 @@
* Copyright (C) 2007 by Dave Chapman
*
* Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@ -46,9 +46,6 @@
#include "loader_strerror.h"
#include "version.h"
/* Show the Rockbox logo - in show_logo.c */
extern void show_logo(void);
/* Address to load main Rockbox image to */
#define LOAD_ADDRESS 0x20000000 /* DRAM_START */
@ -63,12 +60,12 @@ void show_debug_screen(void)
int power_count = 0;
int count = 0;
bool do_power_off = false;
lcd_puts_scroll(0,0,"+++ this is a very very long line to test scrolling. ---");
while (!do_power_off) {
line = 1;
button = button_get(false);
/* Power-off if POWER button has been held for a time
This loop is currently running at about 100 iterations/second
*/
@ -131,10 +128,10 @@ void* main(void)
system_init();
power_init();
kernel_init();
enable_irq();
lcd_init();
adc_init();
@ -143,7 +140,7 @@ void* main(void)
font_init();
lcd_setfont(FONT_SYSFIXED);
show_logo();
backlight_hw_on();

View file

@ -45,7 +45,6 @@
#define SHOW_LOGO
extern void show_logo(void);
extern void power_off(void);
static int lcd_inited = 0;