X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=arch%2Fnds32%2Flib%2Fboard.c;h=1157d8c5035f7e2eb73dd862dfdc3e2a2234ed35;hb=b8eee4354f33b9810d929b6f7df74238b538e5a8;hp=2fd0e93d455bcc5517b86f7a3ff5e0dc43d82703;hpb=c829ff2e3d1bec9b2019480d82638149327db99e;p=karo-tx-uboot.git diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c index 2fd0e93d45..1157d8c503 100644 --- a/arch/nds32/lib/board.c +++ b/arch/nds32/lib/board.c @@ -36,6 +36,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -103,6 +104,7 @@ static int nds32_pci_init(void) #endif /* CONFIG_CMD_PCI || CONFIG_PCI */ #if defined(CONFIG_PMU) || defined(CONFIG_PCU) +#ifndef CONFIG_SKIP_LOWLEVEL_INIT static int pmu_init(void) { #if defined(CONFIG_FTPMU010_POWER) @@ -115,6 +117,7 @@ static int pmu_init(void) return 0; } #endif +#endif /* * Breathe some life into the board... @@ -190,7 +193,7 @@ void board_init_f(ulong bootflag) memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE); - gd->mon_len = (unsigned int)(&__bss_end__) - (unsigned int)(&_start); + gd->mon_len = (unsigned int)(&__bss_end) - (unsigned int)(&_start); for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { if ((*init_fnc_ptr)() != 0) @@ -205,17 +208,6 @@ void board_init_f(ulong bootflag) addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size; -#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) - /* reserve TLB table */ - addr -= (4096 * 4); - - /* round down to next 64 kB limit */ - addr &= ~(0x10000 - 1); - - gd->tlb_addr = addr; - debug("TLB table at: %08lx\n", addr); -#endif - /* round down to next 4 kB limit */ addr &= ~(4096 - 1); debug("Top of RAM usable for U-Boot at: %08lx\n", addr); @@ -301,18 +293,15 @@ void board_init_f(ulong bootflag) */ void board_init_r(gd_t *id, ulong dest_addr) { - char *s; bd_t *bd; ulong malloc_start; - extern void malloc_bin_reloc(void); - gd = id; bd = gd->bd; gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ - monitor_flash_len = &_end - &_start; + monitor_flash_len = (ulong)&_end - (ulong)&_start; debug("monitor flash len: %08lX\n", monitor_flash_len); board_init(); /* Setup chipselects */ @@ -321,20 +310,17 @@ void board_init_r(gd_t *id, ulong dest_addr) /* * We have to relocate the command table manually */ - fixup_cmdtable(&__u_boot_cmd_start, - (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start)); + fixup_cmdtable(ll_entry_start(cmd_tbl_t, cmd), + ll_entry_count(cmd_tbl_t, cmd)); #endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */ -#ifdef CONFIG_SERIAL_MULTI serial_initialize(); -#endif debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr); /* The Malloc area is immediately below the monitor copy in DRAM */ malloc_start = dest_addr - TOTAL_MALLOC_LEN; mem_malloc_init(malloc_start, TOTAL_MALLOC_LEN); - malloc_bin_reloc(); #ifndef CONFIG_SYS_NO_FLASH /* configure available FLASH banks */ @@ -351,6 +337,11 @@ void board_init_r(gd_t *id, ulong dest_addr) nand_init(); /* go init the NAND */ #endif +#if defined(CONFIG_CMD_IDE) + puts("IDE: "); + ide_init(); +#endif + #ifdef CONFIG_GENERIC_MMC puts("MMC: "); mmc_initialize(gd->bd); @@ -360,12 +351,10 @@ void board_init_r(gd_t *id, ulong dest_addr) env_relocate(); #if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI) + puts("PCI: "); nds32_pci_init(); #endif - /* IP Address */ - gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr"); - stdio_init(); /* get the devices list going. */ jumptable_init(); @@ -396,13 +385,7 @@ 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) - s = getenv("bootfile"); - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); -#endif - -#ifdef BOARD_LATE_INIT +#ifdef CONFIG_BOARD_LATE_INIT board_late_init(); #endif @@ -422,10 +405,3 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } - -void hang(void) -{ - puts("### ERROR ### Please RESET the board ###\n"); - for (;;) - ; -}