diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/fsl_pci_init.c | 5 | ||||
-rw-r--r-- | drivers/pci/pci.c | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 5b34dcb..71ab02b 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -518,11 +518,14 @@ void fsl_pci_config_unlock(struct pci_controller *hose) #include <fdt_support.h> void ft_fsl_pci_setup(void *blob, const char *pci_compat, - struct pci_controller *hose, unsigned long ctrl_addr) + unsigned long ctrl_addr) { int off; u32 bus_range[2]; phys_addr_t p_ctrl_addr = (phys_addr_t)ctrl_addr; + struct pci_controller *hose; + + hose = find_hose_by_cfg_addr((void *)(ctrl_addr)); /* convert ctrl_addr to true physical address */ p_ctrl_addr = (phys_addr_t)ctrl_addr - CONFIG_SYS_CCSRBAR; diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 702ac67..cdfc4fb 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -165,6 +165,18 @@ struct pci_controller *pci_bus_to_hose (int bus) return NULL; } +struct pci_controller *find_hose_by_cfg_addr(void *cfg_addr) +{ + struct pci_controller *hose; + + for (hose = hose_head; hose; hose = hose->next) { + if (hose->cfg_addr == cfg_addr) + return hose; + } + + return NULL; +} + int pci_last_busno(void) { struct pci_controller *hose = hose_head; |