Skip to contentSkip to conversation

Altera PCIe host controller driver with MSI support

PATCH Superseded Ley Foon Tan 2 participants 15 messages Oct 14, 2015 – Oct 16, 2015

Subsystems (4)

v9 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v9 cover Altera PCIe host controller driver with MSI support

This is the 9th version of patch set to add support for Altera PCIe host controller with MSI feature on Altera FPGA device families. This patchset mainly update the config read and write functions to support read/write specific bytes to avoid read-modify-write and minor fixes.

This patchset is based on v4.3-rc5.

v8->v9 changes:
- altera-pcie-msi: fix missing mutex_unlock when error return
- altera-pcie: update config read and write functions to support read/write specific bytes

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

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                           |  15 +
 drivers/pci/host/Makefile                          |   2 +
 drivers/pci/host/pcie-altera-msi.c                 | 313 +++++++++++
 drivers/pci/host/pcie-altera.c                     | 592 +++++++++++++++++++++
 include/linux/pci_ids.h                            |   2 +
 9 files changed, 1018 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 v9 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 v9 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

PATCH v9 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       |   7 +
 drivers/pci/host/Makefile      |   1 +
 drivers/pci/host/pcie-altera.c | 592 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 600 insertions(+)
 create mode 100644 drivers/pci/host/pcie-altera.c
drivers/pci/host/Kconfig +7 -0
index d5e58ba..f956206 100644
@@ -145,4 +145,11 @@ 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
+	bool "Altera PCIe controller"
+	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 +592 -0

592 lines not on this page · raw message

Signature · 1 line
1.8.2.1
#4 lore raw

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

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

Quoted 8 lines · On Wednesday 14 October 2015 10:41:29 Ley Foon Tan wrote:
drivers/pci/host/pcie-altera.c new file +8 -0
+static int altera_pcie_remove(struct platform_device *pdev)
+{
+	struct altera_pcie *pcie = platform_get_drvdata(pdev);
+
+	altera_pcie_free_irq_domain(pcie);
+	platform_set_drvdata(pdev, NULL);
+	return 0;
+}

I just noticed this. Does it actually work to unload the module and tear down all the pci_dev structures in a safe way?

Arnd

#5 lore raw

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

Quoted 12 lines · Arnd Bergmann

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

Quoted 8 lines · On Wednesday 14 October 2015 10:41:29 Ley Foon Tan wrote:
drivers/pci/host/pcie-altera.c new file +8 -0
+static int altera_pcie_remove(struct platform_device *pdev)
+{
+     struct altera_pcie *pcie = platform_get_drvdata(pdev);
+
+     altera_pcie_free_irq_domain(pcie);
+     platform_set_drvdata(pdev, NULL);
+     return 0;
+}

I just noticed this. Does it actually work to unload the module and tear down all the pci_dev structures in a safe way?

Good catch. It only can be compiled as builtin-moduley now, so we can remove this _remove callback function.
Thanks.

Regards
Ley Foon

#6 lore raw

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

Quoted 13 lines · On Wednesday 14 October 2015 16:32:25 Ley Foon Tan wrote:
Quoted 12 lines · Arnd Bergmann

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

Quoted 8 lines · On Wednesday 14 October 2015 10:41:29 Ley Foon Tan wrote:
drivers/pci/host/pcie-altera.c new file +8 -0
+static int altera_pcie_remove(struct platform_device *pdev)
+{
+     struct altera_pcie *pcie = platform_get_drvdata(pdev);
+
+     altera_pcie_free_irq_domain(pcie);
+     platform_set_drvdata(pdev, NULL);
+     return 0;
+}

I just noticed this. Does it actually work to unload the module and tear down all the pci_dev structures in a safe way?

Quoted 2 lines

Good catch. It only can be compiled as builtin-moduley now, so we can remove this _remove callback function.

I think we should change both: make it possible to load the driver dynamically, and remove the altera_pcie_remove function.

You can prevent the module from being unloaded if you also remove the module_platform_driver() directive and add a module_init() without a matching module_exit().

Please also add a '.suppress_bind_attrs = true,' flag in the driver struct to prevent manual unbinding.

Arnd

#7 lore raw

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

Quoted 14 lines · Arnd Bergmann
Quoted 13 lines · On Wednesday 14 October 2015 16:32:25 Ley Foon Tan wrote:
Quoted 12 lines · Arnd Bergmann

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

