From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A543606A333 for ; Wed, 2 Dec 2026 01:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=taNMCbvZ; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Pbb3ppmi DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=v1g9HIupeLxO0n0vocCGsQ8ncdN4WH7c3O3qCKk8b94=; b=taNMCbvZDpQCOEmMy5jrX01fOH cq8vseAXYwqwMhVWIThUgixJKTRigk/YNOLvgWKe9RoZtX8+9lXEq0RP8BESFCI5BDEhpzqKHPPBE iWiFmBoG08/VT5hMOI3nJY0lxdQYzSs6Rs1rd8/ZbjpNyfiD3c4j3JvzCHt4yyiLetXOA/VqugnGB lwsJ7pNd4Emvw66w6HYAu7NQv0cQ0V52uVJndvwVzvt6rBLPfzN6s1NGi6fhCdOnROUDtyaHrphOQ Vlmikdv9yax2BuY8ePRGpzMzfcuRoHI3G+1DoM9Nx9EhmSEfGSiPcGYuskX+/fthuogGVPTcfy5dz tFze5b1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYZKW-00000009tNy-1Us1; Wed, 02 Dec 2026 01:40:20 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYZKU-00000009tMV-26n6 for linux-phy@lists.infradead.org; Wed, 02 Dec 2026 01:40:19 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-cd6acc50b8dso6327628a12.3 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=lists.infradead.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=Pbb3ppmiyYyVNfn4TTiZvyzxD2MmXchF24yGK4s531RUmGj8TRfyaoOwHufVF0MnQy 9QVdcRv6S25gX/+4swuzZcFaVQr/3ppqiXRBPwHyVNPQ/eEgjdBpsSwjBFuly0WXqVt2 t6Ft9eBQuJj4lBWY1U8UlF43FngsFI3LA5m0W4mkhzaAK3pyK6oItiomI6CRKB/BTnwL OFV1x10w1RxfWQ2ePWrMWaEKqXFe8ixWhS0nxKq0vBWYBIYeHtrplQ1gmPw69TGiUoDx yc3qyGbSoJ2ONGGnxO93wi4dq3jdJkaZbVm6VxYsPNXdzJiuoSzXkNP3cOamDtxonjXq S8Bg== 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/+WtNmkfjF4Sx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aARSQJe3Pf5vU5vSA8ECyuPeDl3aylIRzbeds19 nwo1komlj+C/fY6W4gSNdukCHAQ2zt55NmJkONEgQkbq/DipHVglzRbzxedvZS1zGbxsKkGrceY I20XH6YXmK9zIuAQogjjFj5jZ5fhYYCybEGxa/no7GrPp1SfRhEyIeLqIBJ7FaWFtDe7krb/Pmd BYXQAPDlcAN1edCZDAlyKIbYk8/seH6nxJR/vWCk= 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-Archived-By: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_174018_550293_BDD6D9C9 X-CRM114-Status: GOOD ( 19.35 ) X-Spam-Score: -1.8 (-) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,FROM_LOCAL_HEX,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy