Skip to contentSkip to conversation

Altera PCIe host controller driver with MSI support

PATCH Superseded Ley Foon Tan 3 participants 12 messages Oct 22, 2015 – Oct 23, 2015

Subsystems (4)

v11 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v11 cover Altera PCIe host controller driver with MSI support

This is the 11th version of patch set to add support for Altera PCIe host controller with MSI feature on Altera FPGA device families. This patchset mainly resovle the warning/error caught by kbuild test.

Hi Bjorn,
Do you have further comment on this patchset? Any chance this can go into 4.4? Thanks.

This patchset is based on v4.3-rc6.

v10->v11 changes:
- altera-pcie: change altera_pcie_fixups to static function
- Kconfig: add depends on ARM || NIOS2 for PCIE_ALTERA

History:
-------
[v1]: https://lkml.org/lkml/2015/7/28/395
[v2]: https://lkml.org/lkml/2015/7/31/267
[v3]: http://www.kernelhub.org/?msg=811940&p=2
[v4]: https://lkml.org/lkml/2015/8/17/141
[v5]: https://lkml.org/lkml/2015/8/25/238
[v6]: https://lkml.org/lkml/2015/9/1/177
[v7]: https://lkml.org/lkml/2015/9/20/193
[v8]: http://www.kernelhub.org/?msg=853553&p=2
[v9]: https://lkml.org/lkml/2015/10/13/998
[v10]: https://lkml.org/lkml/2015/10/19/139

Ley Foon Tan (6):
arm: add msi.h to Kbuild
pci: add Altera PCI vendor ID
pci:host: Add Altera PCIe host controller driver
pci: altera: Add Altera PCIe MSI driver
Documentation: dt-bindings: pci: altera pcie device tree binding
MAINTAINERS: Add Altera PCIe and MSI drivers maintainer

 .../devicetree/bindings/pci/altera-pcie-msi.txt    |  28 +
 .../devicetree/bindings/pci/altera-pcie.txt        |  49 ++
 MAINTAINERS                                        |  16 +
 arch/arm/include/asm/Kbuild                        |   1 +
 drivers/pci/host/Kconfig                           |  16 +
 drivers/pci/host/Makefile                          |   2 +
 drivers/pci/host/pcie-altera-msi.c                 | 314 +++++++++++
 drivers/pci/host/pcie-altera.c                     | 579 +++++++++++++++++++++
 include/linux/pci_ids.h                            |   2 +
 9 files changed, 1007 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/altera-pcie-msi.txt
 create mode 100644 Documentation/devicetree/bindings/pci/altera-pcie.txt
 create mode 100644 drivers/pci/host/pcie-altera-msi.c
 create mode 100644 drivers/pci/host/pcie-altera.c
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v11 1/6 arm: add msi.h to Kbuild

Include asm-generic/msi.h to support CONFIG_GENERIC_MSI_IRQ_DOMAIN. This to fix compilation error:
"include/linux/msi.h:123:21: fatal error: asm/msi.h:
No such file or directory"

---
 arch/arm/include/asm/Kbuild | 1 +
 1 file changed, 1 insertion(+)
arch/arm/include/asm/Kbuild +1 -0
index be648eb..bd42530 100644
@@ -14,6 +14,7 @@ generic-y += local.h
 generic-y += local64.h
 generic-y += mm-arch-hooks.h
 generic-y += msgbuf.h
+generic-y += msi.h
 generic-y += param.h
 generic-y += parport.h
 generic-y += poll.h
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH v11 2/6 pci: add Altera PCI vendor ID

In reply to Ley Foon Tan
---
 include/linux/pci_ids.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/pci_ids.h +2 -0
index d9ba49c..08e4462 100644
@@ -1550,6 +1550,8 @@
 #define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
 #define PCI_DEVICE_ID_SERVERWORKS_HT1100LD 0x0408
 