Quoted 8 lines · On Wednesday 14 October 2015 10:41:29 Ley Foon Tan wrote:
drivers/pci/host/pcie-altera.c new file +8 -0
+static int altera_pcie_remove(struct platform_device *pdev)
+{
+     struct altera_pcie *pcie = platform_get_drvdata(pdev);
+
+     altera_pcie_free_irq_domain(pcie);
+     platform_set_drvdata(pdev, NULL);
+     return 0;
+}

I just noticed this. Does it actually work to unload the module and tear down all the pci_dev structures in a safe way?

Quoted 5 lines
Quoted 2 lines

Good catch. It only can be compiled as builtin-moduley now, so we can remove this _remove callback function.

I think we should change both: make it possible to load the driver dynamically, and remove the altera_pcie_remove function.

This driver depends on the pci fixups to work correctly. But, fixups callback functions in this driver are not being call if the driver is loadable module.
The linker script keeps all pci fixup callbacks in pci fixup regions during kernel compile time. So, it needs to be builtin module. Do you know any way we can update those fixup regions?

Quoted 7 lines

You can prevent the module from being unloaded if you also remove the module_platform_driver() directive and add a module_init() without a matching module_exit().

Please also add a '.suppress_bind_attrs = true,' flag in the driver struct to prevent manual unbinding.

I think we don't need these if it only can work as builtin module.

Thanks for reviewing.

Regards
Ley Foon

#8 lore raw

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

Quoted 15 lines · On Wednesday 14 October 2015 17:28:45 Ley Foon Tan wrote:
Quoted 14 lines · Arnd Bergmann
Quoted 13 lines · On Wednesday 14 October 2015 16:32:25 Ley Foon Tan wrote:
Quoted 12 lines · Arnd Bergmann

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

Quoted 8 lines · On Wednesday 14 October 2015 10:41:29 Ley Foon Tan wrote:
drivers/pci/host/pcie-altera.c new file +8 -0
+static int altera_pcie_remove(struct platform_device *pdev)
+{
+     struct altera_pcie *pcie = platform_get_drvdata(pdev);
+
+     altera_pcie_free_irq_domain(pcie);
+     platform_set_drvdata(pdev, NULL);
+     return 0;
+}

I just noticed this. Does it actually work to unload the module and tear down all the pci_dev structures in a safe way?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Good catch. It only can be compiled as builtin-moduley now, so we can remove this _remove callback function.

I think we should change both: make it possible to load the driver dynamically, and remove the altera_pcie_remove function.

This driver depends on the pci fixups to work correctly. But, fixups callback functions in this driver are not being call if the driver is loadable module.

Ah, I see. We should find a better way to deal with this, as we are getting an increasing number of host driver specific fixups.

Bjorn, do you have any idea here?

Could we perhaps have a helper function that lets us register fixups dynamically?

Quoted 3 lines

The linker script keeps all pci fixup callbacks in pci fixup regions during kernel compile time. So, it needs to be builtin module. Do you know any way we can update those fixup regions?

The only method I'm aware of at the moment is move the fixups to drivers/pci/quirks.c and enclose them in an #ifdef if you want them to not appear in kernels that don't support your SoC.

Quoted 7 lines
Quoted 6 lines

You can prevent the module from being unloaded if you also remove the module_platform_driver() directive and add a module_init() without a matching module_exit().

Please also add a '.suppress_bind_attrs = true,' flag in the driver struct to prevent manual unbinding.

I think we don't need these if it only can work as builtin module.

No, this is orthogonal, you need it either way, as built-in drivers can still be unbound by writing to sysfs. Try writing the device name to /sys/bus/platform/drivers/altera-pcie/unbind and watch it blow up ;-)

Arnd

#9 lore raw

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

Quoted 33 lines · Arnd Bergmann
Quoted 15 lines · On Wednesday 14 October 2015 17:28:45 Ley Foon Tan wrote:
Quoted 14 lines · Arnd Bergmann
Quoted 13 lines · On Wednesday 14 October 2015 16:32:25 Ley Foon Tan wrote:
Quoted 12 lines · Arnd Bergmann

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

Quoted 8 lines · On Wednesday 14 October 2015 10:41:29 Ley Foon Tan wrote:
drivers/pci/host/pcie-altera.c new file +8 -0
+static int altera_pcie_remove(struct platform_device *pdev)
+{
+     struct altera_pcie *pcie = platform_get_drvdata(pdev);
+
+     altera_pcie_free_irq_domain(pcie);
+     platform_set_drvdata(pdev, NULL);
+     return 0;
+}

