Skip to contentSkip to conversation

pci: Add PCIe driver for Samsung Exynos

PATCH In review Jingoo Han 2 participants 2 messages Jun 20, 2013

Subsystems (4)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH v8 1/4 pci: Add PCIe driver for Samsung Exynos

Exynos5440 has a PCIe controller which can be used as Root Complex. This driver supports a PCIe controller as Root Complex mode.

---
 .../devicetree/bindings/pci/exynos-pcie.txt        |   73 ++
 drivers/pci/host/Kconfig                           |    9 +
 drivers/pci/host/Makefile                          |    1 +
 drivers/pci/host/pci-designware.c                  | 1057 ++++++++++++++++++++
 4 files changed, 1140 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/exynos-pcie.txt
 create mode 100644 drivers/pci/host/pci-designware.c
Documentation/devicetree/bindings/pci/exynos-pcie.txt new file +73 -0
new file mode 100644
index 0000000..f71d835
@@ -0,0 +1,73 @@
+* Samsung Exynos PCIe interface
+
+Required properties:
+-compatible: should contain "snps,dwc-pcie" to identify the
+	core, plus an identifier for the specific instance, such
+	as "samsung,exynos5440-pcie".
+-reg: base addresses and lengths of the pcie conteroller,
+	the phy controller, additional register for the phy controller.
+- interrupts: interrupt values for level interrupt,
+	pulse interrupt, special interrupt.
+- clocks: from common clock binding: handle to pci clock.
+- clock-names: from common clock binding: Shall be "pcie", "pcie_bus".
+- #address-cells: set to <3>
+- #size-cells: set to <2>
+- device_type: set to "pci"
+- 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 PCIe interface to interrupt
+	numbers.
+- reset-gpio: gpio pin number of power good signal
+
+Example:
+
+SoC specific DT Entry:
+
+	pcie at 290000 {
+		compatible = "samsung,exynos5440-pcie";
+		reg = <0x290000 0x1000
+			0x270000 0x1000
+			0x271000 0x40>;
+		interrupts = <0 20 0>, <0 21 0>, <0 22 0>;
+		clocks = <&clock 28>, <&clock 27>;
+		clock-names = "pcie", "pcie_bus";
+		#address-cells = <3>;
+		#size-cells = <2>;
+		device_type = "pci";
+		ranges = <0x00000800 0 0x40000000 0x40000000 0 0x00001000   /* configuration space */
+			  0x81000000 0 0	  0x40001000 0 0x00010000   /* downstream I/O */
+			  0x82000000 0 0x40011000 0x40011000 0 0x1ffef000>; /* non-prefetchable memory */
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0 0 0 0>;
+		interrupt-map = <0x0 0 &gic 53>;
+	};
+
+	pcie at 2a0000 {
+		compatible = "samsung,exynos5440-pcie";
+		reg = <0x2a0000 0x1000
+			0x272000 0x1000
+			0x271040 0x40>;
+		interrupts = <0 23 0>, <0 24 0>, <0 25 0>;
+		clocks = <&clock 29>, <&clock 27>;
+		clock-names = "pcie", "pcie_bus";
+		#address-cells = <3>;
+		#size-cells = <2>;
+		device_type = "pci";
+		ranges = <0x00000800 0 0x60000000 0x60000000 0 0x00001000   /* configuration space */
+			  0x81000000 0 0	  0x60001000 0 0x00010000   /* downstream I/O */
+			  0x82000000 0 0x60011000 0x60011000 0 0x1ffef000>; /* non-prefetchable memory */
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0 0 0 0>;
+		interrupt-map = <0x0 0 &gic 56>;
+	};
+
+Board specific DT Entry:
+
+	pcie at 290000 {
+		reset-gpio = <&pin_ctrl 5 0>;
+	};
+
+	pcie at 2a0000 {
+		reset-gpio = <&pin_ctrl 22 0>;
+	};
drivers/pci/host/Kconfig +9 -0
index 1f1d67f..eb6296f 100644
@@ -5,4 +5,13 @@ config PCI_MVEBU
 	bool "Marvell EBU PCIe controller"
 	depends on ARCH_MVEBU || ARCH_KIRKWOOD
 
+config PCI_DW
+	bool
+
+config PCI_EXYNOS
+	bool "Samsung Exynos PCIe controller"
+	depends on SOC_EXYNOS5440
+	select PCIEPORTBUS
+	select PCI_DW
+
 endmenu
drivers/pci/host/Makefile +1 -0
index 5ea2d8b..75bf7be 100644
@@ -1 +1,2 @@
 obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
+obj-$(CONFIG_PCI_DW) += pci-designware.o
\ No newline at end of file
drivers/pci/host/pci-designware.c new file +1057 -0

1,057 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

Documentation/devicetree/bindings/pci/exynos-pcie.txt line 1

Quoted 7 lines · Jingoo Han
Documentation/devicetree/bindings/pci/exynos-pcie.txt new file +1 -0
new file mode 100644
index 0000000..f71d835
@@ -0,0 +1,73 @@
+* Samsung Exynos PCIe interface

Please adapt the name of the binding as well, and name it snps-dwc-pcie.txt for instance, to match the change in the driver and in the binding.

Documentation/devicetree/bindings/pci/exynos-pcie.txt line 6

Quoted 4 lines
Documentation/devicetree/bindings/pci/exynos-pcie.txt new file +4 -0
+Required properties:
+-compatible: should contain "snps,dwc-pcie" to identify the
+	core, plus an identifier for the specific instance, such
+	as "samsung,exynos5440-pcie".

Thanks for changing it here.

Documentation/devicetree/bindings/pci/exynos-pcie.txt line 31

Quoted 6 lines
Documentation/devicetree/bindings/pci/exynos-pcie.txt new file +6 -0
+
+	pcie at 290000 {
+		compatible = "samsung,exynos5440-pcie";
+		reg = <0x290000 0x1000
+			0x270000 0x1000
+			0x271000 0x40>;

but please also change the example and the .dts files to match. It should say here

		compatible = "samsung,exynos5440-pcie", "snps,dwc-pcie";

as now required by the binding.

Arnd