+#define PCI_VENDOR_ID_ALTERA		0x1172
+
 #define PCI_VENDOR_ID_SBE		0x1176
 #define PCI_DEVICE_ID_SBE_WANXL100	0x0301
 #define PCI_DEVICE_ID_SBE_WANXL200	0x0302
Signature · 1 line
1.8.2.1
#3 lore raw

Re: [PATCH v11 2/6] pci: add Altera PCI vendor ID

Quoted 10 lines · Ley Foon Tan
---
 include/linux/pci_ids.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/pci_ids.h +0 -0
index d9ba49c..08e4462 100644

include/linux/pci_ids.h line 1554

Quoted 5 lines
include/linux/pci_ids.h +2 -0
@@ -1550,6 +1550,8 @@
 #define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
 #define PCI_DEVICE_ID_SERVERWORKS_HT1100LD 0x0408
 
+#define PCI_VENDOR_ID_ALTERA		0x1172
+

This doesn't seem to be used anywhere, so I'll drop this patch.

Quoted 11 lines
include/linux/pci_ids.h +0 -0
 #define PCI_VENDOR_ID_SBE		0x1176
 #define PCI_DEVICE_ID_SBE_WANXL100	0x0301
 #define PCI_DEVICE_ID_SBE_WANXL200	0x0302
Signature · 7 lines
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#4 lore raw

Re: [PATCH v11 2/6] pci: add Altera PCI vendor ID

Quoted 14 lines · Bjorn Helgaas
Quoted 13 lines · Ley Foon Tan
---
 include/linux/pci_ids.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/pci_ids.h +0 -0
index d9ba49c..08e4462 100644
@@ -1550,6 +1550,8 @@
 #define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
 #define PCI_DEVICE_ID_SERVERWORKS_HT1100LD 0x0408
 
Quoted 4 lines

include/linux/pci_ids.h line 1554

Quoted 2 lines
include/linux/pci_ids.h +2 -0
+#define PCI_VENDOR_ID_ALTERA         0x1172
+

This doesn't seem to be used anywhere, so I'll drop this patch.

Okay.

Thanks.

Regards
Ley Foon

#5 lore raw

PATCH v11 3/6 pci:host: Add Altera PCIe host controller driver

In reply to Ley Foon Tan

This patch adds the Altera PCIe host controller driver.

---
 drivers/pci/host/Kconfig       |   8 +
 drivers/pci/host/Makefile      |   1 +
 drivers/pci/host/pcie-altera.c | 579 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 588 insertions(+)
 create mode 100644 drivers/pci/host/pcie-altera.c
drivers/pci/host/Kconfig +8 -0
index d5e58ba..a67c9de 100644
@@ -145,4 +145,12 @@ config PCIE_IPROC_BCMA
 	  Say Y here if you want to use the Broadcom iProc PCIe controller
 	  through the BCMA bus interface
 
+config PCIE_ALTERA
+	tristate "Altera PCIe controller"
+	depends on ARM || NIOS2
+	select PCI_DOMAINS
+	help
+	  Say Y here if you want to enable PCIe controller support on Altera
+	  FPGA.
+
 endmenu
drivers/pci/host/Makefile +1 -0
index 140d66f..6954f76 100644
@@ -17,3 +17,4 @@ obj-$(CONFIG_PCI_VERSATILE) += pci-versatile.o
 obj-$(CONFIG_PCIE_IPROC) += pcie-iproc.o
 obj-$(CONFIG_PCIE_IPROC_PLATFORM) += pcie-iproc-platform.o
 obj-$(CONFIG_PCIE_IPROC_BCMA) += pcie-iproc-bcma.o
+obj-$(CONFIG_PCIE_ALTERA) += pcie-altera.o
drivers/pci/host/pcie-altera.c new file +579 -0

579 lines not on this page · raw message

Signature · 1 line
1.8.2.1
#6 lore raw

Re: [PATCH v11 3/6] pci:host: Add Altera PCIe host controller driver

Hi Ley,

