From patchwork Mon Aug 12 14:15:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13760831 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 5B3AAC52D7D for ; Mon, 12 Aug 2024 15:30:32 +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:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=tAMO7zaWSLFJ6MHaNR8qQ3gS94ZHJwSV6HGbDoJJ3U4=; b=GM0GU38yHqzncA YiHdqn9vRrpLuvntnffciOfPfl1jtQP2E26BgZQ99T4FN4FNeWq2UNXA5nFVnfbNGH9bzC0PIvVfI HIepIgOXdq4azPEb/SKd88hyKXIyHW95MwprlrSlpyEcf06Irai6onR9BoArfu+HaCHgmyPf50u0j 6vkuR8lkRGcAqpDF48fKHHnyUiXfVAIvmeoo211rh06JaXIa/rDjLEKXPTmt90PZt/uENYSoPlFt+ aFkNsuSr/GhNhGtejTAkD9kcMrDvW9fhtHRDsRQz9dRoE6e178gU9hxuoykfH6GAUKNTTNwpBVeWo +Z1O1naQZpcGXtubn8tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdX07-00000000jpz-2auR; Mon, 12 Aug 2024 15:30:27 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVq9-00000000YHg-3eH3 for linux-riscv@bombadil.infradead.org; Mon, 12 Aug 2024 14:16:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=6t4OCL7r2k0BcCZXsgV29+zy3Q4zYlCFqtAXU2nhKaE=; b=PJZ0s5JGluhCipk6sgPcodhFDr bGcoQIeKEyRpIXNq0cYQ9GgqLK4S2dwy6DZtYxRLU6la91eSeCqXwwkkuldV2o7WJTG85nlAnlYlS +pyDPiOZqxxe29+enmoAfmHPtNApO4wMavPh5bUDRTBHWlRYjhiW/vanWxGhIWieYcnH//3osg9Tv sa0Bljvu11llCxv57N8Ioq8o3x43ZRa91oc1faHXXxTK3HxqEencDeTNsLsUKZCr3lKTfN7DoV8l7 eKA9XUqNEXFubux75OKtC8y0ahkYU6fskp9Grb0rGA79eGC4DqdcqIf4CJ18DFsBwBXiwEa5xm/+j 1SI9adZg==; Received: from mta-65-225.siemens.flowmailer.net ([185.136.65.225]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVq4-00000007aM4-2qYi for linux-riscv@lists.infradead.org; Mon, 12 Aug 2024 14:16:04 +0000 Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 202408121415540e15e08595dc442bc1 for ; Mon, 12 Aug 2024 16:15:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=6t4OCL7r2k0BcCZXsgV29+zy3Q4zYlCFqtAXU2nhKaE=; b=iKxleSi0LO3bbWjQAZ2jrQNCCbTzL1GxB/6aZDzCNmvFnPZUMZfCp/FNZp6yFtV/isdeoT 2mOOdNZkqJNJzC1sGa9FjQ2XsBEbQdxGZA17kn7Bv17TIrfIWS11mtzh0037r57+5AMRxP3G bYIHFdXQqNlku54q4IUN+kEKPTZCp2Khg/AvcAlN1GKBnr43RH57r8cNHPcrQ3CkSHDp1HQn 8dJBWUKI29hlc/lYXHqZ8fEyyf1Jc5SPBkfWz4NjnqeaAN4G2efTn3UMA+9kLpiTCg/u1usA 2gNao8g5mCYvuXKrjPn9MwKaT6KpVx+AuxiiH4C5YUuOfOLejeANWqKw==; From: Jan Kiszka To: Minda Chen , Vinod Koul , Kishon Vijay Abraham I Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Dan Carpenter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH v2 1/3] dt-bindings: phy: jh7110-usb-phy: Add sys-syscon property Date: Mon, 12 Aug 2024 16:15:51 +0200 Message-ID: <30f3ca9f6bd788e16767b36aa22c0e9dc4d1c6a4.1723472153.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_151600_967301_C8467A4F X-CRM114-Status: UNSURE ( 7.06 ) 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 From: Jan Kiszka Analogously to the PCI PHY, access to sys_syscon is needed to connect the USB PHY to its controller. Signed-off-by: Jan Kiszka Reviewed-by: Rob Herring (Arm) --- CC: Rob Herring CC: Krzysztof Kozlowski CC: Conor Dooley --- .../bindings/phy/starfive,jh7110-usb-phy.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml b/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml index 269e9f9f12b6..eaf0050c6f17 100644 --- a/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml +++ b/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml @@ -19,6 +19,16 @@ properties: "#phy-cells": const: 0 + starfive,sys-syscon: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controller sys_syscon node. + - description: PHY connect offset of SYS_SYSCONSAIF__SYSCFG register for USB PHY. + description: + The phandle to System Register Controller syscon node and the PHY connect offset + of SYS_SYSCONSAIF__SYSCFG register. Connect PHY to USB controller. + clocks: items: - description: PHY 125m @@ -47,4 +57,5 @@ examples: <&stgcrg 6>; clock-names = "125m", "app_125m"; #phy-cells = <0>; + starfive,sys-syscon = <&sys_syscon 0x18>; }; From patchwork Mon Aug 12 14:15:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13760833 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 5CA63C531DC for ; Mon, 12 Aug 2024 15:30:33 +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:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=jTEAwEcKr33Lb/sgPRJm5gsKJ4URu3UeBZR0ARckfeI=; b=Zo4zqy+YsD1X+W ukeuVTIrIf+NWZgQXvrhWjkwDP/QPiXXnX7XLnOT4jfoDe5k2bxizo3LYnCnDmtpMUuHKu3437fGg HkWUk0+Y5nB85hmd/POqX5Un5Xp+fmdsfF4OxGAYjsgZvRQEW+gxmr1PRUbBOhgKkN3tMxd3q3Z49 u+nHrQtfAOZzqLopc5K7MRsnZgB6OdJLKt5xIU+aFnLfAPe5KYWDe5Dou/r35vh7/wJhwBrxxf3Yc 2qIQsNeuisC6LpGhaab6ahEU4MA1pHJDFwm2RbHKzAtRBEF1ZG1aMvqiLWiBIFj8B8FORl0SyfsRv qCYf6hjb0x8/MzWQS5ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdX08-00000000jr1-3uru; Mon, 12 Aug 2024 15:30:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVqA-00000000YHo-0CWB for linux-riscv@bombadil.infradead.org; Mon, 12 Aug 2024 14:16:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=SUxmYkjU52Zd0l8Y+msbh0zC3Tc3jd+DyqARUfWiOQo=; b=bb/FCfqK6wkW9s708jvgQmAu28 b+6nNw2Uzvof5KM9KomehEFFmvYmUNWXcE3mA1Mn/LSjy1LJjP/BPaORnDf5YJ8C7XlWMmONs7z7E E4TZnut/oDIHnXZqG3R4jMf4vayQ0dmkDZqzN3msgw/yU9pM22BCzWUHcHEmCsjYT7xuisvuLF8ja dpdUNQkLOdM1uhRLZjnsHMYpg8WIUvlrYQGI8yCICtabIFm10cZGJWq1ETjj758QDe/fBstuBYo4U FyTHV+D/5aB1CAgEQQgMg+EofctutaeSwFp7+lV0oHlnZLtdc35BCWvENIFn76IQFoYpUhEIY6yFs AE+jNa8g==; Received: from mta-65-227.siemens.flowmailer.net ([185.136.65.227]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVq4-00000007aLx-3EG8 for linux-riscv@lists.infradead.org; Mon, 12 Aug 2024 14:16:04 +0000 Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202408121415557f0dcc0b50fe748509 for ; Mon, 12 Aug 2024 16:15:55 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=SUxmYkjU52Zd0l8Y+msbh0zC3Tc3jd+DyqARUfWiOQo=; b=KwREujn8vgbWwSH2hoDnU+dPY7IhxRCht6L5Bsi1AczJ9+m5d3HE39FSHIZmK8JVCMwTbD jAAsI4TD58s7WFUDSlq8UGnWh6GGTC4tCjaLGiwM9JD3Jkb1GQsiRa7RjeEx+ipwxFvBw3yl oTh2syBlb+c4euHs8COS+c2C/v5vbyEZ9VI/GrNByHpUE7ijHHDmV/9bzoAK3603X/VNF772 Hb7X9dxnoKau9p5vwGtNdoEE+BS6jUBNg/h9iDdJkc2SnvSFXuurLH67GjTfYf+QxZ6GuLRN jUD7gjtHLtdEnOIsf2PGapU1h46YV/ITmSMDZWzsmsl04ThQoM5XBvVg==; From: Jan Kiszka To: Minda Chen , Vinod Koul , Kishon Vijay Abraham I Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Dan Carpenter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH v2 2/3] riscv: dts: starfive: jh7110: Add sys-syscon property to usbphy0 Date: Mon, 12 Aug 2024 16:15:52 +0200 Message-ID: <699fd0f6b7271fa757d915516fed4df078fad5f7.1723472153.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_151601_092539_FEDEBC77 X-CRM114-Status: UNSURE ( 6.16 ) 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 From: Jan Kiszka Allows the PHY to connect to its USB controller. Signed-off-by: Jan Kiszka --- CC: Rob Herring CC: Krzysztof Kozlowski CC: Conor Dooley --- arch/riscv/boot/dts/starfive/jh7110.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index 0d8339357bad..0c0b66a69065 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -606,6 +606,7 @@ usbphy0: phy@10200000 { <&stgcrg JH7110_STGCLK_USB0_APP_125>; clock-names = "125m", "app_125m"; #phy-cells = <0>; + starfive,sys-syscon = <&sys_syscon 0x18>; }; pciephy0: phy@10210000 { From patchwork Mon Aug 12 14:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13760832 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 5EF46C52D7C for ; Mon, 12 Aug 2024 15:30:32 +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:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=fyDQ1lTvd/q8B0JiUMwzZw70rpZk2Aws5q3Sg39uXIk=; b=XG7o39rrHDVfT3 bApFxoaLJ1O/+pgVUIYtDXmnMZ+oh+PXiR3i8bgzwzpbU4inVhk1EF4agBBgehBW64Ksm79jclwOh TLiDxo1A+PCw7zGZr7Pr6AU0/ShdGwZPTwAiyl6K5oQfHB2uNfn0YLgXibZ8S9iWYeW1+zgaLrY/q pBe0Dc4PKmc2QeVua1bbIGA7mgLXyD/hOyqefte1XWT09OtUV5DytG1+RDSYDGU4GQtz/T0ZDRMtX vBd7m+faDFNKvwNbkUlrKZ7LjupE25RBcBK+h8x2yPwDWrlaeWj3S1iptMD0yn+jv0qgCCCHkbOya DhTO8iCrj6VYNHZh5AFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdX06-00000000jpP-3AVP; Mon, 12 Aug 2024 15:30:26 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVq8-00000000YHL-2BS4 for linux-riscv@bombadil.infradead.org; Mon, 12 Aug 2024 14:16:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=6D0agwaQ4o15XmKg6FVHl6O2WBebwRVFDKLEMHRaYbg=; b=nhMrOx5BBvNsvulbYq25az5vh9 EgMp49hhlJWgNh76CqIWsWdwI9xaX45QFxjnypDUesHVMdqZypKQDWoMv9+ENCeWqU3crp/0flIL/ vgVZ/HGvKKGMgmLTFpEOOIk+JZb/RxdnkbymYdHshGHcfxuplwfN6BQ7RS/aAJ3G4enRbb2K5n53F NTYB3WwKsm28wlosT+BTEoQi9PQBxwWAOLI7vGHchYJUYZeH4uJ54zrTuHrR/EMcNkhjvFNi18iGG HaiJ8kE/WxDpFpyBpDi6dXbDk15eW3J6GM/x+wgovcocf/w59C5bp5CYXkHFZvhLo5B1i4A+ZBXDl LPawFJLQ==; Received: from mta-64-228.siemens.flowmailer.net ([185.136.64.228]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVq4-00000007aLt-1LEE for linux-riscv@lists.infradead.org; Mon, 12 Aug 2024 14:16:03 +0000 Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 202408121415550c85964b12766ff8bc for ; Mon, 12 Aug 2024 16:15:55 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=6D0agwaQ4o15XmKg6FVHl6O2WBebwRVFDKLEMHRaYbg=; b=ddLDs8jiXgx6FfgPtb0cBcHHEceF6B0HU294ClvP5CPmx636z85kSf8kNHZIkqwBIVSHU9 mRvuhTgYl7eiDftfMwpPTJ47derrFWIdVePSULRvOZ0pYjqp+SoiwoudusIF2jnlYET9lkmJ YBTLTvCI0Tb8VfYvMdZ0lbfXnbCjkfUL1c7cxS+EH9TASG8+cHLHXdP4vRJUd6CmQn0WLbsf ObgPJ1O7+ZDv3xVBa8tIXlt8GNQ11IOirIS2m3nKHkMIPjgfJtOFj0TJCNxJEUN/NJWLh6Ti 49Em4Efmrq+NX5W5bC0boI1rux8AIwwOCYCJgAXMvek2U3wXXID0rYug==; From: Jan Kiszka To: Minda Chen , Vinod Koul , Kishon Vijay Abraham I Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Dan Carpenter Subject: [PATCH v2 3/3] phy: starfive: jh7110-usb: Fix link configuration to controller Date: Mon, 12 Aug 2024 16:15:53 +0200 Message-ID: <3ddd11484ffe22eee3459e1156cb4ee905cb45f6.1723472153.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_151600_540541_5382191C X-CRM114-Status: GOOD ( 12.33 ) 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 From: Jan Kiszka In order to connect the USB 2.0 PHY to its controller, we also need to set "u0_pdrstn_split_sw_usbpipe_plugen" [1]. Some downstream U-Boot versions did that, but upstream firmware does not, and the kernel must not rely on such behavior anyway. Failing to set this left the USB gadget port invisible to connected hosts behind. Link: https://doc-en.rvspace.org/JH7110/TRM/JH7110_TRM/sys_syscon.html#sys_syscon__section_b3l_fqs_wsb [1] Fixes: 16d3a71c20cf ("phy: starfive: Add JH7110 USB 2.0 PHY driver") Signed-off-by: Jan Kiszka Reviewed-by: Minda Chen --- drivers/phy/starfive/phy-jh7110-usb.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/phy/starfive/phy-jh7110-usb.c b/drivers/phy/starfive/phy-jh7110-usb.c index 633912f8a05d..89451e740f77 100644 --- a/drivers/phy/starfive/phy-jh7110-usb.c +++ b/drivers/phy/starfive/phy-jh7110-usb.c @@ -10,18 +10,24 @@ #include #include #include +#include #include #include #include +#include #include #define USB_125M_CLK_RATE 125000000 #define USB_LS_KEEPALIVE_OFF 0x4 #define USB_LS_KEEPALIVE_ENABLE BIT(4) +#define USB_PDRSTN_SPLIT BIT(17) + struct jh7110_usb2_phy { struct phy *phy; void __iomem *regs; + struct regmap *sys_syscon; + u32 sys_phy_connect; struct clk *usb_125m_clk; struct clk *app_125m; enum phy_mode mode; @@ -61,6 +67,10 @@ static int usb2_phy_set_mode(struct phy *_phy, usb2_set_ls_keepalive(phy, (mode != PHY_MODE_USB_DEVICE)); } + /* Connect usb 2.0 phy mode */ + regmap_update_bits(phy->sys_syscon, phy->sys_phy_connect, + USB_PDRSTN_SPLIT, USB_PDRSTN_SPLIT); + return 0; } @@ -101,6 +111,7 @@ static int jh7110_usb_phy_probe(struct platform_device *pdev) struct jh7110_usb2_phy *phy; struct device *dev = &pdev->dev; struct phy_provider *phy_provider; + u32 args[1]; phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); if (!phy) @@ -129,6 +140,15 @@ static int jh7110_usb_phy_probe(struct platform_device *pdev) phy_set_drvdata(phy->phy, phy); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + phy->sys_syscon = + syscon_regmap_lookup_by_phandle_args(pdev->dev.of_node, + "starfive,sys-syscon", + 1, args); + if (IS_ERR(phy->sys_syscon)) + return dev_err_probe(dev, PTR_ERR(phy->sys_syscon), + "Failed to get sys-syscon\n"); + phy->sys_phy_connect = args[0]; + return PTR_ERR_OR_ZERO(phy_provider); }