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 D173B606A33E for ; Wed, 2 Dec 2026 01:40:35 +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=sskxd1Ix; dkim=pass (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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: 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=DaU/NznuwV3p9KcQvzLDdC6vne/+WtNmkfjF4Sxf3sk=; b=sskxd1IxvA4NqS6LyhtuTruoXW lmghkm/jfKkn/DzAMwlClVie+wPPsch2FRZ2BinMezVwuZ+j9/f5NTYGL3vdUIQRJ6fGD1Se0GtHy UQ2kjwvtbrM3uVzUokdOu/R0b5aESzu1TjM5b0/BMlRigRvDTElMSFXs1vHKIuJS0z40l7nzQO7s2 3nmctA7HGIoP4f/Gaim8YSiiHeaOJvmfcqYq3AryZchKxmVmBWVhHC6g5MVJ5Dy0Tb3wyu4Kj66D3 A6cahyT6fdImghV5BuD5zkFNoaGmPlSmgJl5/Rmlvf05/YordwgmwieNiJTkEo9/Vf0oc8jv8/QoQ +gaorTHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYZKW-00000009tOB-1hyS; Wed, 02 Dec 2026 01:40:20 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYZKU-00000009tMW-26ad for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 01:40:19 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2f0213202fdso64106735ad.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/+WtNmkfjF4Sxf3sk=; b=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4p20xI+30XVVwwrGTgkaeyFrygznQFC9XS j3lvAz1a9dcwDlMM6oQEzY2lP7bvE1I72ig920kywhpai5O2oshPN+Di5+61t1cxoM6ukOn/MgU NfHfSyDrT0jMkB06+I0TUzB95jxWRbfdKRyYC04JSV/7UCeqSBJex1JaozRP6vWvZwz5Jxp2sKU iQ8z9JkuKgu+mjMHBaOyXynxHxvq6o4mPREtPTIg= 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 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_174018_549788_EEEE2AD6 X-CRM114-Status: GOOD ( 20.90 ) X-Spam-Score: -1.8 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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