drivers/pci/host/pcie-altera.c line 123

Quoted 11 lines · Ley Foon Tan

This patch adds the Altera PCIe host controller driver.

drivers/pci/host/pcie-altera.c new file +9 -0
+static void altera_pcie_fixups(struct pci_bus *bus)
+{
+	struct pci_dev *dev;
+
+	list_for_each_entry(dev, &bus->devices, bus_list) {
+		altera_pcie_retrain(dev);
+		altera_pcie_fixup_res(dev);
+	}
+}

I'd really like to avoid this particular fixup because it's done between pci_scan_root_bus() and pci_assign_unassigned_bus_resources() and pci_bus_add_devices(). That path is almost 100% arch-independent, and someday we should be able to pull all that out into one PCI core interface.

You might be able to do the link retrain fixup as a header quirk. That's not really ideal either, but I don't think we have a good mechanism of inserting per-host bridge hooks in the enumeration path. There are some pcibios_*() hooks, but those are per-arch, not per-host bridge, so they're not really what you want here.

I think other host drivers have handled the "prevent enumeration of root complex resources" problem by adding a similar check in the config accessors.

drivers/pci/host/pcie-altera.c line 331

Quoted 2 lines
drivers/pci/host/pcie-altera.c new file +2 -0
+static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn,
+				 int where, int size, u32 value)

This needs a comment to the effect that this hardware can only generate 32-bit config accesses. We also need a printk in the probe routine so there's a note in dmesg so we have a clue that RW1C bits in config space may be corrupted.

Quoted 40 lines
drivers/pci/host/pcie-altera.c new file +39 -0
+{
+	struct altera_pcie *pcie = bus->sysdata;
+	u32 data32;
+	u32 shift = 8 * (where & 3);
+	u8 byte_en;
+
+	if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn)))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	switch (size) {
+	case 1:
+		data32 = (value & 0xff) << shift;
+		byte_en = 1 << (where & 3);
+		break;
+	case 2:
+		data32 = (value & 0xffff) << shift;
+		byte_en = 3 << (where & 3);
+		break;
+	default:
+		data32 = value;
+		byte_en = 0xf;
+		break;
+	}
+
+	return tlp_cfg_dword_write(pcie, bus->number, devfn,
+		(where & ~DWORD_MASK), byte_en, data32);
+}
 