I just noticed this. Does it actually work to unload the module and tear down all the pci_dev structures in a safe way?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Good catch. It only can be compiled as builtin-moduley now, so we can remove this _remove callback function.

I think we should change both: make it possible to load the driver dynamically, and remove the altera_pcie_remove function.

This driver depends on the pci fixups to work correctly. But, fixups callback functions in this driver are not being call if the driver is loadable module.

Ah, I see. We should find a better way to deal with this, as we are getting an increasing number of host driver specific fixups.

Bjorn, do you have any idea here?

Could we perhaps have a helper function that lets us register fixups dynamically?

Quoted 7 lines
Quoted 3 lines

The linker script keeps all pci fixup callbacks in pci fixup regions during kernel compile time. So, it needs to be builtin module. Do you know any way we can update those fixup regions?

The only method I'm aware of at the moment is move the fixups to drivers/pci/quirks.c and enclose them in an #ifdef if you want them to not appear in kernels that don't support your SoC.

By looking at the drivers/pci/quirks.c, it looks like it is mainly for the pci endpoint devices.
Fixups for host controller are in the driver itself.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

You can prevent the module from being unloaded if you also remove the module_platform_driver() directive and add a module_init() without a matching module_exit().

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

Please also add a '.suppress_bind_attrs = true,' flag in the driver struct to prevent manual unbinding.

I think we don't need these if it only can work as builtin module.

No, this is orthogonal, you need it either way, as built-in drivers can still be unbound by writing to sysfs. Try writing the device name to /sys/bus/platform/drivers/altera-pcie/unbind and watch it blow up ;-)

Oh I see. Will update with your suggestion.

Thanks.

Regards
Ley Foon

#10 lore raw

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

Quoted 11 lines · On Wednesday 14 October 2015 18:01:46 Ley Foon Tan wrote:
Quoted 10 lines · Arnd Bergmann
Quoted 1 line · On Wednesday 14 October 2015 17:28:45 Ley Foon Tan wrote:

On Wed, Oct 14, 2015 at 5:09 PM, Arnd Bergmann <[email protected]> wrote:

Could we perhaps have a helper function that lets us register fixups dynamically?

Quoted 3 lines

The linker script keeps all pci fixup callbacks in pci fixup regions during kernel compile time. So, it needs to be builtin module. Do you know any way we can update those fixup regions?

Quoted 7 lines
Quoted 3 lines

The only method I'm aware of at the moment is move the fixups to drivers/pci/quirks.c and enclose them in an #ifdef if you want them to not appear in kernels that don't support your SoC.

By looking at the drivers/pci/quirks.c, it looks like it is mainly for the pci endpoint devices.
Fixups for host controller are in the driver itself.

But if it's for the host itself, there are usually other ways to do this without needing a fixup: you already have the device structure present in the driver, so you should just be able to modify it there.

I'm looking at the code in your fixups now:

+static void altera_pcie_retrain(struct pci_dev *dev) +{
+ u16 linkcap, linkstat;
+
+ /*

+        * Set the retrain bit if the PCIe rootport support > 2.5GB/s, but
+        * current speed is 2.5 GB/s.
+        */

+ pcie_capability_read_word(dev, PCI_EXP_LNKCAP, &linkcap);
+
+ if ((linkcap & PCI_EXP_LNKCAP_SLS) <= PCI_EXP_LNKCAP_SLS_2_5GB)
+ return;
+
+ pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &linkstat);
+ if ((linkstat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB)
+ pcie_capability_set_word(dev, PCI_EXP_LNKCTL,
+ PCI_EXP_LNKCTL_RL);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ALTERA, PCI_ANY_ID, altera_pcie_retrain);

This looks related to the code in pci_set_bus_speed(). What is missing from that code?

+static void altera_pcie_fixup_res(struct pci_dev *dev) +{
+ /*
+ * Prevent enumeration of root port.
+ */
+ if (!dev->bus->parent && dev->devfn == 0) {
+ int i;
+
+ for (i = 0; i < PCI_NUM_RESOURCES; i++) {

+                       dev->resource[i].start = 0;
+                       dev->resource[i].end   = 0;
+                       dev->resource[i].flags   = 0;

+ }
+ }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ALTERA, PCI_ANY_ID,
+ altera_pcie_fixup_res);

