Commit 88b8b5b3 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/controller/meson'

- Update DT binding to name DBI region "dbi", not "elbi", and update driver
  to support both (Manivannan Sadhasivam)

* pci/controller/meson:
  PCI: meson: Fix parsing the DBI register region
  dt-bindings: PCI: amlogic: Fix the register name of the DBI region
parents 9563c343 eff0306b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -37,13 +37,13 @@ properties:

  reg:
    items:
      - description: External local bus interface registers
      - description: Data Bus Interface registers
      - description: Meson designed configuration registers
      - description: PCIe configuration space

  reg-names:
    items:
      - const: elbi
      - const: dbi
      - const: cfg
      - const: config

@@ -114,7 +114,7 @@ examples:
    pcie: pcie@f9800000 {
        compatible = "amlogic,axg-pcie", "snps,dw-pcie";
        reg = <0xf9800000 0x400000>, <0xff646000 0x2000>, <0xf9f00000 0x100000>;
        reg-names = "elbi", "cfg", "config";
        reg-names = "dbi", "cfg", "config";
        interrupts = <GIC_SPI 177 IRQ_TYPE_EDGE_RISING>;
        clocks = <&clk_phy>, <&pclk>, <&clk_port>;
        clock-names = "general", "pclk", "port";
+15 −3
Original line number Diff line number Diff line
@@ -108,10 +108,22 @@ static int meson_pcie_get_mems(struct platform_device *pdev,
			       struct meson_pcie *mp)
{
	struct dw_pcie *pci = &mp->pci;
	struct resource *res;

	pci->dbi_base = devm_platform_ioremap_resource_byname(pdev, "elbi");
	if (IS_ERR(pci->dbi_base))
		return PTR_ERR(pci->dbi_base);
	/*
	 * For the broken DTs that supply 'dbi' as 'elbi', parse the 'elbi'
	 * region and assign it to both 'pci->elbi_base' and 'pci->dbi_space' so
	 * that the DWC core can skip parsing both regions.
	 */
	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi");
	if (res) {
		pci->elbi_base = devm_pci_remap_cfg_resource(pci->dev, res);
		if (IS_ERR(pci->elbi_base))
			return PTR_ERR(pci->elbi_base);

		pci->dbi_base = pci->elbi_base;
		pci->dbi_phys_addr = res->start;
	}

	mp->cfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg");
	if (IS_ERR(mp->cfg_base))
+7 −5
Original line number Diff line number Diff line
@@ -168,12 +168,14 @@ int dw_pcie_get_resources(struct dw_pcie *pci)
	}

	/* ELBI is an optional resource */
	if (!pci->elbi_base) {
		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi");
		if (res) {
			pci->elbi_base = devm_ioremap_resource(pci->dev, res);
			if (IS_ERR(pci->elbi_base))
				return PTR_ERR(pci->elbi_base);
		}
	}

	/* LLDD is supposed to manually switch the clocks and resets state */
	if (dw_pcie_cap_is(pci, REQ_RES)) {