Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796175618; b=aPQdEM7S9ql6yJHlPXlFo/Kjoz4hVs5sGFLMlUo/pJ/RZfU8N30K6I5FCnY/89nKBeFg duNnOR7792Ik840kawbE3lgQBYvXqXs0nBQIZYoFBcpM7hAtpGYR5c4dqB1bV/9cNMJwa Ja2PldGZyH6zmV5vISoTh8x8xi6glZ+nIphgVo9SkTXFyiXg1hS1Snh8PBrA9/iPmZsf1 reVPaq7MjSZvp32OAe1FK5X/BLwSlwrgftFJiKvbsjbCGb5+dHEgTrPH3sp9WKRBfW5DN 2HwzA7oiHNIGAGFSxdtgSh45oJHH8HDLzUIcAPo+Zy0ZNWEM9kDjRFWoa07xgkeXtOg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796175618; 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=e+Dk7k1e7bQyboVNc1VM92CR1F+1KuzOfXniHesNITMawzR4Tl3y+Et2YSb1HdBK3zXE EKlbFndL+KkBWxgCIC2Q1v/+r9ak6TmkuSAcfOybqKcX9pETps4A0hSOiI4seZmU1QyjD xRSHNEV+1Lb+J2QBG60UW4myevUX+1BBJ5scRDeDVW2S7YtHgtmbwQmr1IK3fQ+5U2yPz gxkUu2IXWDdq0Nw4fKunKRCSNvqnxMuKEAD//JtaLRHkDpM9lHhwaCneP6645464O4WCG 7D46k/f2HPUntva3LhQmvCSDP/1sSsGeTh9rW2HqgNRCajvpORJAyLM36ABJV5cxRYA== 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.42 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 34582606A322 for ; Wed, 2 Dec 2026 01:40:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 34582606A322 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-f42.google.com with SMTP id 98e67ed59e1d1-3ac78f4c10bso5432344a91.1 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=bm83yh88ontY53lGFAtZorbzZxax6BOwtPnwr81f9AkCCxNKu941lQngLwfMwviVLZ Rd9Df0HVjzwHNemcYdDTy18zfcdJkDX0FuANJAG3T7K8tsLdq2zo9xJoTlriggoCBQiF jgjm9CG4hL5WCxLWNgyv8zYV+bRBGgI8GdOGTnFIX+lAyV77mgxMZsPhmXuHBeP3tUFi 9Idz6dUqD9DmwZJWhOmfsiuE9O6pWa7NHXoQ/QbUlQMj4hXIvckFPaKIrbThK3qtJZHs q0bB2eb+kUN1NvEqjW0mgm9yTtqyzJJh7HuyecoS/8XvLlYruzLF4GNZ556zKAUpDQtK fLeA== X-Forwarded-Encrypted: i=1; AL+hErESZuPgXpx58b+fJxTzibogLREgT2+05JeSbJbsmDZTydxZ9rgFcDH8YpCWXLEtn11xmJv8uaCqrxuS@vger.kernel.org X-Gm-Message-State: APuU4Z9JaqCTUDNfn1GxFLWW8ozkTF/muUJuJx8YmF0JKf7Hm5vQAc9n 8wzlrANhVqvIw21B74397bnTGA2pCgTLnJOorKhH7H9zXtWvpwxJwt2F X-Gm-Gg: AZFdTZf22RLPxwE1IpJRVATjv00xlUeTtnV5xeA8zLz+5Cs4rU51mP8r8hEZuNe+xIb YzserH9ucenByK/M2bb1WaiqxxVkkGk+04vit5DtvezaT5rhqccjOj5lxCD+CGAPj4ztyZnmKGb 82wNG5QwMsmQV94sV6sstDDZlVgN9CTcdN7XWsmC/FmvUhW8Y8GsaBPK3SENByvMTNnUWOFX5Z1 u+qI0O6LWSz2bxIgwxxPgt7ODDIm0C0N4Aw5F5tTUPS7tElNwDv7ncbgcfR3muvqFfMU2Jjn15M 7js5HTOylBKGP1tRAlOsAQmuuONTg9S+IqTw32/qOT2rfZi+qXixB9aJR4jjbkZDCnSfap4UGc+ 3XzpvEOAKaOMfPDqnyJb0qOxGvvjLPdvpHxdWvWwfsOEuoQ8OfOQvrnaBhzmHcwMGBGmkFmQTBl QMlnAFjqGHsdw2nu10hN1dKtMlSinmnXa7SoDX9UiE+/nlBPpE87b+WaTHgQ2maWEBFsrus/iqe KwOEx+nqFIn2dwG4ZD+Ww9pA8Hvc3RsBbGbZJy1rbo2v55wGG6+ufsM4F4JS1bENW2GNi4UNtWC QhtfpTxzWy4reDkQQO6G37E80jEX7Qrkkyz8APeF+xiBup/Su4hRptLVRYQmyqjvAAV5QKF4qlX DyZxbGwrP/jE2a00T/FM1YKDD8O0tEy5696Wf2aQ= 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: devicetree@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