Merge branch 'master' of git://git.denx.de/u-boot into resolve
[oweals/u-boot.git] / board / freescale / mpc8313erdb / mpc8313erdb.c
index e5f62ae9650905835fc76e34c98ac90163353074..1071803c79ad001dd1abf72c7d39bb70edf9240a 100644 (file)
@@ -31,6 +31,9 @@
 #include <vsc7385.h>
 #include <ns16550.h>
 #include <nand.h>
+#if defined(CONFIG_MPC83XX_GPIO) && !defined(CONFIG_NAND_SPL)
+#include <asm/gpio.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,6 +45,18 @@ int board_early_init_f(void)
        if (im->pmc.pmccr1 & PMCCR1_POWER_OFF)
                gd->flags |= GD_FLG_SILENT;
 #endif
+#if defined(CONFIG_MPC83XX_GPIO) && !defined(CONFIG_NAND_SPL)
+       mpc83xx_gpio_init_f();
+#endif
+
+       return 0;
+}
+
+int board_early_init_r(void)
+{
+#if defined(CONFIG_MPC83XX_GPIO) && !defined(CONFIG_NAND_SPL)
+       mpc83xx_gpio_init_r();
+#endif
 
        return 0;
 }
@@ -55,22 +70,22 @@ int checkboard(void)
 #ifndef CONFIG_NAND_SPL
 static struct pci_region pci_regions[] = {
        {
-               bus_start: CONFIG_SYS_PCI1_MEM_BASE,
-               phys_start: CONFIG_SYS_PCI1_MEM_PHYS,
-               size: CONFIG_SYS_PCI1_MEM_SIZE,
-               flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
+               .bus_start = CONFIG_SYS_PCI1_MEM_BASE,
+               .phys_start = CONFIG_SYS_PCI1_MEM_PHYS,
+               .size = CONFIG_SYS_PCI1_MEM_SIZE,
+               .flags = PCI_REGION_MEM | PCI_REGION_PREFETCH
        },
        {
-               bus_start: CONFIG_SYS_PCI1_MMIO_BASE,
-               phys_start: CONFIG_SYS_PCI1_MMIO_PHYS,
-               size: CONFIG_SYS_PCI1_MMIO_SIZE,
-               flags: PCI_REGION_MEM
+               .bus_start = CONFIG_SYS_PCI1_MMIO_BASE,
+               .phys_start = CONFIG_SYS_PCI1_MMIO_PHYS,
+               .size = CONFIG_SYS_PCI1_MMIO_SIZE,
+               .flags = PCI_REGION_MEM
        },
        {
-               bus_start: CONFIG_SYS_PCI1_IO_BASE,
-               phys_start: CONFIG_SYS_PCI1_IO_PHYS,
-               size: CONFIG_SYS_PCI1_IO_SIZE,
-               flags: PCI_REGION_IO
+               .bus_start = CONFIG_SYS_PCI1_IO_BASE,
+               .phys_start = CONFIG_SYS_PCI1_IO_PHYS,
+               .size = CONFIG_SYS_PCI1_IO_SIZE,
+               .flags = PCI_REGION_IO
        }
 };
 
@@ -80,7 +95,6 @@ void pci_init_board(void)
        volatile clk83xx_t *clk = (volatile clk83xx_t *)&immr->clk;
        volatile law83xx_t *pci_law = immr->sysconf.pcilaw;
        struct pci_region *reg[] = { pci_regions };
-       int warmboot;
 
        /* Enable all 3 PCI_CLK_OUTPUTs. */
        clk->occr |= 0xe0000000;
@@ -94,12 +108,7 @@ void pci_init_board(void)
        pci_law[1].bar = CONFIG_SYS_PCI1_IO_PHYS & LAWBAR_BAR;
        pci_law[1].ar = LBLAWAR_EN | LBLAWAR_1MB;
 
-       warmboot = gd->bd->bi_bootflags & BOOTFLAG_WARM;
-#ifndef CONFIG_SYS_8313ERDB_BROKEN_PMC
-       warmboot |= immr->pmc.pmccr1 & PMCCR1_POWER_OFF;
-#endif
-
-       mpc83xx_pci_init(1, reg, warmboot);
+       mpc83xx_pci_init(1, reg);
 }
 
 /*