layerscape: add 64b/32b target for ls1043ardb device
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 0053-PCI-designware-Make-config-accessor-override-checkin.patch
1 From 6882f9eef932e6f5cc3c57115e3d7d4b5bc19662 Mon Sep 17 00:00:00 2001
2 From: Bjorn Helgaas <bhelgaas@google.com>
3 Date: Tue, 5 Jan 2016 15:56:30 -0600
4 Subject: [PATCH 53/70] PCI: designware: Make config accessor override
5 checking symmetric
6
7 Drivers based on the DesignWare core can override the config read accessors
8 by supplying rd_own_conf() and rd_other_conf() function pointers.
9 dw_pcie_rd_conf() calls dw_pcie_rd_own_conf() (for accesses to the root
10 bus) or dw_pcie_rd_other_conf():
11
12 dw_pcie_rd_conf
13 dw_pcie_rd_own_conf # if on root bus
14 dw_pcie_rd_other_conf # if not on root bus
15
16 Previously we checked for rd_other_conf() directly in dw_pcie_rd_conf(),
17 but we checked for rd_own_conf() in dw_pcie_rd_own_conf().
18
19 Check for rd_other_conf() in dw_pcie_rd_other_conf() to make this symmetric
20 with the rd_own_conf() checking, and similarly for the write path.
21
22 No functional change intended.
23
24 Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
25 Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
26 ---
27 drivers/pci/host/pcie-designware.c | 12 ++++++------
28 1 file changed, 6 insertions(+), 6 deletions(-)
29
30 --- a/drivers/pci/host/pcie-designware.c
31 +++ b/drivers/pci/host/pcie-designware.c
32 @@ -571,6 +571,9 @@ static int dw_pcie_rd_other_conf(struct
33 u64 cpu_addr;
34 void __iomem *va_cfg_base;
35
36 + if (pp->ops->rd_other_conf)
37 + return pp->ops->rd_other_conf(pp, bus, devfn, where, size, val);
38 +
39 busdev = PCIE_ATU_BUS(bus->number) | PCIE_ATU_DEV(PCI_SLOT(devfn)) |
40 PCIE_ATU_FUNC(PCI_FUNC(devfn));
41
42 @@ -605,6 +608,9 @@ static int dw_pcie_wr_other_conf(struct
43 u64 cpu_addr;
44 void __iomem *va_cfg_base;
45
46 + if (pp->ops->wr_other_conf)
47 + return pp->ops->wr_other_conf(pp, bus, devfn, where, size, val);
48 +
49 busdev = PCIE_ATU_BUS(bus->number) | PCIE_ATU_DEV(PCI_SLOT(devfn)) |
50 PCIE_ATU_FUNC(PCI_FUNC(devfn));
51
52 @@ -667,9 +673,6 @@ static int dw_pcie_rd_conf(struct pci_bu
53 if (bus->number == pp->root_bus_nr)
54 return dw_pcie_rd_own_conf(pp, where, size, val);
55
56 - if (pp->ops->rd_other_conf)
57 - return pp->ops->rd_other_conf(pp, bus, devfn, where, size, val);
58 -
59 return dw_pcie_rd_other_conf(pp, bus, devfn, where, size, val);
60 }
61
62 @@ -684,9 +687,6 @@ static int dw_pcie_wr_conf(struct pci_bu
63 if (bus->number == pp->root_bus_nr)
64 return dw_pcie_wr_own_conf(pp, where, size, val);
65
66 - if (pp->ops->wr_other_conf)
67 - return pp->ops->wr_other_conf(pp, bus, devfn, where, size, val);
68 -
69 return dw_pcie_wr_other_conf(pp, bus, devfn, where, size, val);
70 }
71