+static void altera_pcie_isr(struct irq_desc *desc)
+{
+	struct irq_chip *chip = irq_desc_get_chip(desc);
+	struct altera_pcie *pcie;
+	unsigned long status;
+	u32 bit;
+	u32 virq;
+
+	chained_irq_enter(chip, desc);
+	pcie = irq_desc_get_handler_data(desc);
+
+	while ((status = cra_readl(pcie, P2A_INT_STATUS)

drivers/pci/host/pcie-altera.c line 399

Quoted 10 lines
drivers/pci/host/pcie-altera.c new file +10 -0
+		& P2A_INT_STS_ALL) != 0) {
+		for_each_set_bit(bit, &status, INTX_NUM) {
+			/* clear interrupts */
+			cra_writel(pcie, 1 << bit, P2A_INT_STATUS);
+
+			virq = irq_find_mapping(pcie->irq_domain, bit + 1);
+			if (virq)
+				generic_handle_irq(virq);
+			else
+				dev_err(&pcie->pdev->dev, "unexpected IRQ\n");

Include the bit number here. A printk string with no % substitutions is rarely as useful as it could be.

Quoted 4 lines

...

drivers/pci/host/pcie-altera.c new file +3 -0
+	bus = pci_scan_root_bus(&pdev->dev, pcie->root_bus_nr, &altera_pcie_ops,
+				pcie, &pcie->resources);
+	if (!bus)

drivers/pci/host/pcie-altera.c line 549

Quoted 10 lines
drivers/pci/host/pcie-altera.c new file +10 -0
+		return -ENOMEM;
+
+	altera_pcie_fixups(bus);
+	pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
+	pci_assign_unassigned_bus_resources(bus);
+	pci_bus_add_devices(bus);
+
+	/* Configure PCI Express setting. */
+	list_for_each_entry(child, &bus->children, node)
+		pcie_bus_configure_settings(child);

This loop should be before pci_bus_add_devices(). When we call pci_bus_add_devices(), drivers may claim devices immediately, and the PCI core shouldn't be changing device configuration while a driver owns the device.

Bjorn

#7 lore raw

Re: [PATCH v11 3/6] pci:host: Add Altera PCIe host controller driver

Quoted 21 lines · Bjorn Helgaas

Hi Ley,

drivers/pci/host/pcie-altera.c line 123

Quoted 11 lines · Ley Foon Tan

This patch adds the Altera PCIe host controller driver.

drivers/pci/host/pcie-altera.c new file +9 -0
+static void altera_pcie_fixups(struct pci_bus *bus)
+{
+     struct pci_dev *dev;
+
+     list_for_each_entry(dev, &bus->devices, bus_list) {
+             altera_pcie_retrain(dev);
+             altera_pcie_fixup_res(dev);
+     }
+}

I'd really like to avoid this particular fixup because it's done between pci_scan_root_bus() and pci_assign_unassigned_bus_resources() and pci_bus_add_devices(). That path is almost 100% arch-independent, and someday we should be able to pull all that out into one PCI core interface.

Quoted 5 lines

You might be able to do the link retrain fixup as a header quirk. That's not really ideal either, but I don't think we have a good mechanism of inserting per-host bridge hooks in the enumeration path. There are some pcibios_*() hooks, but those are per-arch, not per-host bridge, so they're not really what you want here.

Okay, will change the retrain fixup to use *PCI_FIXUP* macro. By doing this, we need [PATCH v11 2/6] pci: add Altera PCI vendor ID patch.

Quoted 4 lines

I think other host drivers have handled the "prevent enumeration of root complex resources" problem by adding a similar check in the config accessors.

Okay, will handle this in config accessors.

Quoted 8 lines

drivers/pci/host/pcie-altera.c line 331

Quoted 3 lines
drivers/pci/host/pcie-altera.c new file +2 -0
+static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn,
+                              int where, int size, u32 value)

This needs a comment to the effect that this hardware can only generate 32-bit config accesses. We also need a printk in the probe routine so there's a note in dmesg so we have a clue that RW1C bits in config space may be corrupted.

I have checked the PCIe/TLP spec, we can use the "First BE" (byte enable) field in TLP packet to write
specific bytes only. And I have update driver to support this "First BE" feature.
So, we don't have corrupted RW1C bit issue now.

Quoted 46 lines
Quoted 46 lines
drivers/pci/host/pcie-altera.c new file +44 -0
+{
+     struct altera_pcie *pcie = bus->sysdata;
+     u32 data32;
+     u32 shift = 8 * (where & 3);
+     u8 byte_en;
+
+     if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn)))
+             return PCIBIOS_DEVICE_NOT_FOUND;
+
+     switch (size) {
+     case 1:
+             data32 = (value & 0xff) << shift;
+             byte_en = 1 << (where & 3);
+             break;
+     case 2:
+             data32 = (value & 0xffff) << shift;
+             byte_en = 3 << (where & 3);
+             break;
+     default:
+             data32 = value;
+             byte_en = 0xf;
+             break;
+     }
+
+     return tlp_cfg_dword_write(pcie, bus->number, devfn,
+             (where & ~DWORD_MASK), byte_en, data32);
+}
 
