Merge branch 'pci/driver-cleanup'
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 13 Jan 2022 15:57:53 +0000 (09:57 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 13 Jan 2022 15:57:53 +0000 (09:57 -0600)
- Use of_device_get_match_data(), not of_match_device(), when we only need
  the device data in altera, artpec6, cadence, designware-plat, dra7xx,
  keystone, kirin (Fan Fei)

- Drop pointless of_device_get_match_data() cast in j721e (Bjorn Helgaas)

- Drop redundant struct device * from j721e since struct cdns_pcie already
  has one (Bjorn Helgaas)

- Rename driver structs to *_pcie in intel-gw, iproc, ls-gen4,
  mediatek-gen3, microchip, mt7621, rcar-gen2, tegra194, uniphier, xgene,
  xilinx, xilinx-cpm for consistency across drivers (Fan Fei)

- Fix invalid address space conversions in hisi, spear13xx (Bjorn Helgaas)

* pci/driver-cleanup:
  PCI: spear13xx: Avoid invalid address space conversions
  PCI: hisi: Avoid invalid address space conversions
  PCI: xilinx-cpm: Rename xilinx_cpm_pcie_port to xilinx_cpm_pcie
  PCI: xilinx: Rename xilinx_pcie_port to xilinx_pcie
  PCI: xgene: Rename xgene_pcie_port to xgene_pcie
  PCI: uniphier: Rename uniphier_pcie_priv to uniphier_pcie
  PCI: tegra194: Rename tegra_pcie_dw to tegra194_pcie
  PCI: rcar-gen2: Rename rcar_pci_priv to rcar_pci
  PCI: mt7621: Rename mt7621_pci_ to mt7621_pcie_
  PCI: microchip: Rename mc_port to mc_pcie
  PCI: mediatek-gen3: Rename mtk_pcie_port to mtk_gen3_pcie
  PCI: ls-gen4: Rename ls_pcie_g4 to ls_g4_pcie
  PCI: iproc: Rename iproc_pcie_pltfm_ to iproc_pltfm_pcie_
  PCI: iproc: Rename iproc_pcie_bcma_ to iproc_bcma_pcie_
  PCI: intel-gw: Rename intel_pcie_port to intel_pcie
  PCI: j721e: Drop redundant struct device *
  PCI: j721e: Drop pointless of_device_get_match_data() cast
  PCI: kirin: Prefer of_device_get_match_data()
  PCI: keystone: Prefer of_device_get_match_data()
  PCI: dra7xx: Prefer of_device_get_match_data()
  PCI: designware-plat: Prefer of_device_get_match_data()
  PCI: cadence: Prefer of_device_get_match_data()
  PCI: artpec6: Prefer of_device_get_match_data()
  PCI: altera: Prefer of_device_get_match_data()

# Conflicts:
# drivers/pci/controller/pcie-mt7621.c

1  2 
drivers/pci/controller/dwc/pci-keystone.c
drivers/pci/controller/dwc/pcie-kirin.c
drivers/pci/controller/pci-xgene.c
drivers/pci/controller/pcie-altera.c
drivers/pci/controller/pcie-mediatek-gen3.c
drivers/pci/controller/pcie-mt7621.c

Simple merge
Simple merge
@@@ -285,33 -282,28 +285,33 @@@ static int mtk_pcie_startup_port(struc
        u32 val;
  
        /* Set as RC mode */
-       val = readl_relaxed(port->base + PCIE_SETTING_REG);
+       val = readl_relaxed(pcie->base + PCIE_SETTING_REG);
        val |= PCIE_RC_MODE;
-       writel_relaxed(val, port->base + PCIE_SETTING_REG);
+       writel_relaxed(val, pcie->base + PCIE_SETTING_REG);
  
        /* Set class code */
-       val = readl_relaxed(port->base + PCIE_PCI_IDS_1);
+       val = readl_relaxed(pcie->base + PCIE_PCI_IDS_1);
        val &= ~GENMASK(31, 8);
        val |= PCI_CLASS(PCI_CLASS_BRIDGE_PCI << 8);
-       writel_relaxed(val, port->base + PCIE_PCI_IDS_1);
+       writel_relaxed(val, pcie->base + PCIE_PCI_IDS_1);
  
        /* Mask all INTx interrupts */
-       val = readl_relaxed(port->base + PCIE_INT_ENABLE_REG);
+       val = readl_relaxed(pcie->base + PCIE_INT_ENABLE_REG);
        val &= ~PCIE_INTX_ENABLE;
-       writel_relaxed(val, port->base + PCIE_INT_ENABLE_REG);
+       writel_relaxed(val, pcie->base + PCIE_INT_ENABLE_REG);
  
-       val = readl_relaxed(port->base + PCIE_MISC_CTRL_REG);
 +      /* Disable DVFSRC voltage request */
-       writel_relaxed(val, port->base + PCIE_MISC_CTRL_REG);
++      val = readl_relaxed(pcie->base + PCIE_MISC_CTRL_REG);
 +      val |= PCIE_DISABLE_DVFSRC_VLT_REQ;
++      writel_relaxed(val, pcie->base + PCIE_MISC_CTRL_REG);
 +
        /* Assert all reset signals */
-       val = readl_relaxed(port->base + PCIE_RST_CTRL_REG);
+       val = readl_relaxed(pcie->base + PCIE_RST_CTRL_REG);
        val |= PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB;
-       writel_relaxed(val, port->base + PCIE_RST_CTRL_REG);
+       writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG);
  
        /*
 -       * Described in PCIe CEM specification setctions 2.2 (PERST# Signal)
 +       * Described in PCIe CEM specification sections 2.2 (PERST# Signal)
         * and 2.2.1 (Initial Power-Up (G3 to S0)).
         * The deassertion of PERST# should be delayed 100ms (TPVPERL)
         * for the power and clock to become stable.
@@@ -148,7 -148,7 +148,7 @@@ static void __iomem *mt7621_pcie_map_bu
        return pcie->base + RALINK_PCI_CONFIG_DATA + (where & 3);
  }
  
- static struct pci_ops mt7621_pci_ops = {
 -struct pci_ops mt7621_pcie_ops = {
++static struct pci_ops mt7621_pcie_ops = {
        .map_bus        = mt7621_pcie_map_bus,
        .read           = pci_generic_config_read,
        .write          = pci_generic_config_write,
@@@ -550,16 -587,14 +550,16 @@@ static const struct of_device_id mt7621
        { .compatible = "mediatek,mt7621-pci" },
        {},
  };
- MODULE_DEVICE_TABLE(of, mt7621_pci_ids);
+ MODULE_DEVICE_TABLE(of, mt7621_pcie_ids);
  
- static struct platform_driver mt7621_pci_driver = {
-       .probe = mt7621_pci_probe,
-       .remove = mt7621_pci_remove,
+ static struct platform_driver mt7621_pcie_driver = {
+       .probe = mt7621_pcie_probe,
+       .remove = mt7621_pcie_remove,
        .driver = {
                .name = "mt7621-pci",
-               .of_match_table = of_match_ptr(mt7621_pci_ids),
+               .of_match_table = of_match_ptr(mt7621_pcie_ids),
        },
  };
- builtin_platform_driver(mt7621_pci_driver);
+ builtin_platform_driver(mt7621_pcie_driver);
 +
 +MODULE_LICENSE("GPL v2");