Skip to contentSkip to conversation

Versatile PCI host DT support

PATCH Applied Rob Herring 3 participants 6 messages Jan 28, 2015 – Jan 29, 2015

Subsystems (3)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

v2 cover Versatile PCI host DT support

I'm not going to get the rest of the Versatile series wrapped up for 3.20, but I think the PCI support is ready and would like to get it in.

I have not fixed the resource registration for /proc/iomem and irq fixup as those issues are being worked on for a common fix.

Bjorn, Can you please take the whole series unless you prefer arm-soc to.

v2:
- Added MAINTAINERS entry
- Based on generic PCI config accessors
- Module license fix
- Comment whitespace fix

Rob

Rob Herring (3):
dt/bindings: add versatile PCI binding
dts: versatile: add PCI controller binding
PCI: add DT based ARM Versatile PCI host driver

 .../devicetree/bindings/pci/versatile.txt          |  59 +++++
 MAINTAINERS                                        |   8 +
 arch/arm/boot/dts/versatile-pb.dts                 |  37 ++++
 drivers/pci/host/Kconfig                           |   4 +
 drivers/pci/host/Makefile                          |   1 +
 drivers/pci/host/pci-versatile.c                   | 237 +++++++++++++++++++++
 6 files changed, 346 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/versatile.txt
 create mode 100644 drivers/pci/host/pci-versatile.c
Signature · 1 line
2.1.0
author maintainer
#1 lore raw

PATCH v2 1/3 dt/bindings: add versatile PCI binding

Add binding documentation for the PCI controller found on Versatile PB boards.

Cc Linus Walleij <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Kumar Gala <[email protected]>
---
 .../devicetree/bindings/pci/versatile.txt          | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/versatile.txt
Documentation/devicetree/bindings/pci/versatile.txt new file +59 -0
new file mode 100644
index 0000000..2cc6071
@@ -0,0 +1,59 @@
+* ARM Versatile Platform Baseboard PCI interface
+
+PCI host controller found on the ARM Versatile PB board's FPGA.
+
+Required properties:
+- compatible: should contain "arm,versatile-pci" to identify the Versatile PCI
+  controller.
+- reg: base addresses and lengths of the pci controller. There must be 3
+  entries:
+	- Versatile specific registers
+	- Self Config space
+	- Config space
+- #address-cells: set to <3>
+- #size-cells: set to <2>
+- device_type: set to "pci"
+- bus-range: set to <0 0xff>
+- ranges: ranges for the PCI memory and I/O regions
+- #interrupt-cells: set to <1>
+- interrupt-map-mask and interrupt-map: standard PCI properties	to define
+	the mapping of the PCI interface to interrupt numbers.
+
+Example:
+
+pci-controller@10001000 {
+	compatible = "arm,versatile-pci";
+	device_type = "pci";
+	reg = <0x10001000 0x1000
+	       0x41000000 0x10000
+	       0x42000000 0x100000>;
+	bus-range = <0 0xff>;
+	#address-cells = <3>;
+	#size-cells = <2>;
+	#interrupt-cells = <1>;
+
+	ranges = <0x01000000 0 0x00000000 0x43000000 0 0x00010000   /* downstream I/O */
+		  0x02000000 0 0x50000000 0x50000000 0 0x10000000   /* non-prefetchable memory */
+		  0x42000000 0 0x60000000 0x60000000 0 0x10000000>; /* prefetchable memory */
+
+	interrupt-map-mask = <0x1800 0 0 7>;
+	interrupt-map = <0x1800 0 0 1 &sic 28
+			 0x1800 0 0 2 &sic 29
+			 0x1800 0 0 3 &sic 30
+			 0x1800 0 0 4 &sic 27
+
+			 0x1000 0 0 1 &sic 27
+			 0x1000 0 0 2 &sic 28
+			 0x1000 0 0 3 &sic 29
+			 0x1000 0 0 4 &sic 30
+
+			 0x0800 0 0 1 &sic 30
+			 0x0800 0 0 2 &sic 27
+			 0x0800 0 0 3 &sic 28
+			 0x0800 0 0 4 &sic 29
+
+			 0x0000 0 0 1 &sic 29
+			 0x0000 0 0 2 &sic 30
+			 0x0000 0 0 3 &sic 27
+			 0x0000 0 0 4 &sic 28>;
+};
Signature · 1 line
2.1.0
author maintainer
#2 lore raw

PATCH v2 2/3 dts: versatile: add PCI controller binding

In reply to Rob Herring

Add the PCI controller node for the Versatile/PB board.

Cc Russell King <[email protected]>
Cc Linus Walleij <[email protected]>
---
 arch/arm/boot/dts/versatile-pb.dts | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm/boot/dts/versatile-pb.dts +37 -0
index e36c1e8..b83137f 100644
@@ -29,6 +29,43 @@
 			clock-names = "apb_pclk";
 		};
 
