From: Vitaliy Sochnev Date: Sun, 9 Aug 2026 16:28:50 +0000 (+0100) Subject: airoha: an7583: add DT binding for AN7583 USB PHY X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec50342362767d21a80754493caf2acbcbc62f30;p=thirdparty%2Fopenwrt.git airoha: an7583: add DT binding for AN7583 USB PHY 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 Link: https://github.com/openwrt/openwrt/pull/24609 Signed-off-by: Robert Marko --- 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 index 00000000000..06e062266f5 --- /dev/null +++ b/target/linux/airoha/patches-6.18/607-01-dt-bindings-phy-Add-documentation-for-Airoha-AN7583-USB-PHY.patch @@ -0,0 +1,164 @@ +From b1810200bbd5021c1a00643ea5dd8516ad9c1c1b Mon Sep 17 00:00:00 2001 +From: Vitaliy Sochnev +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 +--- +--- /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 ++ ++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 ++ ++ 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 = ; ++ ++ #phy-cells = <1>; ++ }; ++ ++ usb2-phy@1000 { ++ reg = <0x1000>; ++ airoha,usb2-monitor-clk-sel = ; ++ ++ #phy-cells = <1>; ++ }; ++ ++ usb3-phy { ++ airoha,scu = <&scu>; ++ ++ #phy-cells = <1>; ++ }; ++ }; +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -776,6 +776,7 @@ M: Christian Marangi