X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Fsh%2Flib%2Fboard.c;h=968566c6f5109b2f1665d7f1c0a0fc898d12af36;hb=5aebe3b07254d9ec8f7ae23a4525a6c535a7f858;hp=c97e20c3e1cfc3f3a7cc2506835c59e3071c5562;hpb=83653121d7382fccfe329cb732f77f116341ef1d;p=oweals%2Fu-boot.git diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index c97e20c3e1..968566c6f5 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); @@ -43,10 +45,12 @@ unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN; 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; } @@ -89,7 +93,7 @@ static int sh_pci_init(void) static int sh_mem_env_init(void) { - mem_malloc_init(TEXT_BASE - CONFIG_SYS_GBL_DATA_SIZE - + mem_malloc_init(CONFIG_SYS_TEXT_BASE - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN, CONFIG_SYS_MALLOC_LEN - 16); env_relocate(); jumptable_init(); @@ -99,7 +103,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; } @@ -139,12 +142,10 @@ init_fnc_t *init_sequence[] = void sh_generic_init(void) { - DECLARE_GLOBAL_DATA_PTR; - bd_t *bd; init_fnc_t **init_fnc_ptr; - memset(gd, 0, CONFIG_SYS_GBL_DATA_SIZE); + memset(gd, 0, GENERATED_GBL_DATA_SIZE); gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */