Skip to contentSkip to conversation

Add PCIe phy driver for some Mediatek SoCs

PATCH Superseded Ryder Lee 1 participant 4 messages May 21, 2017 – May 25, 2017

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Ryder Lee

author
#0 lore raw

v2 cover Add PCIe phy driver for some Mediatek SoCs

Hi,

This patch series add PCIe phy driver and related dt-binding file for Mediatek mt7623 SoCs families.

Changes since v2:
- rebase to Linux 4.12-rc1

Changes since v1:
- revise binding document:
drop 'status' properties.
add a description to 'phy-switch' property and add vendor prefix.

Ryder Lee (2):
phy: add PCIe PHY driver for mt7623 SoCs families
dt-bindings: phy: Add documentation for Mediatek PCIe PHY

 .../devicetree/bindings/phy/phy-mt7623-pcie.txt    |  63 +++++
 drivers/phy/Kconfig                                |   8 +
 drivers/phy/Makefile                               |   1 +
 drivers/phy/phy-mt7623-pcie.c                      | 290 +++++++++++++++++++++
 4 files changed, 362 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/phy-mt7623-pcie.txt
 create mode 100644 drivers/phy/phy-mt7623-pcie.c
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/2 phy: add PCIe PHY driver for mt7623 SoCs families

support PCIe PHY of MT7623 SoCs families

---
 drivers/phy/Kconfig           |   8 ++
 drivers/phy/Makefile          |   1 +
 drivers/phy/phy-mt7623-pcie.c | 290 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 299 insertions(+)
 create mode 100644 drivers/phy/phy-mt7623-pcie.c
drivers/phy/Kconfig +8 -0
index afaf7b6..94b3e61 100644
@@ -530,4 +530,12 @@ config PHY_MESON8B_USB2
 	  and GXBB SoCs.
 	  If unsure, say N.
 
+config PHY_MT7623_PCIE
+	tristate "Mediatek PCIe PHY driver for MT7623 SoC families"
+	depends on ARCH_MEDIATEK && OF
+	select GENERIC_PHY
+	select MFD_SYSCON
+	help
+	  Say 'Y' here to add support for Mediatek PCIe PHY driver which
+	  can be found on the MT7623 SoC families.
 endmenu
drivers/phy/Makefile +1 -0
index f8047b4..0185f6a 100644
@@ -64,3 +64,4 @@ obj-$(CONFIG_PHY_CYGNUS_PCIE)		+= phy-bcm-cygnus-pcie.o
 obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_PHY_NS2_PCIE)		+= phy-bcm-ns2-pcie.o
 obj-$(CONFIG_PHY_MESON8B_USB2)		+= phy-meson8b-usb2.o
+obj-$(CONFIG_PHY_MT7623_PCIE)		+= phy-mt7623-pcie.o
drivers/phy/phy-mt7623-pcie.c new file +290 -0

290 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v2 2/2 dt-bindings: phy: Add documentation for Mediatek PCIe PHY

In reply to Ryder Lee

Add documentation for PCIe PHY available in MT7623 series SoCs.

---
 .../devicetree/bindings/phy/phy-mt7623-pcie.txt    | 63 ++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/phy-mt7623-pcie.txt
Documentation/devicetree/bindings/phy/phy-mt7623-pcie.txt new file +63 -0
new file mode 100644
index 0000000..6fefac5
@@ -0,0 +1,63 @@
+Mediatek MT7623 PCIe PHY
+-----------------------
+
+Required properties:
+ - compatible: Should contain "mediatek,mt7623-pcie-phy".
+ - reg: Base address and length of the registers.
+ - clocks: Must contain an entry in clock-names.
+   See ../clocks/clock-bindings.txt for details.
+ - clock-names: Must be "pciephya_ref"
+ - #phy-cells: Must be 0.
+
+Optional properties:
+ - mediatek,phy-switch: A phandle to the system controller, used to
+   switch the PHY on PCIe port2 which is shared with USB u3phy2.
+
+Example:
+
+	pcie0_phy: pcie-phy at 1a149000 {
+		compatible = "mediatek,mt7623-pcie-phy";
+		reg = <0 0x1a149000 0 0x1000>;
+		clocks = <&clk26m>;
+		clock-names = "pciephya_ref";
+		#phy-cells = <0>;
+	};
+
+	pcie1_phy: pcie-phy at 1a14a000 {
+		compatible = "mediatek,mt7623-pcie-phy";
+		reg = <0 0x1a14a000 0 0x1000>;
+		clocks = <&clk26m>;
+		clock-names = "pciephya_ref";
+		#phy-cells = <0>;
+	};
+
+	pcie2_phy: pcie-phy at 1a244000 {
+		compatible = "mediatek,mt7623-pcie-phy";
+		reg = <0 0x1a244000 0 0x1000>;
+		clocks = <&clk26m>;
+		clock-names = "pciephya_ref";
+		#phy-cells = <0>;
+
+		mediatek,phy-switch = <&hifsys>;
+	};
+
+Specifying phy control of devices
+---------------------------------
+
+Device nodes should specify the configuration required in their "phys"
+property, containing a phandle to the phy node and phy-names.
+
+Example:
+
+#include <dt-bindings/phy/phy.h>
+
+pcie: pcie at 1a140000 {
+	...
+	pcie at 0,0 {
+		...
+		phys = <&pcie0_phy>;
+		phy-names = "pcie-phy0";
+	}
+	...
+};
+
Signature · 1 line
1.9.1
author
#3 lore raw
In reply to Ryder Lee

Hi Kishon,

I'd like to rename driver name to make it more generic so that we could reuse it for other MTK SoCs, and I'll resend patches with a new name.

Sorry for the inconvenience.

Ryder.

Quoted 25 lines · Ryder Lee

Hi,

This patch series add PCIe phy driver and related dt-binding file for Mediatek mt7623 SoCs families.

Changes since v2:
- rebase to Linux 4.12-rc1

Changes since v1:
- revise binding document:
drop 'status' properties.
add a description to 'phy-switch' property and add vendor prefix.

Ryder Lee (2):
phy: add PCIe PHY driver for mt7623 SoCs families
dt-bindings: phy: Add documentation for Mediatek PCIe PHY

 .../devicetree/bindings/phy/phy-mt7623-pcie.txt    |  63 +++++
 drivers/phy/Kconfig                                |   8 +
 drivers/phy/Makefile                               |   1 +
 drivers/phy/phy-mt7623-pcie.c                      | 290 +++++++++++++++++++++
 4 files changed, 362 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/phy-mt7623-pcie.txt
 create mode 100644 drivers/phy/phy-mt7623-pcie.c