Skip to contentSkip to conversation

Add support for nuvoton ma35 usb2 phy

PATCH Applied Hui-Ping Chen 2 participants 4 messages Aug 5, 2024 – Aug 29, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v4 cover Add support for nuvoton ma35 usb2 phy

This patch series adds the usb2 phy driver for the nuvoton ma35 ARMv8 SoC. It includes DT binding documentation and the ma35 usb2 phy driver.

v4:
- Update ma35d1 usb2 phy driver
- Update the 'readl_poll_timeout' to 'regmap_read_poll_timeout'.
- Update MODULE_AUTHOR name.

v3:
- Update nuvoton,ma35d1-usb2-phy.yaml
- Update the syscon usage description.

v2:
- Update nuvoton,ma35d1-usb2-phy.yaml
- Update the 'nuvoton,ma35-usb2-phy' to 'nuvoton,ma35d1-usb2-phy'.
- Remove unnecessary descriptions.
- Add explanations related to SYS.
- Update ma35d1 usb2 phy driver
- Update the 'nuvoton,ma35-usb2-phy' to 'nuvoton,ma35d1-usb2-phy'.
- Use readl_poll_timeout() to make the system more efficient and the code more streamlined.
- Use the same variable name. Update the 'p_phy->dev' to 'pdev->dev'.

Hui-Ping Chen (2):
dt-bindings: phy: nuvoton,ma35-usb2-phy: add new bindings
phy: nuvoton: add new driver for the Nuvoton MA35 SoC USB 2.0 PHY

 .../bindings/phy/nuvoton,ma35d1-usb2-phy.yaml |  45 ++++++
 drivers/phy/Kconfig                           |   1 +
 drivers/phy/Makefile                          |   1 +
 drivers/phy/nuvoton/Kconfig                   |  13 ++
 drivers/phy/nuvoton/Makefile                  |   3 +
 drivers/phy/nuvoton/phy-ma35d1-usb2.c         | 143 ++++++++++++++++++
 6 files changed, 206 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/nuvoton,ma35d1-usb2-phy.yaml
 create mode 100644 drivers/phy/nuvoton/Kconfig
 create mode 100644 drivers/phy/nuvoton/Makefile
 create mode 100644 drivers/phy/nuvoton/phy-ma35d1-usb2.c
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/2 dt-bindings: phy: nuvoton,ma35-usb2-phy: add new bindings

Add dt-bindings for USB2 PHY found on the Nuvoton MA35 SoC.

---
 .../bindings/phy/nuvoton,ma35d1-usb2-phy.yaml | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/nuvoton,ma35d1-usb2-phy.yaml
Documentation/devicetree/bindings/phy/nuvoton,ma35d1-usb2-phy.yaml new file +45 -0
new file mode 100644
index 000000000000..fff858c909a0
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/nuvoton,ma35d1-usb2-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton MA35D1 USB2 phy
+
+maintainers:
+  - Hui-Ping Chen <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - nuvoton,ma35d1-usb2-phy
+
+  "#phy-cells":
+    const: 0
+
+  clocks:
+    maxItems: 1
+
+  nuvoton,sys:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to syscon for checking the PHY clock status.
+
+required:
+  - compatible
+  - "#phy-cells"
+  - clocks
+  - nuvoton,sys
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/nuvoton,ma35d1-clk.h>
+
+    usb_phy: usb-phy {
+        compatible = "nuvoton,ma35d1-usb2-phy";
+        clocks = <&clk USBD_GATE>;
+        nuvoton,sys = <&sys>;
+        #phy-cells = <0>;
+    };
Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 2/2 phy: nuvoton: add new driver for the Nuvoton MA35 SoC USB 2.0 PHY

In reply to Hui-Ping Chen

Nuvoton MA35 SoCs support DWC2 USB controller. Add the driver to drive the USB 2.0 PHY transceivers.

---
 drivers/phy/Kconfig                   |   1 +
 drivers/phy/Makefile                  |   1 +
 drivers/phy/nuvoton/Kconfig           |  13 +++
 drivers/phy/nuvoton/Makefile          |   3 +
 drivers/phy/nuvoton/phy-ma35d1-usb2.c | 143 ++++++++++++++++++++++++++
 5 files changed, 161 insertions(+)
 create mode 100644 drivers/phy/nuvoton/Kconfig
 create mode 100644 drivers/phy/nuvoton/Makefile
 create mode 100644 drivers/phy/nuvoton/phy-ma35d1-usb2.c
drivers/phy/Kconfig +1 -0
index dfab1c66b3e5..f73abff416be 100644
@@ -95,6 +95,7 @@ source "drivers/phy/mediatek/Kconfig"
 source "drivers/phy/microchip/Kconfig"
 source "drivers/phy/motorola/Kconfig"
 source "drivers/phy/mscc/Kconfig"
+source "drivers/phy/nuvoton/Kconfig"
 source "drivers/phy/qualcomm/Kconfig"
 source "drivers/phy/ralink/Kconfig"
 source "drivers/phy/realtek/Kconfig"
drivers/phy/Makefile +1 -0
index 5fcbce5f9ab1..ebc399560da4 100644
@@ -25,6 +25,7 @@ obj-y					+= allwinner/	\
 					   microchip/	\
 					   motorola/	\
 					   mscc/	\
+					   nuvoton/	\
 					   qualcomm/	\
 					   ralink/	\
 					   realtek/	\
drivers/phy/nuvoton/Kconfig new file +13 -0
new file mode 100644
index 000000000000..270ee2943287
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# PHY drivers for Nuvoton MA35 platforms
+#
+config PHY_MA35_USB
+	tristate "Nuvoton MA35 USB2.0 PHY driver"
+	depends on ARCH_MA35 || COMPILE_TEST
+	depends on OF
+	select GENERIC_PHY
+	help
+	  Enable this to support the USB2.0 PHY on the Nuvoton MA35
+	  series SoCs.
+
drivers/phy/nuvoton/Makefile new file +3 -0
new file mode 100644
index 000000000000..2937e3921898
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_PHY_MA35_USB)		+= phy-ma35d1-usb2.o
drivers/phy/nuvoton/phy-ma35d1-usb2.c new file +143 -0

143 lines not on this page · raw message

Signature · 1 line
2.25.1
maintainer Applied
#3 lore raw
In reply to Hui-Ping Chen
Quoted 9 lines · Hui-Ping Chen

This patch series adds the usb2 phy driver for the nuvoton ma35 ARMv8 SoC. It includes DT binding documentation and the ma35 usb2 phy driver.

v4:
- Update ma35d1 usb2 phy driver
- Update the 'readl_poll_timeout' to 'regmap_read_poll_timeout'.
- Update MODULE_AUTHOR name.

[...]

Applied, thanks!

[1/2] dt-bindings: phy: nuvoton,ma35-usb2-phy: add new bindings

      commit: c174f1c6c100b18c4a908b117265d7cd99fff6c7
[2/2] phy: nuvoton: add new driver for the Nuvoton MA35 SoC USB 2.0 PHY
      commit: b48baf69db9725aa5ddde52d98cd7b5517ddd9eb

Best regards,

Signature · 1 line
~Vinod