From: Kumar Gala Date: Thu, 23 Oct 2008 01:26:46 -0500 Subject: [U-Boot] [PATCH 08/10] pci/fsl_pci_init: Added fdt helper for setting up bus-ranges & dma-ranges In-Reply-To: <1224743208-11160-8-git-send-email-galak@kernel.crashing.org> References: <1224743208-11160-1-git-send-email-galak@kernel.crashing.org> <1224743208-11160-2-git-send-email-galak@kernel.crashing.org> <1224743208-11160-3-git-send-email-galak@kernel.crashing.org> <1224743208-11160-4-git-send-email-galak@kernel.crashing.org> <1224743208-11160-5-git-send-email-galak@kernel.crashing.org> <1224743208-11160-6-git-send-email-galak@kernel.crashing.org> <1224743208-11160-7-git-send-email-galak@kernel.crashing.org> <1224743208-11160-8-git-send-email-galak@kernel.crashing.org> Message-ID: <1224743208-11160-9-git-send-email-galak@kernel.crashing.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Kumar Gala --- drivers/pci/fsl_pci_init.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 564459c..b5d868f 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -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 +#include + +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 -- 1.5.5.1