Skip to contentSkip to conversation

pci: Add PCIe driver for Samsung Exynos

PATCH Superseded Jingoo Han 3 participants 5 messages Jun 21, 2013

Subsystems (4)

v9 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH v9 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/designware-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/designware-pcie.txt
 create mode 100644 drivers/pci/host/pci-designware.c
Documentation/devicetree/bindings/pci/designware-pcie.txt new file +73 -0
new file mode 100644
index 0000000..e4681e6
@@ -0,0 +1,73 @@
+* Synopsis Designware PCIe interface
+
+Required properties:
+-compatible: should contain "snps,dw-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", "snps,dw-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", "snps,dw-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

Hi Jingoo,

Some small corrections inline.

Quoted 22 lines · Jingoo Han

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/designware-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/designware-pcie.txt
 create mode 100644 drivers/pci/host/pci-designware.c
Documentation/devicetree/bindings/pci/designware-pcie.txt new file +0 -0
new file mode 100644
index 0000000..e4681e6

Documentation/devicetree/bindings/pci/designware-pcie.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt new file +7 -0
@@ -0,0 +1,73 @@
+* Synopsis Designware PCIe interface
+
+Required properties:
+-compatible: should contain "snps,dw-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,

s/conteroller/controller

Documentation/devicetree/bindings/pci/designware-pcie.txt line 12

Quoted 5 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt new file +5 -0
+       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".

s/Shall be .../should be "pcie" and "pcie_bus".

[snip]

Documentation/devicetree/bindings/pci/designware-pcie.txt line 16

Quoted 4 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt new file +4 -0
+
+MODULE_AUTHOR("Jingoo Han <[email protected]>");
+MODULE_DESCRIPTION("Samsung PCIe host controller driver");
+MODULE_LICENSE("GPLv2");

I think this should be "GPL v2" (with a space between GPL and v2).

Signature · 2 lines
With warm regards,
Sachin
author
#2 lore raw
Quoted 24 lines · Sachin Kamat

Hi Jingoo,

Some small corrections inline.

Quoted 16 lines · Jingoo Han

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/designware-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/designware-pcie.txt
 create mode 100644 drivers/pci/host/pci-designware.c

Review

Quoted 1 line
(quoted diff) +0 -0

b/Documentation/devicetree/bindings/pci/designware-pcie.txt

Quoted 14 lines

Documentation/devicetree/bindings/pci/designware-pcie.txt line 7

Quoted 12 lines

new file mode 100644
index 0000000..e4681e6

Documentation/devicetree/bindings/pci/designware-pcie.txt new file +7 -0
@@ -0,0 +1,73 @@
+* Synopsis Designware PCIe interface
+
+Required properties:
+-compatible: should contain "snps,dw-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,

s/conteroller/controller

OK, I will fix it.

Quoted 8 lines

Documentation/devicetree/bindings/pci/designware-pcie.txt line 12

Quoted 6 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt new file +5 -0
+       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".

s/Shall be .../should be "pcie" and "pcie_bus".

OK, I will fix it.

Quoted 9 lines

[snip]

Documentation/devicetree/bindings/pci/designware-pcie.txt

Quoted 4 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt new file +4 -0
+
+MODULE_AUTHOR("Jingoo Han <[email protected]>");
+MODULE_DESCRIPTION("Samsung PCIe host controller driver");
+MODULE_LICENSE("GPLv2");

I think this should be "GPL v2" (with a space between GPL and v2).

OK, I will fix it.

Thank you for your caring and comment. :)
I will fix the typo and send PATCH v10 soon.

Best regards,
Jingoo Han

Quoted 5 lines

--
With warm regards,
Sachin

#3 lore raw
In reply to Jingoo Han

drivers/pci/host/pci-designware.c

Quoted 5 lines · Jingoo Han
drivers/pci/host/pci-designware.c new file +0 -0
new file mode 100644
index 0000000..f8558ff

If you plan to send next version, then I would suggest to rename it as pcie-designware.c, because synopsis pcie and pci controllers are different.

Regards
Pratyush

author
#4 lore raw
Quoted 9 lines · Pratyush Anand

drivers/pci/host/pci-designware.c

Quoted 5 lines · Jingoo Han
drivers/pci/host/pci-designware.c new file +0 -0
new file mode 100644
index 0000000..f8558ff

If you plan to send next version, then I would suggest to rename it as pcie-designware.c, because synopsis pcie and pci controllers are different.

OK, I see.
I rename it as 'pcie-designware.c'.
Thank you for your suggestion. :)

Best regards,
Jingoo Han

Quoted 5 lines

Regards
Pratyush