+		pci-controller@10001000 {
+			compatible = "arm,versatile-pci";
+			device_type = "pci";
+			reg = <0x10001000 0x1000
+			       0x41000000 0x10000
+			       0x42000000 0x100000>;
+			bus-range = <0 0xff>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+
+			ranges = <0x01000000 0 0x00000000 0x43000000 0 0x00010000   /* downstream I/O */
+				  0x02000000 0 0x50000000 0x50000000 0 0x10000000   /* non-prefetchable memory */
+				  0x42000000 0 0x60000000 0x60000000 0 0x10000000>; /* prefetchable memory */
+
+			interrupt-map-mask = <0x1800 0 0 7>;
+			interrupt-map = <0x1800 0 0 1 &sic 28
+					 0x1800 0 0 2 &sic 29
+					 0x1800 0 0 3 &sic 30
+					 0x1800 0 0 4 &sic 27
+
+					 0x1000 0 0 1 &sic 27
+					 0x1000 0 0 2 &sic 28
+					 0x1000 0 0 3 &sic 29
+					 0x1000 0 0 4 &sic 30
+
+					 0x0800 0 0 1 &sic 30
+					 0x0800 0 0 2 &sic 27
+					 0x0800 0 0 3 &sic 28
+					 0x0800 0 0 4 &sic 29
+
+					 0x0000 0 0 1 &sic 29
+					 0x0000 0 0 2 &sic 30
+					 0x0000 0 0 3 &sic 27
+					 0x0000 0 0 4 &sic 28>;
+		};
+
 		fpga {
 			uart@9000 {
 				compatible = "arm,pl011", "arm,primecell";
Signature · 1 line
2.1.0
maintainer Applied
#3 lore raw
In reply to Rob Herring
Quoted 8 lines · Rob Herring

I'm not going to get the rest of the Versatile series wrapped up for 3.20, but I think the PCI support is ready and would like to get it in.

I have not fixed the resource registration for /proc/iomem and irq fixup as those issues are being worked on for a common fix.

Bjorn, Can you please take the whole series unless you prefer arm-soc to.

Applied to pci/host-versatile for v3.20, thanks!

Quoted 26 lines

v2:
- Added MAINTAINERS entry
- Based on generic PCI config accessors
- Module license fix
- Comment whitespace fix

Rob

Rob Herring (3):
dt/bindings: add versatile PCI binding
dts: versatile: add PCI controller binding
PCI: add DT based ARM Versatile PCI host driver

 .../devicetree/bindings/pci/versatile.txt          |  59 +++++
 MAINTAINERS                                        |   8 +
 arch/arm/boot/dts/versatile-pb.dts                 |  37 ++++
 drivers/pci/host/Kconfig                           |   4 +
 drivers/pci/host/Makefile                          |   1 +
 drivers/pci/host/pci-versatile.c                   | 237 +++++++++++++++++++++
 6 files changed, 346 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/versatile.txt
 create mode 100644 drivers/pci/host/pci-versatile.c
Signature · 1 line
2.1.0
author maintainer
#4 lore raw

PATCH v2 3/3 PCI: add DT based ARM Versatile PCI host driver

In reply to Rob Herring

This converts the Versatile PCI host code to a platform driver using the commom DT parsing and setup. The driver uses only an empty ARM pci_sys_data struct and does not use pci_common_init_dev init function. The old host code will be removed in a subsequent commit when Versatile is completely converted to DT.

I've tested this on QEMU with the sym53c8xx driver in both i/o and memory mapped modes.

---
 MAINTAINERS                      |   8 ++
 drivers/pci/host/Kconfig         |   4 +
 drivers/pci/host/Makefile        |   1 +
 drivers/pci/host/pci-versatile.c | 237 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 250 insertions(+)
 create mode 100644 drivers/pci/host/pci-versatile.c
MAINTAINERS +8 -0
index 2fa3853..9237079 100644
@@ -7220,6 +7220,14 @@ F:	include/linux/pci*
 F:	arch/x86/pci/
 F:	arch/x86/kernel/quirks.c
 
+PCI DRIVER FOR ARM VERSATILE PLATFORM
+M:	Rob Herring <[email protected]>
+L:	[email protected]
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/pci/versatile.txt
+F:	drivers/pci/host/pci-versatile.c
+
 PCI DRIVER FOR APPLIEDMICRO XGENE
 M:	Tanmay Inamdar <[email protected]>
 L:	[email protected]
drivers/pci/host/Kconfig +4 -0
index c4b6568..7b892a9 100644
@@ -102,4 +102,8 @@ config PCI_LAYERSCAPE
 	help
 	  Say Y here if you want PCIe controller support on Layerscape SoCs.
 
+config PCI_VERSATILE
+	bool "ARM Versatile PB PCI controller"
+	depends on ARCH_VERSATILE
+
 endmenu
drivers/pci/host/Makefile +1 -0
index 44c2699..e61d91c 100644
@@ -12,3 +12,4 @@ obj-$(CONFIG_PCI_KEYSTONE) += pci-keystone-dw.o pci-keystone.o
 obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx.o
 obj-$(CONFIG_PCI_XGENE) += pci-xgene.o
 obj-$(CONFIG_PCI_LAYERSCAPE) += pci-layerscape.o
+obj-$(CONFIG_PCI_VERSATILE) += pci-versatile.o
drivers/pci/host/pci-versatile.c new file +237 -0

237 lines not on this page · raw message

Signature · 1 line
2.1.0