X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib_sh%2Fboard.c;h=5d61f0d74fe1b7f1f425468d6158c7bc97a16448;hb=f8d7b56e003fe19f37d4e9e326df9e9024a052b0;hp=6dfab4ec9e0c54c354cbc6584dcedc24c8e7e4f2;hpb=4a065abf926f128beb36d93449defa0d690e7fef;p=u-boot diff --git a/lib_sh/board.c b/lib_sh/board.c index 6dfab4ec9e..5d61f0d74f 100644 --- a/lib_sh/board.c +++ b/lib_sh/board.c @@ -21,7 +21,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -33,37 +34,9 @@ extern int board_init(void); extern int dram_init(void); extern int timer_init(void); -const char version_string[] = U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")"; +const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")"; -unsigned long monitor_flash_len = CFG_MONITOR_LEN; - -static unsigned long mem_malloc_start; -static unsigned long mem_malloc_end; -static unsigned long mem_malloc_brk; - -static void mem_malloc_init(void) -{ - - mem_malloc_start = (TEXT_BASE - CFG_GBL_DATA_SIZE - CFG_MALLOC_LEN); - mem_malloc_end = (mem_malloc_start + CFG_MALLOC_LEN - 16); - mem_malloc_brk = mem_malloc_start; - memset((void *) mem_malloc_start, 0, - (mem_malloc_end - mem_malloc_start)); -} - -void *sbrk(ptrdiff_t increment) -{ - unsigned long old = mem_malloc_brk; - unsigned long new = old + increment; - - if ((new < mem_malloc_start) || - (new > mem_malloc_end)) { - return NULL; - } - - mem_malloc_brk = new; - return (void *) old; -} +unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN; static int sh_flash_init(void) { @@ -113,7 +86,8 @@ static int sh_pci_init(void) static int sh_mem_env_init(void) { - mem_malloc_init(); + mem_malloc_init(TEXT_BASE - CONFIG_SYS_GBL_DATA_SIZE - + CONFIG_SYS_MALLOC_LEN, CONFIG_SYS_MALLOC_LEN - 16); malloc_bin_reloc(); env_relocate(); jumptable_init(); @@ -124,17 +98,7 @@ static int sh_mem_env_init(void) static int sh_net_init(void) { DECLARE_GLOBAL_DATA_PTR; - char *s, *e; - int i; - gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr"); - s = getenv("ethaddr"); - for (i = 0; i < 6; ++i) { - gd->bd->bi_enetaddr[i] = s ? simple_strtoul(s, &e, 16) : 0; - if (s) - s = (*e) ? e + 1 : e; - } - return 0; } #endif @@ -155,11 +119,11 @@ init_fnc_t *init_sequence[] = checkboard, /* Check support board */ dram_init, /* SDRAM init */ timer_init, /* SuperH Timer (TCNT0 only) init */ - sh_flash_init, /* Flash memory(NOR) init*/ sh_mem_env_init, + sh_flash_init, /* Flash memory(NOR) init*/ INIT_FUNC_NAND_INIT/* Flash memory (NAND) init */ INIT_FUNC_PCI_INIT /* PCI init */ - devices_init, + stdio_init, console_init_r, interrupt_init, #ifdef BOARD_LATE_INIT @@ -178,7 +142,7 @@ void sh_generic_init(void) bd_t *bd; init_fnc_t **init_fnc_ptr; - memset(gd, 0, CFG_GBL_DATA_SIZE); + memset(gd, 0, CONFIG_SYS_GBL_DATA_SIZE); gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ @@ -188,12 +152,12 @@ void sh_generic_init(void) gd->cpu_clk = CONFIG_SYS_CLK_FREQ; bd = gd->bd; - bd->bi_memstart = CFG_SDRAM_BASE; - bd->bi_memsize = CFG_SDRAM_SIZE; - bd->bi_flashstart = CFG_FLASH_BASE; -#if defined(CFG_SRAM_BASE) && defined(CFG_SRAM_SIZE) - bd->bi_sramstart = CFG_SRAM_BASE; - bd->bi_sramsize = CFG_SRAM_SIZE; + bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; + bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; + bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; +#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; #endif bd->bi_baudrate = CONFIG_BAUDRATE;