]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/nds32/lib/board.c
Merge branch 'master' of git://git.denx.de/u-boot-mips
[karo-tx-uboot.git] / arch / nds32 / lib / board.c
index 1776a725721743fe19dd8012955ab50f698e0eb6..875f22013c04e429905577475e76b2b023745f31 100644 (file)
@@ -50,13 +50,7 @@ ulong monitor_flash_len;
 #endif
 static int init_baudrate(void)
 {
-       char tmp[64];   /* long enough for environment variables */
-       int i = getenv_f("baudrate", tmp, sizeof(tmp));
-
-       gd->bd->bi_baudrate = gd->baudrate = (i > 0)
-                       ? (int) simple_strtoul(tmp, NULL, 10)
-                       : CONFIG_BAUDRATE;
-
+       gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
        return 0;
 }
 
@@ -109,6 +103,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)
@@ -121,6 +116,7 @@ static int pmu_init(void)
        return 0;
 }
 #endif
+#endif
 
 /*
  * Breathe some life into the board...
@@ -307,12 +303,9 @@ 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;
 
@@ -331,9 +324,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
                (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
 #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);
 
@@ -357,6 +348,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);
@@ -366,12 +362,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();
@@ -400,17 +394,9 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif
 
        /* Initialize from environment */
-       s = getenv("loadaddr");
-       if (s != NULL)
-               load_addr = simple_strtoul(s, NULL, 16);
-
-#if defined(CONFIG_CMD_NET)
-       s = getenv("bootfile");
-       if (s != NULL)
-               copy_filename(BootFile, s, sizeof(BootFile));
-#endif
+       load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
-#ifdef BOARD_LATE_INIT
+#ifdef CONFIG_BOARD_LATE_INIT
        board_late_init();
 #endif