Powerpc/i2c: Use the same initialize codes
[oweals/u-boot.git] / drivers / pci / pci.c
index 1a0b14cd870a1a59f94a74b3b0494d081bf9af8f..5f1f128126e0b54542a182c6d4a61f2c48590e01 100644 (file)
@@ -695,6 +695,23 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
 
 int pci_hose_scan(struct pci_controller *hose)
 {
+#if defined(CONFIG_PCI_BOOTDELAY)
+       static int pcidelay_done;
+       char *s;
+       int i;
+
+       if (!pcidelay_done) {
+               /* wait "pcidelay" ms (if defined)... */
+               s = getenv("pcidelay");
+               if (s) {
+                       int val = simple_strtoul(s, NULL, 10);
+                       for (i = 0; i < val; i++)
+                               udelay(1000);
+               }
+               pcidelay_done = 1;
+       }
+#endif /* CONFIG_PCI_BOOTDELAY */
+
        /* Start scan at current_busno.
         * PCIe will start scan at first_busno+1.
         */
@@ -709,19 +726,6 @@ int pci_hose_scan(struct pci_controller *hose)
 
 void pci_init(void)
 {
-#if defined(CONFIG_PCI_BOOTDELAY)
-       char *s;
-       int i;
-
-       /* wait "pcidelay" ms (if defined)... */
-       s = getenv ("pcidelay");
-       if (s) {
-               int val = simple_strtoul (s, NULL, 10);
-               for (i=0; i<val; i++)
-                       udelay (1000);
-       }
-#endif /* CONFIG_PCI_BOOTDELAY */
-
        hose_head = NULL;
 
        /* now call board specific pci_init()... */