This seems really odd, too. Why is this needed? I think I've seen similar code in other host drivers, so it might be time to teach the PCI core about this kind of device.

Arnd

#11 lore raw

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

Quoted 15 lines · Arnd Bergmann
Quoted 14 lines · On Wednesday 14 October 2015 18:01:46 Ley Foon Tan wrote:
Quoted 13 lines · Arnd Bergmann
Quoted 1 line · On Wednesday 14 October 2015 17:28:45 Ley Foon Tan wrote:

On Wed, Oct 14, 2015 at 5:09 PM, Arnd Bergmann <[email protected]> wrote:

Could we perhaps have a helper function that lets us register fixups dynamically?

Quoted 3 lines

The linker script keeps all pci fixup callbacks in pci fixup regions during kernel compile time. So, it needs to be builtin module. Do you know any way we can update those fixup regions?

The only method I'm aware of at the moment is move the fixups to drivers/pci/quirks.c and enclose them in an #ifdef if you want them to not appear in kernels that don't support your SoC.

Quoted 8 lines
Quoted 4 lines

By looking at the drivers/pci/quirks.c, it looks like it is mainly for the pci endpoint devices.
Fixups for host controller are in the driver itself.

But if it's for the host itself, there are usually other ways to do this without needing a fixup: you already have the device structure present in the driver, so you should just be able to modify it there.

Thanks for your suggestion. You are right, I have tested this can work as well. So, I can remove those 2 PCI_FIXUP* in the driver.

Quoted 24 lines

I'm looking at the code in your fixups now:

(quoted diff) +19 -0
+static void altera_pcie_retrain(struct pci_dev *dev)
+{
+       u16 linkcap, linkstat;
+
+       /*
+        * Set the retrain bit if the PCIe rootport support > 2.5GB/s, but
+        * current speed is 2.5 GB/s.
+        */
+       pcie_capability_read_word(dev, PCI_EXP_LNKCAP, &linkcap);
+
+       if ((linkcap & PCI_EXP_LNKCAP_SLS) <= PCI_EXP_LNKCAP_SLS_2_5GB)
+               return;
+
+       pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &linkstat);
+       if ((linkstat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB)
+               pcie_capability_set_word(dev, PCI_EXP_LNKCTL,
+                                        PCI_EXP_LNKCTL_RL);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ALTERA, PCI_ANY_ID, altera_pcie_retrain);
Quoted 2 lines

This looks related to the code in pci_set_bus_speed(). What is missing from that code?

This fixup is different from pci_set_bus_speed(). This fixup is to set the retrain bit in the LNKCTL register if the host can support higher speed than current speed, this is required by our hardware. But, pci_set_bus_speed() is just read the LNKCAP and LNKSTA registers and store in data structure.

Quoted 19 lines
(quoted diff) +17 -0
+static void altera_pcie_fixup_res(struct pci_dev *dev)
+{
+       /*
+        * Prevent enumeration of root port.
+        */
+       if (!dev->bus->parent && dev->devfn == 0) {
+               int i;
+
+               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
+                       dev->resource[i].start = 0;
+                       dev->resource[i].end   = 0;
+                       dev->resource[i].flags   = 0;
+               }
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ALTERA, PCI_ANY_ID,
+                        altera_pcie_fixup_res);
Quoted 4 lines

This seems really odd, too. Why is this needed? I think I've seen similar code in other host drivers, so it might be time to teach the PCI core about this kind of device.

Yes, some host drivers have similar code as well. Some host controller have the BAR configuration enabled, but it doesn't fit to kernel resources. Example the BAR is 64-bit, but the processor is 32-bit. It will fail at the host driver probing stage.

pci 0000:00:00.0: BAR 0: [mem 0x00000000-0xffffffff 64bit pref] has bogus alignment

Regards
Ley Foon

#12 lore raw

PATCH v9 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 | 313 +++++++++++++++++++++++++++++++++++++
 3 files changed, 322 insertions(+)
 create mode 100644 drivers/pci/host/pcie-altera-msi.c
drivers/pci/host/Kconfig +8 -0
index f956206..56daa1e 100644
@@ -152,4 +152,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 +313 -0

313 lines not on this page · raw message

Signature · 1 line
1.8.2.1
#13 lore raw

PATCH v9 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
#14 lore raw

PATCH v9 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 5f46784..0f55f38 100644
@@ -7943,6 +7943,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
@@ -8044,6 +8052,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