+static void altera_pcie_isr(struct irq_desc *desc)
+{
+     struct irq_chip *chip = irq_desc_get_chip(desc);
+     struct altera_pcie *pcie;
+     unsigned long status;
+     u32 bit;
+     u32 virq;
+
+     chained_irq_enter(chip, desc);
+     pcie = irq_desc_get_handler_data(desc);
+
+     while ((status = cra_readl(pcie, P2A_INT_STATUS)
+             & P2A_INT_STS_ALL) != 0) {
+             for_each_set_bit(bit, &status, INTX_NUM) {
+                     /* clear interrupts */
+                     cra_writel(pcie, 1 << bit, P2A_INT_STATUS);
+
Quoted 8 lines

drivers/pci/host/pcie-altera.c line 399

Quoted 5 lines
drivers/pci/host/pcie-altera.c new file +5 -0
+                     virq = irq_find_mapping(pcie->irq_domain, bit + 1);
+                     if (virq)
+                             generic_handle_irq(virq);
+                     else
+                             dev_err(&pcie->pdev->dev, "unexpected IRQ\n");

Include the bit number here. A printk string with no % substitutions is rarely as useful as it could be.

Okay.

Quoted 12 lines
Quoted 12 lines

...

drivers/pci/host/pcie-altera.c new file +10 -0
+     bus = pci_scan_root_bus(&pdev->dev, pcie->root_bus_nr, &altera_pcie_ops,
+                             pcie, &pcie->resources);
+     if (!bus)
+             return -ENOMEM;
+
+     altera_pcie_fixups(bus);
+     pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
+     pci_assign_unassigned_bus_resources(bus);
+     pci_bus_add_devices(bus);
+
Quoted 8 lines

drivers/pci/host/pcie-altera.c line 549

Quoted 3 lines
drivers/pci/host/pcie-altera.c new file +3 -0
+     /* Configure PCI Express setting. */
+     list_for_each_entry(child, &bus->children, node)
+             pcie_bus_configure_settings(child);

This loop should be before pci_bus_add_devices(). When we call pci_bus_add_devices(), drivers may claim devices immediately, and the PCI core shouldn't be changing device configuration while a driver owns the device.

Okay, will move this before pci_bus_add_devices().

Thanks.

Regards
Ley Foon

#8 lore raw

PATCH v11 4/6 pci: altera: Add Altera PCIe MSI driver

In reply to Ley Foon Tan

This patch adds Altera PCIe MSI driver. This soft IP supports configurable number of vectors, which is a dts parameter.

---
 drivers/pci/host/Kconfig           |   8 +
 drivers/pci/host/Makefile          |   1 +
 drivers/pci/host/pcie-altera-msi.c | 314 +++++++++++++++++++++++++++++++++++++
 3 files changed, 323 insertions(+)
 create mode 100644 drivers/pci/host/pcie-altera-msi.c
drivers/pci/host/Kconfig +8 -0
index a67c9de..101208f 100644
@@ -153,4 +153,12 @@ config PCIE_ALTERA
 	  Say Y here if you want to enable PCIe controller support on Altera
 	  FPGA.
 
+config PCIE_ALTERA_MSI
+	bool "Altera PCIe MSI feature"
+	depends on PCI_MSI
+	select PCI_MSI_IRQ_DOMAIN
+	help
+	  Say Y here if you want PCIe MSI support for the Altera FPGA.
+	  This MSI driver supports Altera MSI to GIC controller IP.
+
 endmenu
drivers/pci/host/Makefile +1 -0
index 6954f76..6c4913d 100644
@@ -18,3 +18,4 @@ obj-$(CONFIG_PCIE_IPROC) += pcie-iproc.o
 obj-$(CONFIG_PCIE_IPROC_PLATFORM) += pcie-iproc-platform.o
 obj-$(CONFIG_PCIE_IPROC_BCMA) += pcie-iproc-bcma.o
 obj-$(CONFIG_PCIE_ALTERA) += pcie-altera.o
+obj-$(CONFIG_PCIE_ALTERA_MSI) += pcie-altera-msi.o
drivers/pci/host/pcie-altera-msi.c new file +314 -0

314 lines not on this page · raw message

Signature · 1 line
1.8.2.1
#9 lore raw

PATCH v11 5/6 Documentation: dt-bindings: pci: altera pcie device tree binding

In reply to Ley Foon Tan

This patch adds the bindings for Altera PCIe host controller driver and Altera PCIe MSI driver.

---
 .../devicetree/bindings/pci/altera-pcie-msi.txt    | 28 +++++++++++++
 .../devicetree/bindings/pci/altera-pcie.txt        | 49 ++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/altera-pcie-msi.txt
 create mode 100644 Documentation/devicetree/bindings/pci/altera-pcie.txt
Documentation/devicetree/bindings/pci/altera-pcie-msi.txt new file +28 -0
new file mode 100644
index 0000000..09cd3bc
@@ -0,0 +1,28 @@
+* Altera PCIe MSI controller
+
+Required properties:
+- compatible:	should contain "altr,msi-1.0"
+- reg:		specifies the physical base address of the controller and
+		the length of the memory mapped region.
+- reg-names:	must include the following entries:
+		"csr": CSR registers
+		"vector_slave": vectors slave port region
+- interrupt-parent:	interrupt source phandle.
+- interrupts:	specifies the interrupt source of the parent interrupt
+		controller. The format of the interrupt specifier depends on the
+		parent interrupt controller.
+- num-vectors:	number of vectors, range 1 to 32.
+- msi-controller:	indicates that this is MSI controller node
+
+
+Example
+msi0: msi at 0xFF200000 {
+	compatible = "altr,msi-1.0";
+	reg = <0xFF200000 0x00000010
+		0xFF200010 0x00000080>;
+	reg-names = "csr", "vector_slave";
+	interrupt-parent = <&hps_0_arm_gic_0>;
+	interrupts = <0 42 4>;
+	msi-controller;
+	num-vectors = <32>;
+};
Documentation/devicetree/bindings/pci/altera-pcie.txt new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
1.8.2.1
Acked-by on v11 5/6
#10 lore raw

Re: [PATCH v11 5/6] Documentation: dt-bindings: pci: altera pcie device tree binding

Quoted 4 lines · Ley Foon Tan

This patch adds the bindings for Altera PCIe host controller driver and Altera PCIe MSI driver.

Quoted 99 lines
---
 .../devicetree/bindings/pci/altera-pcie-msi.txt    | 28 +++++++++++++
 .../devicetree/bindings/pci/altera-pcie.txt        | 49 ++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/altera-pcie-msi.txt
 create mode 100644 Documentation/devicetree/bindings/pci/altera-pcie.txt
Documentation/devicetree/bindings/pci/altera-pcie-msi.txt new file +28 -0
new file mode 100644
index 0000000..09cd3bc
@@ -0,0 +1,28 @@
+* Altera PCIe MSI controller
+
+Required properties:
+- compatible:  should contain "altr,msi-1.0"
+- reg:         specifies the physical base address of the controller and
+               the length of the memory mapped region.
+- reg-names:   must include the following entries:
+               "csr": CSR registers
+               "vector_slave": vectors slave port region
+- interrupt-parent:    interrupt source phandle.
+- interrupts:  specifies the interrupt source of the parent interrupt
+               controller. The format of the interrupt specifier depends on the
+               parent interrupt controller.
+- num-vectors: number of vectors, range 1 to 32.
+- msi-controller:      indicates that this is MSI controller node
+
+
+Example
+msi0: msi at 0xFF200000 {
+       compatible = "altr,msi-1.0";
+       reg = <0xFF200000 0x00000010
+               0xFF200010 0x00000080>;
+       reg-names = "csr", "vector_slave";
+       interrupt-parent = <&hps_0_arm_gic_0>;
+       interrupts = <0 42 4>;
+       msi-controller;
+       num-vectors = <32>;
+};
Documentation/devicetree/bindings/pci/altera-pcie.txt new file +49 -1
new file mode 100644
index 0000000..2951a6a
@@ -0,0 +1,49 @@
+* Altera PCIe controller
+
+Required properties:
+- compatible : should contain "altr,pcie-root-port-1.0"
+- reg:         a list of physical base address and length for TXS and CRA.
+- reg-names:   must include the following entries:
+               "Txs": TX slave port region
+               "Cra": Control register access region
+- interrupt-parent:    interrupt source phandle.
+- interrupts:  specifies the interrupt source of the parent interrupt controller.
+               The format of the interrupt specifier depends on the parent interrupt
+               controller.
+- device_type: must be "pci"
+- #address-cells:      set to <3>
+- #size-cells: set to <2>
+- #interrupt-cells:    set to <1>
+- ranges:              describes the translation of addresses for root ports and standard
+               PCI regions.
+- interrupt-map-mask and interrupt-map: standard PCI properties to define the
+               mapping of the PCIe interface to interrupt numbers.
+
+Optional properties:
+- msi-parent:  Link to the hardware entity that serves as the MSI controller for this PCIe
+               controller.
+- bus-range:   PCI bus numbers covered
+
+Example
+       pcie_0: pcie at 0xc00000000 {
+               compatible = "altr,pcie-root-port-1.0";
+               reg = <0xc0000000 0x20000000>,
+                       <0xff220000 0x00004000>;
+               reg-names = "Txs", "Cra";
+               interrupt-parent = <&hps_0_arm_gic_0>;
+               interrupts = <0 40 4>;
+               interrupt-controller;
+               #interrupt-cells = <1>;
+               bus-range = <0x0 0xFF>;
+               device_type = "pci";
+               msi-parent = <&msi_to_gic_gen_0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               interrupt-map-mask = <0 0 0 7>;
+               interrupt-map = <0 0 0 1 &pcie_0 1>,
+                                   <0 0 0 2 &pcie_0 2>,
+                                   <0 0 0 3 &pcie_0 3>,
+                                   <0 0 0 4 &pcie_0 4>;
+               ranges = <0x82000000 0x00000000 0x00000000 0xc0000000 0x00000000 0x10000000
+                           0x82000000 0x00000000 0x10000000 0xd0000000 0x00000000 0x10000000>;
+       };
--

1.8.2.1

#11 lore raw

PATCH v11 6/6 MAINTAINERS: Add Altera PCIe and MSI drivers maintainer

In reply to Ley Foon Tan
---
 MAINTAINERS | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
MAINTAINERS +16 -0
index b8577ad9..96b9fac 100644
@@ -7958,6 +7958,14 @@ F:	include/linux/pci*
 F:	arch/x86/pci/
 F:	arch/x86/kernel/quirks.c
 
+PCI DRIVER FOR ALTERA PCIE IP
+M:	Ley Foon Tan <[email protected]>
+L:	rfi at lists.rocketboards.org (moderated for non-subscribers)
+L:	linux-pci at vger.kernel.org
+S:	Supported
+F:	Documentation/devicetree/bindings/pci/altera-pcie.txt
+F:	drivers/pci/host/pcie-altera.c
+
 PCI DRIVER FOR ARM VERSATILE PLATFORM
 M:	Rob Herring <[email protected]>
 L:	linux-pci at vger.kernel.org
@@ -8059,6 +8067,14 @@ L:	linux-pci at vger.kernel.org
 S:	Maintained
 F:	drivers/pci/host/*spear*
 
+PCI MSI DRIVER FOR ALTERA MSI IP
+M:	Ley Foon Tan <[email protected]>
+L:	rfi at lists.rocketboards.org (moderated for non-subscribers)
+L:	linux-pci at vger.kernel.org
+S:	Supported
+F:	Documentation/devicetree/bindings/pci/altera-pcie-msi.txt
+F:	drivers/pci/host/pcie-altera-msi.c
+
 PCI MSI DRIVER FOR APPLIEDMICRO XGENE
 M:	Duc Dang <[email protected]>
 L:	linux-pci at vger.kernel.org
Signature · 1 line
1.8.2.1