From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B3BE30D3F5 for ; Thu, 25 Jun 2026 02:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782355208; cv=none; b=N00ShwnGW/molcMLAWCkj1oijMsWVrzOd2D0oylN5H7xVSC52qwn/tY784qA1FWa920y+SgP86LakMGUcO8Ikqt/hXdEeRYYPBY2KAg9AKXhSL//fGtpT5U1mlTO0094v4nJR3XhJ2KkMWsUWqQ7G66B/dretLdhofsDblIBAfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782355208; c=relaxed/simple; bh=pqRPvxuElMLpNJPA6OOKR1MMoXC+pRsh3BKEffCRTwo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=solwm2B3/NnUlNmYuewZaEn6ZZJRfAafe4Ce2XQadmE60GljWFPb0fATdukN4pCO7XFl1UdLBbZKLBpieLRT8Qq5fDuCAd8HyJue/uFEizN/ne/5syC22O1M4pQXM/Yx32QQ08P1NIZmV4n1p188IgPkSauVXd60IbZ5tsxBCXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SaLe+cYt; arc=none smtp.client-ip=209.85.216.53 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.b="SaLe+cYt" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-37dd266c32eso1300221a91.1 for ; Wed, 24 Jun 2026 19:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782355205; x=1782960005; 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; bh=jNZIPicjbhTWqiH8QggWQnz7Ntv8N8jFEbB8QeyQbLg=; b=SaLe+cYtzfMT+D8R4juHzept0uT9ID3ea8rCy+N5uqHyUzb3JoHEq94O+o8aIRmleq jR5wf2pVDqdu1c78I6UOOxnn8NEQaH6WxkCG7K1QkaK2sYRrVJ6l8k6+3ILgPgmio08T 8mdZLLSrCZ6D92DxZaO1dt+aiq4zuu9MSSpOauXxdG8jolh4QVUXwDocESkiCmgEPyJA nSrVKR1MgHdvN3KjDfejayrzF3rhV4TMGpjuuvlxusryS5gpmE/zdqsOFzFyeCwy3F0k oBgGc2r889+Ps2eW2zF8OUmDqWxUO3kP0f7ykUxggSNITufw3bliPNSUhSBD+YchFzCN 2tMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782355205; x=1782960005; 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; bh=jNZIPicjbhTWqiH8QggWQnz7Ntv8N8jFEbB8QeyQbLg=; b=bV+8j+c1nAwnslLENytyw8ya6df8UgCyRbI6ib6PELDMhNMVKRrvEGqWpW5/0tI+qC PggbEgJobC5r9K8fCYqnwduUZz0AvLaZyBMFO6YwjPjbsc5ak9xNauYkeyor3fywJAb8 y0REyw5JsxuHeZO6mbZltsQLd6iCNU5aCOu/irFgXC0WBC1YwuZcjF/kirUmClN4ranA kgYoJeISy38cA4CBBzTTa+L0JB83szktjW6N8ZsIgdS3KywZEWCQe+O7ZeGCoT8CTdQy A8BDvCpHHb1DHJiiOZ6JKQWfrPWsxY3UBEFiC+8jYyR2rUHCPkKb23XOG1Guj+5vddtS 26mg== X-Forwarded-Encrypted: i=1; AHgh+Rr6nMZ26VeQyuGt814pjoDAyoHggYNJl9pSk+cheZNrkyvwgJleO7oOZPSLAl1vpTiatcWL52qBgVR562I=@vger.kernel.org X-Gm-Message-State: AOJu0YyEQtWLQx+WU572U1RlXaZX06raW1BAVz/fKZJm0Krvw+Hhq1zm +hYv6JLIbgRPpT0GunC0rNxPLP+uzgovokDrfZtnI3xGxseSg6w5nFrB X-Gm-Gg: AfdE7cnjk2RGPp6xuOSeVjbsQQiu+nw3JTI96WBxoFNK2UUVakEDn7zNoICWLIGbKlx Up/KB1xbZgyTcfHMOMZSvk/gp5oNpWbuGuoXkQq6EovD7qKTJ8Ef1Ui7TrFZLTx5TvuJbXwPbK7 nioAl53c60DQixco/SNgN02AtybC1aBqXZczHo2AIWQAjYLURxnE9jvu6WhfMeybrdTKoPhtw9Z YdDX6LmeGPOM+K3hoSaslGEHQWDrx+5Ss0TyJBMwImmIWjYvxe4mB0CeXZsvUpKxApk0spi6IA8 YxkhVqCEvIcJdmahsHKcdCxiu/memMxvCHhtoPCF4vM4Zrr6fgqCJesgaD5dR4zbewbRTEvBbZz 9FASJo3IuXoPCXjqO0M6Jv/LTKF5Zf2FycRdqxGzetk02CVsCasNehFSYFG04LGIduNA8+E4dJN PYFoL8/2yETLk4l3D4ndvKzDTy2zfEGmTg5h9DSJOlRrFTb/Bfvr3AMCrd4V+yPwavwmu8K+rNw g== X-Received: by 2002:a17:903:2c5:b0:2c7:c4b8:60c2 with SMTP id d9443c01a7336-2c7fc798ecamr7218765ad.11.1782355205260; Wed, 24 Jun 2026 19:40:05 -0700 (PDT) Received: from localhost.localdomain (60-250-196-139.hinet-ip.hinet.net. [60.250.196.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c7f64dc839sm8538545ad.68.2026.06.24.19.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2026 19:40:04 -0700 (PDT) From: Joey Lu To: Vinod Koul , Neil Armstrong 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 v2 0/4] phy: nuvoton: extend MA35D1 USB2 PHY driver for dual-port OTG support Date: Thu, 25 Jun 2026 10:39:54 +0800 Message-ID: <20260625023958.569299-1-a0987203069@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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. - PHY1 (USB1): dedicated host-only port for EHCI1/OHCI1. A previous series [1] added a separate phy-ma35d1-otg.c driver for this. Following reviewer suggestion to reuse the existing phy-ma35d1-usb2.c driver rather than introduce a new one, that series has been dropped and this series instead extends the existing driver. Changes in this series: Patch 1 (new) adds simple-mfd support to the nuvoton,ma35d1-reset syscon binding. The sys node needs to act as an MFD parent so that usb-phy@60 can be its DT child. This patch is a prerequisite for patch 2 and has no functional impact on existing users of the syscon. Patch 2 updates the nuvoton,ma35d1-usb2-phy binding: the PHY node becomes a child of the syscon node (reg = <0x60 0x14>), nuvoton,sys phandle and clocks are removed, and #phy-cells changes from 0 to 1 for per-port selection. Optional nuvoton,rcalcode and nuvoton,oc-active-high properties are added. Patch 3 updates the MA35D1 DTS: sys gains simple-mfd, usb-phy@60 is added as a syscon child, and DWC2/EHCI0/EHCI1/OHCI0/OHCI1 nodes are added. Board files enable the nodes and add pinctrl for the HSUSB signals (VBUSVLD, PWREN, OVC). Patch 4 extends phy-ma35d1-usb2.c: a loop creates two struct phy objects; a unified .init handles both ports with parametric register macros; clock management is removed (each controller gates its own clock); a read-only USB role switch is registered for PHY0 reporting the USB ID pin via PWRONOTP[16]. Changes since v1: - New patch 1: nuvoton,ma35d1-reset binding extended for simple-mfd and child node support; required as a prerequisite for the PHY binding which places usb-phy@60 as a syscon child. - Patch 2 (was patch 1): nuvoton,rcalcode description updated to clarify that both PHY entries are individually optional; example reg corrected from 4-cell to 2-cell format. - Patch 3 (was patch 2): ehci1 node address corrected to lowercase (401c0000). - Patch 4 (was patch 3): register definition section header comments added; HOST_READY and DEV_READY macro comments made more descriptive; ma35_role_switch_exit() added to the PHY provider registration error path to prevent a role switch leak. Link: [1] https://lore.kernel.org/linux-phy/20260604101220.1092822-1-a0987203069@gmail.com/T/#t Joey Lu (4): dt-bindings: reset: nuvoton,ma35d1-reset: add simple-mfd and child node support dt-bindings: phy: nuvoton,ma35d1-usb2-phy: extend for dual-port OTG support arm64: dts: nuvoton: ma35d1: add USB controllers and dual-port PHY node phy: nuvoton: phy-ma35d1-usb2: extend to dual-port with OTG support .../bindings/phy/nuvoton,ma35d1-usb2-phy.yaml | 62 +++- .../bindings/reset/nuvoton,ma35d1-reset.yaml | 13 +- .../boot/dts/nuvoton/ma35d1-iot-512m.dts | 36 +++ .../boot/dts/nuvoton/ma35d1-som-256m.dts | 36 +++ arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 68 ++++- drivers/phy/nuvoton/phy-ma35d1-usb2.c | 267 +++++++++++++----- 6 files changed, 391 insertions(+), 91 deletions(-) -- 2.43.0