]> git.sur5r.net Git - u-boot/blobdiff - cpu/mpc8260/pci.c
Merge branch 'next' of git://git.denx.de/u-boot-avr32
[u-boot] / cpu / mpc8260 / pci.c
index 44576deb61d8a8ed84b8271a3640380473210d75..82303644b2be6df407b296992f3c251f90e839eb 100644 (file)
 #include <mpc8260.h>
 #include <asm/m8260_pci.h>
 #include <asm/io.h>
+#ifdef CONFIG_OF_LIBFDT
+#include <libfdt.h>
+#include <fdt_support.h>
+#endif
+
+#if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272 || defined CONFIG_PM826
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /*
  *   Local->PCI map (from CPU)                            controlled by
  *   MPC826x master window
@@ -234,9 +243,6 @@ static inline void pci_outl (u32 addr, u32 data)
 
 void pci_mpc8250_init (struct pci_controller *hose)
 {
-#if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
        u16 tempShort;
 
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
@@ -272,7 +278,8 @@ void pci_mpc8250_init (struct pci_controller *hose)
                                  | SIUMCR_CS10PC00
                                  | SIUMCR_BCTLC00
                                  | SIUMCR_MMR11;
-
+#elif defined(CONFIG_TQM8272)
+/* nothing to do for this Board here */
 #else
        /*
         * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
@@ -399,7 +406,7 @@ void pci_mpc8250_init (struct pci_controller *hose)
        hose->last_busno = 0xff;
 
        /* System memory space */
-#if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272
+#if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272 || defined CONFIG_PM826
        pci_set_region (hose->regions + 0,
                        PCI_SLV_MEM_BUS,
                        PCI_SLV_MEM_LOCAL,
@@ -446,4 +453,12 @@ void pci_mpc8250_init (struct pci_controller *hose)
        immap->im_pci.pci_emr |= cpu_to_le32 (PCI_ERROR_PCI_NO_RSP);
 }
 
+#if defined(CONFIG_OF_LIBFDT)
+void ft_pci_setup(void *blob, bd_t *bd)
+{
+       do_fixup_by_prop_u32(blob, "device_type", "pci", 4,
+               "clock-frequency", gd->pci_clk, 1);
+}
+#endif
+
 #endif /* CONFIG_PCI */