From patchwork Mon Apr 7 12:38:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ze Huang X-Patchwork-Id: 14041084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6927C36010 for ; Mon, 7 Apr 2025 15:12:48 +0000 (UTC) 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:Cc:To:MIME-Version:Message-Id:Date: Subject: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-Owner; bh=2q8crTy/XaMM2sWGGGSTD9pSJ+TtkE1epZCGCPXoPoo=; b=vmXcmeai7NesEF khn4Mg5SQL0J1NztiAiAlHO0yZKu4cOPocP5m/DTfEdUAEMHDxGGV6x766PNjdt+U2wGlc4Ly/Wvm AglQ+1yrjIjUVrIC6R4TgpgA1Tj7sJCL+yL/hjfs3/Pfk0gUrYEwfGrv0zHCJl45LDji+LhXlp8L4 AIlDgk7UHMix8k1Yjqje4UCfiTWGo7B9n0L4zP7z0COlP2WBJ2M5fHFTeZ1z8DPw5i0PRBawqklcP eptE5giagvYT2zBdZhRX5wDfG+SofcoX8M0AGxOb9I+4Xr2HBfZpYAsjde4S4qi7DfOVkmAqDe0mV b6n97Hb+NEDkp9USyCrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1o9K-00000000thu-3EFm; Mon, 07 Apr 2025 15:12:34 +0000 Received: from mail-m155101.qiye.163.com ([101.71.155.101]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1llR-00000000JI6-0LIJ; Mon, 07 Apr 2025 12:39:47 +0000 Received: from [127.0.0.1] (gy-adaptive-ssl-proxy-2-entmail-virt205.gy.ntes [27.18.106.237]) by smtp.qiye.163.com (Hmail) with ESMTP id 10ef566e5; Mon, 7 Apr 2025 20:39:25 +0800 (GMT+08:00) From: Ze Huang Subject: [PATCH 0/7] Add USB3.0 PHY and host controller support for SpacemiT K1 SoC Date: Mon, 07 Apr 2025 20:38:45 +0800 Message-Id: <20250407-b4-k1-usb3-v3-2-v1-0-bf0bcc41c9ba@whut.edu.cn> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAFbH82cC/3WOQW6DMBBFr4K87iB77MGAqoiseoaqysLAlFgJ0 NgENYpy97pkneUb6f03dxE5eI6izu4i8Oqjn6cE6i0T3dFNA4PvEwuUSNJIC62Bk4JrbDWsGhB UUaJzpkKiSiTrJ/C3/90Wvw5PDny5puHleRStiwzdPI5+qbO1yBVB6NS/O3KMbkvW2ftW1LJQl izJHNGUMvWOfDvz5G6N6TGfw7B7IWKJSqLWuZLWSk2ggM89hyb42MXFhTy98EJGLJSiiix8fO4 NkSybgadlnnfi8Hj8AT3ztXI0AQAA X-Change-ID: 20250407-b4-k1-usb3-v3-2-1682aa492559 To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Ze Huang , Greg Kroah-Hartman , Philipp Zabel , Thinh Nguyen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744029565; l=3284; i=huangze@whut.edu.cn; s=20250325; h=from:subject:message-id; bh=guydDGrxtfiF0QxuG+IbBP1EBPIlelU7O0fNN/qWZUY=; b=Ghi1yoX13LsL5SLUgC8pQHW4O7dQb14bN9AeNv91Q+HWvOJWXFbLeEsB2kpBYQQlEISEzAiFr zTTHHmy28hhD9VK+mM5N7b4F11BN+cuWUUXYa2rT4UkbdGbiiSbzdB+ X-Developer-Key: i=huangze@whut.edu.cn; a=ed25519; pk=C3zfn/kH6oMJickaXBa8dxTZO68EBiD93F+tAenboRA= X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkZHR4dVh0fGBpNQkNOQkhMGVYeHw5VEwETFhoSFy QUDg9ZV1kYEgtZQVlJTFVKQ1VKS01VSUhMWVdZFhoPEhUdFFlBWU9LSFVKS0lPT09LVUpLS1VLWQ Y+ X-HM-Tid: 0a961043447103a1kunm10ef566e5 X-HM-MType: 10 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OCo6Aww5HzIMIUwtOBU3GjQt KBwwChJVSlVKTE9PS0lCTkxJQk9CVTMWGhIXVRMOGhUcAR47DBMOD1UeHw5VGBVFWVdZEgtZQVlJ TFVKQ1VKS01VSUhMWVdZCAFZQU5KQ0M3Bg++ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250407_053945_317586_A36C6CA0 X-CRM114-Status: UNSURE ( 6.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patch series introduces support for the USB on the SpacemiT K1 SoC, including DWC3 host controller, PCIe/USB3.0 combo PHY and the USB2.0 PHY. The implementation has been tested on the Milk-V Jupiter and BananaPi-f3. USB3.0 PHY for usb2 is shared with PCIe port A, meaning that only one of these interfaces (PCIe or USB3.0) can be active at a given time. Overview of USB controllers on K1 SoC[1]: Link: https://developer.spacemit.com/documentation?token=AjHDwrW78igAAEkiHracBI9HnTb#part5 [1] --- Ze Huang (7): dt-bindings: phy: spacemit: add K1 USB2 PHY dt-bindings: phy: spacemit: add K1 PCIe/USB3 combo PHY dt-bindings: usb: add SpacemiT K1 DWC3 glue phy: spacemit: support K1 USB2.0 PHY controller phy: spacemit: add USB3 support for K1 PCIe/USB3 combo PHY usb: dwc3: add spacemit dwc3 glue layer driver riscv: dts: spacemit: add usb3.0 support for K1 .../bindings/phy/spacemit,k1-combphy.yaml | 53 +++++ .../devicetree/bindings/phy/spacemit,usb2-phy.yaml | 40 ++++ .../devicetree/bindings/usb/spacemit,k1-dwc3.yaml | 78 +++++++ arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 55 +++++ arch/riscv/boot/dts/spacemit/k1.dtsi | 52 +++++ drivers/phy/Kconfig | 1 + drivers/phy/Makefile | 1 + drivers/phy/spacemit/Kconfig | 20 ++ drivers/phy/spacemit/Makefile | 3 + drivers/phy/spacemit/phy-k1-combphy.c | 229 +++++++++++++++++++++ drivers/phy/spacemit/phy-k1-usb2.c | 132 ++++++++++++ drivers/usb/dwc3/Kconfig | 7 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-spacemit.c | 127 ++++++++++++ 14 files changed, 799 insertions(+) --- base-commit: 64e9fdfc89a76fed38d8ddeed72d42ec71957ed9 change-id: 20250407-b4-k1-usb3-v3-2-1682aa492559 prerequisite-message-id: <20250306175750.22480-2-heylenay@4d2.org> prerequisite-patch-id: e0f9037d659502b7f10588f15b80505724eb9e35 prerequisite-patch-id: 4414e37b16b1bc0039239f07da8c35935efb1601 prerequisite-patch-id: 1e65bc4c0c0d41baef743819c311ad53f6696094 prerequisite-patch-id: 43ef72522e30620f0244e0e22bd844884d89b0cd prerequisite-patch-id: 73008ee7c04e90cd4e825a3f5bd2e44ec24d8ad3 prerequisite-message-id: <20250328210233.1077035-1-elder@riscstar.com> prerequisite-patch-id: 9b026005eb6ee1430ab7ca67edfc21de85a19dd2 prerequisite-patch-id: 8ee238181e50c76d92458b149b72fa4909e0fede prerequisite-patch-id: 66f3ee8eb1cc016112dace699bce292b617a3186 prerequisite-patch-id: c2deec49fc0308a08908fd9badadc10f921af348 prerequisite-patch-id: 99afc2efdffc0fffe47a31e7b07b72af9d1d2e18 prerequisite-patch-id: d06e8cd0fae4c405dbb56832a1fe48bfaa4e0fab prerequisite-patch-id: 5f53f8bf16fb067628092daebc4831293261aa01 prerequisite-message-id: <20250226115957-GYA45508@gentoo> prerequisite-patch-id: 82dd2631d36c3fafb82768d3d89022ed956020c6 prerequisite-patch-id: 5cc63738ba2d463e1840a91a94357f43199bd68f prerequisite-patch-id: f44247679d46a51c242703eca370ce0e3db2e61f prerequisite-patch-id: 9d4cd8be42a37798815d0aaae21d3c022f815414 Best regards,