Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae03e7c4 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branches 'pci/host-generic' and 'pci/host-versatile' into next

* pci/host-generic:
  of/pci: Free resources on failure in of_pci_get_host_bridge_resources()

* pci/host-versatile:
  PCI: versatile: Add DT-based ARM Versatile PB PCIe host driver
  ARM: dts: versatile: add PCI controller binding
  PCI: versatile: Add DT docs for ARM Versatile PB PCIe driver
Loading
Loading
Loading
Loading
+59 −0
Original line number Diff line number Diff line
* 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>;
};
+8 −0
Original line number Diff line number Diff line
@@ -7210,6 +7210,14 @@ F: include/linux/pci*
F:	arch/x86/pci/
F:	arch/x86/kernel/quirks.c

PCI DRIVER FOR ARM VERSATILE PLATFORM
M:	Rob Herring <robh@kernel.org>
L:	linux-pci@vger.kernel.org
L:	linux-arm-kernel@lists.infradead.org
S:	Maintained
F:	Documentation/devicetree/bindings/pci/versatile.txt
F:	drivers/pci/host/pci-versatile.c

PCI DRIVER FOR APPLIEDMICRO XGENE
M:	Tanmay Inamdar <tinamdar@apm.com>
L:	linux-pci@vger.kernel.org
+37 −0
Original line number Diff line number Diff line
@@ -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";
+4 −0
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ int of_pci_get_host_bridge_resources(struct device_node *dev,
			unsigned char busno, unsigned char bus_max,
			struct list_head *resources, resource_size_t *io_base)
{
	struct pci_host_bridge_window *window;
	struct resource *res;
	struct resource *bus_range;
	struct of_pci_range range;
@@ -225,7 +226,10 @@ int of_pci_get_host_bridge_resources(struct device_node *dev,
conversion_failed:
	kfree(res);
parse_failed:
	list_for_each_entry(window, resources, list)
		kfree(window->res);
	pci_free_resource_list(resources);
	kfree(bus_range);
	return err;
}
EXPORT_SYMBOL_GPL(of_pci_get_host_bridge_resources);
+4 −0
Original line number Diff line number Diff line
@@ -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
Loading