]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
airoha: an7583: add DT binding for AN7583 USB PHY
authorVitaliy Sochnev <sochnev.v.74@gmail.com>
Sun, 9 Aug 2026 16:28:50 +0000 (17:28 +0100)
committerRobert Marko <robimarko@gmail.com>
Thu, 13 Aug 2026 08:44:41 +0000 (10:44 +0200)
The airoha,an7583-usb-phy compatible added by the USB PHY driver had no
matching binding document. The AN7581 equivalent ships one as a separate
patch (220-05), which is also where the AIROHA_USB2_MONCLK_SEL* defines
used by an7583.dtsi come from.

The AN7583 binding is not simply "same as AN7581": the SoC has a single
PHY block with four named reg regions, per-port child nodes carrying
#phy-cells, and airoha,scu on the USB 3.0 child rather than on the PHY
node itself.

The AIROHA_USB2_MONCLK_SEL* defines are reused from the AN7581 binding
header, as the values are identical on AN7583.

Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24609
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/airoha/patches-6.18/607-01-dt-bindings-phy-Add-documentation-for-Airoha-AN7583-USB-PHY.patch [new file with mode: 0644]

diff --git a/target/linux/airoha/patches-6.18/607-01-dt-bindings-phy-Add-documentation-for-Airoha-AN7583-USB-PHY.patch b/target/linux/airoha/patches-6.18/607-01-dt-bindings-phy-Add-documentation-for-Airoha-AN7583-USB-PHY.patch
new file mode 100644 (file)
index 0000000..06e0622
--- /dev/null
@@ -0,0 +1,164 @@
+From b1810200bbd5021c1a00643ea5dd8516ad9c1c1b Mon Sep 17 00:00:00 2001
+From: Vitaliy Sochnev <sochnev.v.74@gmail.com>
+Date: Sat, 8 Aug 2026 10:00:00 +0100
+Subject: [PATCH] dt-bindings: phy: Add documentation for Airoha AN7583 USB PHY
+
+Add documentation for the Airoha AN7583 USB PHY.
+
+Unlike AN7581, where each USB port has its own PHY node, the AN7583 SoC
+has a single PHY block driving two USB 2.0 ports and one USB 3.0 port.
+Each port is described by a child node of the PHY block: USB 2.0 children
+carry their offset in the "phy" register region and the oscillator to use
+for Slew Rate calibration, while the USB 3.0 child carries a phandle to
+the SCU, needed to switch the shared Serdes between USB and HSGMII mode.
+
+The AIROHA_USB2_MONCLK_SEL* defines are reused from the AN7581 binding
+header, as the values are identical on AN7583.
+
+Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
+---
+--- /dev/null
++++ b/Documentation/devicetree/bindings/phy/airoha,an7583-usb-phy.yaml
+@@ -0,0 +1,132 @@
++# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
++%YAML 1.2
++---
++$id: http://devicetree.org/schemas/phy/airoha,an7583-usb-phy.yaml#
++$schema: http://devicetree.org/meta-schemas/core.yaml#
++
++title: Airoha AN7583 SoC USB PHY
++
++maintainers:
++  - Christian Marangi <ansuelsmth@gmail.com>
++
++description: >
++  The Airoha AN7583 SoC USB PHY describes the USB PHY for the USB controller.
++
++  Unlike AN7581, where each USB port has its own PHY node, the AN7583 SoC has
++  a single PHY block driving two USB 2.0 ports and one USB 3.0 port. Each port
++  is described by a child node of the PHY block.
++
++  USB 2.0 child nodes carry their offset in the "phy" register region and the
++  oscillator to use for Slew Rate calibration. The USB 3.0 child node carries
++  a phandle to the SCU, needed to switch the shared Serdes between USB and
++  HSGMII mode.
++
++properties:
++  compatible:
++    const: airoha,an7583-usb-phy
++
++  reg:
++    maxItems: 4
++
++  reg-names:
++    items:
++      - const: phy
++      - const: ana
++      - const: pma
++      - const: dig
++
++  '#address-cells':
++    const: 1
++
++  '#size-cells':
++    const: 0
++
++patternProperties:
++  '^usb2-phy@[0-9a-f]+$':
++    type: object
++    additionalProperties: false
++
++    description: USB 2.0 port of the PHY block.
++
++    properties:
++      reg:
++        maxItems: 1
++        description: Offset of the port registers in the "phy" region.
++
++      airoha,usb2-monitor-clk-sel:
++        description: Describe what oscillator across the available 4
++          should be selected for USB 2.0 Slew Rate calibration.
++        $ref: /schemas/types.yaml#/definitions/uint32
++        enum: [0, 1, 2, 3]
++
++      '#phy-cells':
++        const: 1
++
++    required:
++      - reg
++      - airoha,usb2-monitor-clk-sel
++      - '#phy-cells'
++
++  '^usb3-phy$':
++    type: object
++    additionalProperties: false
++
++    description: USB 3.0 port of the PHY block.
++
++    properties:
++      airoha,scu:
++        description: Phandle to the SCU node, used to switch the shared
++          Serdes between USB and HSGMII mode.
++        $ref: /schemas/types.yaml#/definitions/phandle
++
++      '#phy-cells':
++        const: 1
++
++    required:
++      - airoha,scu
++      - '#phy-cells'
++
++required:
++  - compatible
++  - reg
++  - reg-names
++  - '#address-cells'
++  - '#size-cells'
++
++additionalProperties: false
++
++examples:
++  - |
++    #include <dt-bindings/phy/airoha,an7581-usb-phy.h>
++
++    phy@1fac0000 {
++        compatible = "airoha,an7583-usb-phy";
++        reg = <0x1fac0000 0x2000>,
++              <0x1fa6f000 0x1000>,
++              <0x1fa6e000 0x1000>,
++              <0x1fa6a000 0x1000>;
++        reg-names = "phy", "ana", "pma", "dig";
++
++        #address-cells = <1>;
++        #size-cells = <0>;
++
++        usb2-phy@0 {
++            reg = <0x0>;
++            airoha,usb2-monitor-clk-sel = <AIROHA_USB2_MONCLK_SEL1>;
++
++            #phy-cells = <1>;
++        };
++
++        usb2-phy@1000 {
++            reg = <0x1000>;
++            airoha,usb2-monitor-clk-sel = <AIROHA_USB2_MONCLK_SEL2>;
++
++            #phy-cells = <1>;
++        };
++
++        usb3-phy {
++            airoha,scu = <&scu>;
++
++            #phy-cells = <1>;
++        };
++    };
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -776,6 +776,7 @@ M: Christian Marangi <ansuelsmth@gmail.c
+ L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+ S:    Maintained
+ F:    Documentation/devicetree/bindings/phy/airoha,an7581-usb-phy.yaml
++F:    Documentation/devicetree/bindings/phy/airoha,an7583-usb-phy.yaml
+ F:    drivers/phy/airoha/phy-airoha-usb.c
+ F:    include/dt-bindings/phy/airoha,an7581-usb-phy.h