mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 21:51:31 +00:00
arch/mips/lib/board.c: make (mostly) checkpatch clean
Fix all errors and all warnings except for "externs should be avoided" which could require more extensive changes. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
This commit is contained in:
parent
4b6f394fc4
commit
cc257e42f3
1 changed files with 60 additions and 64 deletions
|
@ -38,8 +38,6 @@
|
|||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#undef DEBUG
|
||||
|
||||
extern int timer_init(void);
|
||||
|
||||
extern int incaip_set_cpuclk(void);
|
||||
|
@ -64,8 +62,8 @@ int __board_early_init_f(void)
|
|||
*/
|
||||
return 0;
|
||||
}
|
||||
int board_early_init_f(void) __attribute__((weak, alias("__board_early_init_f")));
|
||||
|
||||
int board_early_init_f(void)
|
||||
__attribute__((weak, alias("__board_early_init_f")));
|
||||
|
||||
static int init_func_ram(void)
|
||||
{
|
||||
|
@ -76,19 +74,20 @@ static int init_func_ram (void)
|
|||
#endif
|
||||
puts("DRAM: ");
|
||||
|
||||
if ((gd->ram_size = initdram (board_type)) > 0) {
|
||||
gd->ram_size = initdram(board_type);
|
||||
if (gd->ram_size > 0) {
|
||||
print_size(gd->ram_size, "\n");
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
puts(failed);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int display_banner(void)
|
||||
{
|
||||
|
||||
printf("\n\n%s\n\n", version_string);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SYS_NO_FLASH
|
||||
|
@ -133,9 +132,9 @@ init_fnc_t *init_sequence[] = {
|
|||
timer_init,
|
||||
env_init, /* initialize environment */
|
||||
#ifdef CONFIG_INCA_IP
|
||||
incaip_set_cpuclk, /* set cpu clock according to environment variable */
|
||||
incaip_set_cpuclk, /* set cpu clock according to env. variable */
|
||||
#endif
|
||||
init_baudrate, /* initialze baudrate settings */
|
||||
init_baudrate, /* initialize baudrate settings */
|
||||
serial_init, /* serial communications setup */
|
||||
console_init_f,
|
||||
display_banner, /* say that we are here */
|
||||
|
@ -162,10 +161,9 @@ void board_init_f(ulong bootflag)
|
|||
memset((void *)gd, 0, sizeof(gd_t));
|
||||
|
||||
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
|
||||
if ((*init_fnc_ptr)() != 0) {
|
||||
if ((*init_fnc_ptr)() != 0)
|
||||
hang();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that we have DRAM mapped and working, we can
|
||||
|
@ -234,8 +232,8 @@ void board_init_f(ulong bootflag)
|
|||
/*
|
||||
* Save local variables to board info struct
|
||||
*/
|
||||
bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of DRAM memory */
|
||||
bd->bi_memsize = gd->ram_size; /* size of DRAM memory in bytes */
|
||||
bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of DRAM */
|
||||
bd->bi_memsize = gd->ram_size; /* size of DRAM in bytes */
|
||||
bd->bi_baudrate = gd->baudrate; /* Console Baudrate */
|
||||
|
||||
memcpy(id, (void *)gd, sizeof(gd_t));
|
||||
|
@ -244,14 +242,12 @@ void board_init_f(ulong bootflag)
|
|||
|
||||
/* NOTREACHED - relocate_code() does not return */
|
||||
}
|
||||
/************************************************************************
|
||||
*
|
||||
|
||||
/*
|
||||
* This is the next part if the initialization sequence: we are now
|
||||
* running from RAM and have a "normal" C environment, i. e. global
|
||||
* data can be written, BSS has been cleared, the stack size in not
|
||||
* that critical any more, etc.
|
||||
*
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
void board_init_r(gd_t *id, ulong dest_addr)
|
||||
|
@ -344,9 +340,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
|||
/* Initialize from environment */
|
||||
load_addr = getenv_ulong("loadaddr", 16, load_addr);
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
if ((s = getenv ("bootfile")) != NULL) {
|
||||
s = getenv("bootfile");
|
||||
if (s != NULL)
|
||||
copy_filename(BootFile, s, sizeof(BootFile));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_SPI
|
||||
|
@ -369,9 +365,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
|||
#endif
|
||||
|
||||
/* main_loop() can return to retry autoboot, if so just run it again. */
|
||||
for (;;) {
|
||||
for (;;)
|
||||
main_loop();
|
||||
}
|
||||
|
||||
/* NOTREACHED - no way out of command loop except booting */
|
||||
}
|
||||
|
@ -379,5 +374,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
|||
void hang(void)
|
||||
{
|
||||
puts("### ERROR ### Please RESET the board ###\n");
|
||||
for (;;);
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue