From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796175619; b=47GkafgYkQxoefNWr9i8gJlksmxc0eeT9tdpD3OwCIBfqtiXazKpCCKWkzRIovMaS/AM c+Bt7sH7H2DcaqmlmlFvQCwSy5Rfo7gFWMZSXIQDYPINvExUaeEq3Iw8+BvnaNFIKTWYt VpD84BuCM5Pg49traBRP9nTBeqwjsh6TKeML+fPxCwQpzujKPQQNtb1mf1JNKPiUVSr72 MiSHJFbTbtw5ILQQ3rK1taYZFEZ9wdYw+zp52ehgSL5JjOaLE7DUQHibGwK0uLBTi0m3d i3d9zVIPKgmy3G0ydPhroD2c2JG6dExuQtNbwYa4nurJOId9e9DXha04Cph8P0jNhZg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796175619; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=DaU/NznuwV3p9KcQvzLDdC6vne/+WtNmkfjF4Sxf3sk=; b=x5KRlzT/lXD6/fjgTd+ccdWDboLBVy+kZN0Jd88eySKFF/3zcHyKDLhajcfJPB3ngsVu kcGSLtbYUZ8VbmsmpZ2mC/wTIntW4fCiZS8DgCccjce9ZrBGhdp57LctAZJ+Gxx13Ekys H+0ZK9aVxfDuDKZOtHTzHGTYi4X/9Mbwy6V7ORvJIw6Zfsdp0kEYElGGrcufP7UPLDnVE vmh5S18fP/Sgx9ZJeQvbxBT0u1WBQw7qhuT3jhDT2FzayRY8XLgDZ0L/HCzuifiLwyP8Y T6eHgDzOniNyPk40iZZS003QlDh5ZIEJItzRg7frxfZr9gvw5H1JsMAiOso5ca0bFEA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=tsEwEIPI; arc=none smtp.remote-ip=209.85.216.45 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31640606A31A for ; Wed, 2 Dec 2026 01:40:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 31640606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=tsEwEIPI Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-3b520f1604fso2714491a91.2 for ; Tue, 01 Dec 2026 17:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796175617; x=1796780417; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=DaU/NznuwV3p9KcQvzLDdC6vne/+WtNmkfjF4Sxf3sk=; b=tsEwEIPIQK3df1ZxV6iqmQ/mlMDrVnmeSAl+tx4P4V+1ikKM1x2qBPLs6HPLIKGyrP nVsIpYOoEfP14i9gnTY8DwxP/eHwx/Z7a3fJwDbRQOYiVgD6+Ks3N62gn4TItwcMSAxR jhJ/y23eIqyVQafIJgLwmogVOa15mcccbNK03vwywmZCo0AtJGgYigZtIhTII7jVAhF9 DTCrn17w3YVlco0ncSpavMLHZtCZHQL8RLH6ccU4o19fIyhwnjYhWGEVoxFLepk4D7UN cyj3jyOE/0KkV7Qyr5EIjCTsv7Bp7VUonA75sETQQWCEwzj1Fwu2aNjdvbwygif/+8QI LAww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796175617; x=1796780417; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DaU/NznuwV3p9KcQvzLDdC6vne/+WtNmkfjF4Sxf3sk=; b=iRgI68p/wmYX/5J+90LvCaYvt/y4o4Su2VFxzRhxly6N46T0mBhiOB3P7bbfDtqXQq 5fZercz33EhXeyTeMPWerdql6XMSNO5wVT0AB5Oe/dovJNvZ56/RXUyDVRBRkmu/47/w ZMEEU+HmcOm8ASV92pGevifAqMhg71uDH9e1WFN3oF9gERGL4AxQ1LjmmBwhBhn0TDRG RddK8shymn1ajRR3uXuO/fKYz70BrlPDH77Ks4Co1S/1N9cfcz3iSsXVhCwMjOCw58nt iJ2s/d0TobQdRWCm1zzyXovIVi7aeU6675v3iJfDd417vV64jcIEwByZo0tAtrOYmPZb 3sLw== X-Forwarded-Encrypted: i=1; AL+hErFoa2B0ZIuYHEUveuoujrNV5Hv5OcoK9yuEAcgSmTF+xgURdbOrshEgCulvwGljeh0CtB15C3cAqK5xOlw=@vger.kernel.org X-Gm-Message-State: APuU4Z8sKUUF2uGZCGfwD0v3h3KBIr7kI53nH/xYz91Qddr/rCsedmVu d9NQycxJJgxJQmHOkWphfB2dNX/YuydzUYyTweVB96qSfvNn06Od9xQcCjd5gw== X-Gm-Gg: AZFdTZc1WwsN+eNoz+OnYiHBbw80hRn1PQhmdt82FeBazLWTltqE+8EIDNpsfyeYI3B AzbPGohYQKggglrCZcjE7XdTB2ELL/L1qQdpbvwudSh0elXKUtSfZc6XLWUZQcpY40Eeqap3tEa BbP/Hyi2krMOot/7q3Z0sRLLkapkhM9BxKd5pcHUTQfUrKPnOSBCHXQJRGSWMx7htB0J7UNaSLt Vmh7iyxJP//Z9cEmSsZ2D64YC1vkhvvlO9rjQ8D76tmmqddy6KPLSF3fzdb7sSltvW2RzheLsV0 e3zn9yI9MxyJ5+sO8i1OoI8fPXpbP57UQLGf3JSK7jpIVI1NC9oBHtUvN5YqxH9CA2CCX9hL7KV JNNf75BnkJgMlcAPMAthceef9ZjJXxNrL0ljKp+E2CmGlgN0RfKsdjVVL1A9ZwO8SB3iZ4EbuFV mN1zv7RRco72yjrp+vwky/hlY9tzxc9DmzVr/v4ClTOlkUW+UR9x/w6ZUPynufGkRN7HvU+JgYr BJQPyZekg/oIafWKn8JaU6q0/cZoShp0bwx7i3hDnpkLqLqJ5l2aVGVA599mXfYcIBv6AhDz1tu OehdRPzt2AODH+3J2Ufi8+lNNB6P1ErI7nhbMcQNXv6Oru8kwBmnkdXAVOlk7Du6+MYOQ9sU0O5 SYVapzhLuWHxfiXqU5HrhRXpUo9mHAPQmoA1DZ0Q= X-Received: by 2002:a17:90b:3f0f:b0:3b0:934c:5e41 with SMTP id 98e67ed59e1d1-3b41c9080e7mr46740391a91.29.1796175617327; Tue, 01 Dec 2026 17:40:17 -0800 (PST) Received: from localhost.localdomain (60-250-196-139.hinet-ip.hinet.net. [60.250.196.139]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b4b0f482bdsm44652325a91.14.2026.12.01.17.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 17:40:16 -0800 (PST) From: Joey Lu To: Vinod Koul , Neil Armstrong , Manivannan Sadhasivam Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Catalin Marinas , Jacky Huang , Shan-Chun Hung , Hui-Ping Chen , Joey Lu , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Lu Subject: [PATCH v10 0/4] phy: nuvoton: extend MA35D1 USB2 PHY driver for dual-port OTG support Date: Wed, 2 Dec 2026 09:39:57 +0800 Message-ID: <20261202014001.424366-1-a0987203069@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The MA35D1 SoC has two USB PHY ports managed by a shared hardware block: - PHY0 (USB0): OTG port shared between the DWC2 gadget controller and the EHCI0/OHCI0 host controllers. A hardware mux automatically routes USB0 signals to the correct controller based on the USB ID pin state. - PHY1 (USB1): dedicated host-only port for EHCI1/OHCI1. This series extends the existing phy-ma35d1-usb2.c driver and its binding to cover both ports and add OTG role-switch support, while keeping full backward compatibility with existing device trees. Changes since v9: - phy: restore the original "Copyright (C) 2024 Nuvoton Technology Corp." line; the copyright notice is not changed by this series. - phy: use u32 instead of unsigned int for the port index, the helper/local variables and the xlate index. - phy: use dev_err() instead of dev_err_probe() in the init callback, as it is not called from probe(). - phy: drop the unrelated formatting changes in the of_device_id and platform_driver tables, and use a single space before "=" in phy_ops and platform_driver. - Patches 1-3 are unchanged. Changes since v8: - dts: set the DWC2 (USB0) register window to 0x40000 (0x4020_0000-0x4024_0000, per the MA35D1 spec) instead of 0x1000, so that it covers the per-endpoint FIFO region at 0x1000 + n * 0x1000. The EHCI/OHCI windows were checked against the spec and are unchanged. - phy: select MFD_SYSCON in PHY_MA35_USB, as the driver depends on syscon_regmap_lookup_by_phandle(). - Patches 1 and 3 are unchanged. Changes since v7: - phy: add "depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH" to PHY_MA35_USB, so a built-in PHY driver cannot be combined with a modular role switch core (link failure on usb_role_switch_register()). - phy: restore the PHY reset fallback. If the PHY is already in operation mode but its clocks do not become stable, reset it and poll again instead of failing immediately. The reset is still skipped when the already-running PHY reports stable clocks. - phy: gate the HUSBH0_GATE clock dynamically again. The clock is no longer enabled for the whole lifetime of the driver (devm_clk_get() instead of devm_clk_get_enabled()); .power_on/.power_off enable and disable it, and .init enables it around its register accesses. The gate can therefore close when neither port is powered. - phy: nuvoton,oc-active-high: keep writing the polarity bit unconditionally, so that an absent property means active-low as documented in the binding, regardless of what the bootloader left in MISCFCR0. The bit only affects the EHCI/OHCI host ports' VBUS switch and is irrelevant to the gadget use of PHY0. This is a new property in this series, and no mainline DT depends on a bootloader-programmed polarity. - Patches 1-3 are unchanged. Changes since v6: - phy: update the copyright notice in the rewritten driver header to "2024-2026" instead of "2026", preserving the original 2024 date rather than dropping it. - phy: split the unused linux/io.h removal out of patch 4 into its own patch (3/4), since it's unrelated cleanup that predates this series (the driver has never done direct MMIO access; all register access goes through regmap via syscon_regmap_lookup_by_phandle()). Placed immediately before patch 4 since that is the first patch in the series to touch this file. Joey Lu (4): dt-bindings: phy: nuvoton,ma35d1-usb2-phy: extend for dual-port and OTG arm64: dts: nuvoton: ma35d1: add USB controllers and dual-port PHY node phy: nuvoton: phy-ma35d1-usb2: remove unused linux/io.h include phy: nuvoton: phy-ma35d1-usb2: extend to dual-port with OTG support .../bindings/phy/nuvoton,ma35d1-usb2-phy.yaml | 44 ++- .../boot/dts/nuvoton/ma35d1-iot-512m.dts | 36 +++ .../boot/dts/nuvoton/ma35d1-som-256m.dts | 36 +++ arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 65 ++++ drivers/phy/nuvoton/Kconfig | 2 + drivers/phy/nuvoton/phy-ma35d1-usb2.c | 301 ++++++++++++++---- 6 files changed, 415 insertions(+), 69 deletions(-) base-commit: cee9395acd8043be0644b25c34bfa86623f2b935 -- 2.43.0