]> git.sur5r.net Git - u-boot/commitdiff
pci/fsl_pci_init: Added fdt helper for setting up bus-ranges & dma-ranges
authorKumar Gala <galak@kernel.crashing.org>
Thu, 23 Oct 2008 05:01:06 +0000 (00:01 -0500)
committerAndrew Fleming-AFLEMING <afleming@freescale.com>
Fri, 24 Oct 2008 22:35:08 +0000 (17:35 -0500)
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andrew Fleming-AFLEMING <afleming@freescale.com>
drivers/pci/fsl_pci_init.c

index 564459c642a224387050a4423467ba93abed3d0a..b5d868feacbe46210b5df4e62095bd90728e805d 100644 (file)
@@ -299,3 +299,23 @@ void fsl_pci_init(struct pci_controller *hose)
                pci_hose_write_config_word(hose, dev, PCI_SEC_STATUS, 0xffff);
        }
 }
+
+#ifdef CONFIG_OF_BOARD_SETUP
+#include <libfdt.h>
+#include <fdt_support.h>
+
+void ft_fsl_pci_setup(void *blob, const char *pci_alias,
+                       struct pci_controller *hose)
+{
+       int off = fdt_path_offset(blob, pci_alias);
+
+       if (off >= 0) {
+               u32 bus_range[2];
+
+               bus_range[0] = 0;
+               bus_range[1] = hose->last_busno - hose->first_busno;
+               fdt_setprop(blob, off, "bus-range", &bus_range[0], 2*4);
+               fdt_pci_dma_ranges(blob, off, hose);
+       }
+}
+#endif