X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=arch%2Fsh%2Flib%2Fboard.c;h=ed91643427015176a947909b530611b92e09aaa0;hb=23f9670f1aee936ca468d2d0ddb0f025defde626;hp=fe53ab4de9194351a9906a91cb44780220847914;hpb=25ddd1fb0a2281b182529afbc8fda5de2dc16d96;p=u-boot diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index fe53ab4de9..ed91643427 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007,2008 + * Copyright (C) 2007, 2008, 2010 * Nobuhiro Iwamatsu * * This program is free software; you can redistribute it and/or @@ -32,6 +32,8 @@ #include #endif +DECLARE_GLOBAL_DATA_PTR; + extern int cpu_init(void); extern int board_init(void); extern int dram_init(void); @@ -41,15 +43,19 @@ const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")"; unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN; +#ifndef CONFIG_SYS_NO_FLASH static int sh_flash_init(void) { - DECLARE_GLOBAL_DATA_PTR; - gd->bd->bi_flashsize = flash_init(); - printf("FLASH: %ldMB\n", gd->bd->bi_flashsize / (1024*1024)); + + if (gd->bd->bi_flashsize >= (1024 * 1024)) + printf("Flash: %ldMB\n", gd->bd->bi_flashsize / (1024*1024)); + else + printf("Flash: %ldKB\n", gd->bd->bi_flashsize / 1024); return 0; } +#endif /* CONFIG_SYS_NO_FLASH */ #if defined(CONFIG_CMD_NAND) # include @@ -99,7 +105,6 @@ static int sh_mem_env_init(void) #if defined(CONFIG_CMD_NET) static int sh_net_init(void) { - DECLARE_GLOBAL_DATA_PTR; gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr"); return 0; } @@ -122,7 +127,9 @@ init_fnc_t *init_sequence[] = dram_init, /* SDRAM init */ timer_init, /* SuperH Timer (TCNT0 only) init */ sh_mem_env_init, - sh_flash_init, /* Flash memory(NOR) init*/ +#ifndef CONFIG_SYS_NO_FLASH + sh_flash_init, /* Flash memory init*/ +#endif INIT_FUNC_NAND_INIT/* Flash memory (NAND) init */ INIT_FUNC_PCI_INIT /* PCI init */ stdio_init, @@ -139,8 +146,6 @@ init_fnc_t *init_sequence[] = void sh_generic_init(void) { - DECLARE_GLOBAL_DATA_PTR; - bd_t *bd; init_fnc_t **init_fnc_ptr; @@ -156,7 +161,9 @@ void sh_generic_init(void) bd = gd->bd; bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; +#ifndef CONFIG_SYS_NO_FLASH bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; +#endif #if defined(CONFIG_SYS_SRAM_BASE) && defined(CONFIG_SYS_SRAM_SIZE) bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE;