Skip to content

Commit ad46547

Browse files
committed
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc bugfix from Ben Herrenschmidt: "This is a fix for a regression causing a freescale "83xx" based platforms to crash on boot due to some PCI breakage" * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc/pci: Fix boot panic on mpc83xx (regression)
2 parents 5dbc746 + b37e161 commit ad46547

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

‎arch/powerpc/sysdev/fsl_pci.c‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,14 @@ static int fsl_indirect_read_config(struct pci_bus *bus, unsigned int devfn,
9797
return indirect_read_config(bus, devfn, offset, len, val);
9898
}
9999

100-
static struct pci_ops fsl_indirect_pci_ops =
100+
#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
101+
102+
static struct pci_ops fsl_indirect_pcie_ops =
101103
{
102104
.read = fsl_indirect_read_config,
103105
.write = indirect_write_config,
104106
};
105107

106-
static void __init fsl_setup_indirect_pci(struct pci_controller* hose,
107-
resource_size_t cfg_addr,
108-
resource_size_t cfg_data, u32 flags)
109-
{
110-
setup_indirect_pci(hose, cfg_addr, cfg_data, flags);
111-
hose->ops = &fsl_indirect_pci_ops;
112-
}
113-
114-
#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
115-
116108
#define MAX_PHYS_ADDR_BITS 40
117109
static u64 pci64_dma_offset = 1ull << MAX_PHYS_ADDR_BITS;
118110

@@ -504,13 +496,15 @@ int __init fsl_add_bridge(struct platform_device *pdev, int is_primary)
504496
if (!hose->private_data)
505497
goto no_bridge;
506498

507-
fsl_setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4,
508-
PPC_INDIRECT_TYPE_BIG_ENDIAN);
499+
setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4,
500+
PPC_INDIRECT_TYPE_BIG_ENDIAN);
509501

510502
if (in_be32(&pci->block_rev1) < PCIE_IP_REV_3_0)
511503
hose->indirect_type |= PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK;
512504

513505
if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
506+
/* use fsl_indirect_read_config for PCIe */
507+
hose->ops = &fsl_indirect_pcie_ops;
514508
/* For PCIE read HEADER_TYPE to identify controler mode */
515509
early_read_config_byte(hose, 0, 0, PCI_HEADER_TYPE, &hdr_type);
516510
if ((hdr_type & 0x7f) != PCI_HEADER_TYPE_BRIDGE)
@@ -814,8 +808,8 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
814808
if (ret)
815809
goto err0;
816810
} else {
817-
fsl_setup_indirect_pci(hose, rsrc_cfg.start,
818-
rsrc_cfg.start + 4, 0);
811+
setup_indirect_pci(hose, rsrc_cfg.start,
812+
rsrc_cfg.start + 4, 0);
819813
}
820814

821815
printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. "

0 commit comments

Comments
 (0)