Skip to content

Commit c3b2f9d

Browse files
committed
Merge branch 'pci/controller/apple'
- Skip ports disabled in DT when setting up ports (Janne Grunau) - Add t6020 compatible string (Alyssa Rosenzweig) - Extract ECAM bridge creation helper from pci_host_common_probe() to separate driver-specific things like MSI from PCI things (Marc Zyngier) - Dynamically allocate RID-to_SID bitmap to prepare for SoCs with varying capabilities (Marc Zyngier) - Directly set/clear INTx mask bits because T602x dropped the accessors that could do this without locking (Marc Zyngier) - Move port PHY registers to their own reg items to accommodate T602x, which moves them around; retain default offsets for existing DTs that lack phy%d entries with the reg offsets (Hector Martin) - Stop polling for core refclk, which doesn't work on T602x and the bootloader has already done anyway (Hector Martin) - Use gpiod_set_value_cansleep() when asserting PERST# in probe because we're allowed to sleep there (Hector Martin) - Move register offsets into SoC-specific structure (Hector Martin) - Add T602x PCIe support (Hector Martin) * pci/controller/apple: PCI: apple: Add T602x PCIe support PCI: apple: Abstract register offsets via a SoC-specific structure PCI: apple: Use gpiod_set_value_cansleep in probe flow PCI: apple: Drop poll for CORE_RC_PHYIF_STAT_REFCLK PCI: apple: Move port PHY registers to their own reg items PCI: apple: Fix missing OF node reference in apple_pcie_setup_port PCI: apple: Move away from INTMSK{SET,CLR} for INTx and private interrupts PCI: apple: Dynamically allocate RID-to_SID bitmap PCI: apple: Move over to standalone probing PCI: ecam: Allow cfg->priv to be pre-populated from the root port device PCI: host-generic: Extract an ECAM bridge creation helper from pci_host_common_probe() dt-bindings: pci: apple,pcie: Add t6020 compatible string PCI: apple: Set only available ports up
2 parents 2ce7387 + 4e639f1 commit c3b2f9d

File tree

5 files changed

+220
-82
lines changed

5 files changed

+220
-82
lines changed

Documentation/devicetree/bindings/pci/apple,pcie.yaml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ description: |
1717
implements its root ports. But the ATU found on most DesignWare
1818
PCIe host bridges is absent.
1919
20+
On systems derived from T602x, the PHY registers are in a region
21+
separate from the port registers. In that case, there is one PHY
22+
register range per port register range.
23+
2024
All root ports share a single ECAM space, but separate GPIOs are
2125
used to take the PCI devices on those ports out of reset. Therefore
2226
the standard "reset-gpios" and "max-link-speed" properties appear on
@@ -30,16 +34,18 @@ description: |
3034
3135
properties:
3236
compatible:
33-
items:
34-
- enum:
35-
- apple,t8103-pcie
36-
- apple,t8112-pcie
37-
- apple,t6000-pcie
38-
- const: apple,pcie
37+
oneOf:
38+
- items:
39+
- enum:
40+
- apple,t8103-pcie
41+
- apple,t8112-pcie
42+
- apple,t6000-pcie
43+
- const: apple,pcie
44+
- const: apple,t6020-pcie
3945

4046
reg:
4147
minItems: 3
42-
maxItems: 6
48+
maxItems: 10
4349

4450
reg-names:
4551
minItems: 3
@@ -50,6 +56,10 @@ properties:
5056
- const: port1
5157
- const: port2
5258
- const: port3
59+
- const: phy0
60+
- const: phy1
61+
- const: phy2
62+
- const: phy3
5363

5464
ranges:
5565
minItems: 2
@@ -98,6 +108,15 @@ allOf:
98108
maxItems: 5
99109
interrupts:
100110
maxItems: 3
111+
- if:
112+
properties:
113+
compatible:
114+
contains:
115+
const: apple,t6020-pcie
116+
then:
117+
properties:
118+
reg-names:
119+
minItems: 10
101120

102121
examples:
103122
- |

drivers/pci/controller/pci-host-common.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,26 @@ static struct pci_config_window *gen_pci_init(struct device *dev,
4949
return cfg;
5050
}
5151

52-
int pci_host_common_probe(struct platform_device *pdev)
52+
int pci_host_common_init(struct platform_device *pdev,
53+
const struct pci_ecam_ops *ops)
5354
{
5455
struct device *dev = &pdev->dev;
5556
struct pci_host_bridge *bridge;
5657
struct pci_config_window *cfg;
57-
const struct pci_ecam_ops *ops;
58-
59-
ops = of_device_get_match_data(&pdev->dev);
60-
if (!ops)
61-
return -ENODEV;
6258

6359
bridge = devm_pci_alloc_host_bridge(dev, 0);
6460
if (!bridge)
6561
return -ENOMEM;
6662

67-
platform_set_drvdata(pdev, bridge);
68-
6963
of_pci_check_probe_only();
7064

7165
/* Parse and map our Configuration Space windows */
7266
cfg = gen_pci_init(dev, bridge, ops);
7367
if (IS_ERR(cfg))
7468
return PTR_ERR(cfg);
7569

70+
platform_set_drvdata(pdev, bridge);
71+
7672
bridge->sysdata = cfg;
7773
bridge->ops = (struct pci_ops *)&ops->pci_ops;
7874
bridge->enable_device = ops->enable_device;
@@ -81,6 +77,18 @@ int pci_host_common_probe(struct platform_device *pdev)
8177

8278
return pci_host_probe(bridge);
8379
}
80+
EXPORT_SYMBOL_GPL(pci_host_common_init);
81+
82+
int pci_host_common_probe(struct platform_device *pdev)
83+
{
84+
const struct pci_ecam_ops *ops;
85+
86+
ops = of_device_get_match_data(&pdev->dev);
87+
if (!ops)
88+
return -ENODEV;
89+
90+
return pci_host_common_init(pdev, ops);
91+
}
8492
EXPORT_SYMBOL_GPL(pci_host_common_probe);
8593

8694
void pci_host_common_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)