From nobody Sat Feb 7 16:39:27 2026 Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net [185.136.64.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07C4F17D8A9 for ; Mon, 12 Aug 2024 14:16:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.64.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723472167; cv=none; b=qg0CQgY91U6D3pzvnpmGoTHb+C2Ch5Bo3a9ludSeSQcI22WkNpNf6jrGjS93s5Y7ti2kXfedjXntoQfkaVdQg52qsgu/M4+T+H76gLY+bAA5UESOkgD5QjWjMfJspud+wHU/e8V1jdavs0HRM9FWsrQzVFnVNsewmlLXY/MEOLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723472167; c=relaxed/simple; bh=5uvJIRHlkjf8Lvt2StLoKbbn1d3sQy3a5sWCCj4yqMc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aJgruW+ddbfWE6oPbK/brdP+Dqy9sOHGXlXAiuuVCruaFTsgIgUFxp07T8ani1G5mxYUjtnS8xtvJQmbtqRYlfM6Qi9uElemG4Z3LKyPt5EAwGieBs7iU2YkcXA8dEsDuTaUG/jMb9DbDX9ba6YL1yZcyYqdPJDbAdD5VJpHY6U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (2048-bit key) header.d=siemens.com header.i=jan.kiszka@siemens.com header.b=iKxleSi0; arc=none smtp.client-ip=185.136.64.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=jan.kiszka@siemens.com header.b="iKxleSi0" Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202408121415541c47541ac6c8c0343c 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: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer Content-Type: text/plain; charset="utf-8" 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 =20 + 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 regi= ster for USB PHY. + description: + The phandle to System Register Controller syscon node and the PHY co= nnect 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 =3D "125m", "app_125m"; #phy-cells =3D <0>; + starfive,sys-syscon =3D <&sys_syscon 0x18>; }; --=20 2.43.0 From nobody Sat Feb 7 16:39:27 2026 Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8148416C440 for ; Mon, 12 Aug 2024 14:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.65.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723472769; cv=none; b=IBnSrNVriQyhpUsHNhi+gueVXNE5VTRtOWw28c8ZIG6p8spmaQQuGaGOVOrtfC7t8bjpnx238j3UzvvVtlUGIpTRR0wKeV7va/wc/Cki2vyXCB8yRBV5psVEod80ri7K0uP5OClPyjo6jk7SoR36wQJXFHR43yLGcPu9RuWHvSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723472769; c=relaxed/simple; bh=j6v7lTD1pCUL9Ydx0b3syzZyUX73yVXnWh0CnQpkixM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HTf4NeTdkDvRkQfwr8W/0eNoRF1qXIxGj0EO78muVpHkqyANpoz3XyB+phe1JV8xlEGeSU5xkhxH4gMT7nE20+oi/r/bbnSI1BxjZOhIDFiS2lH9iizycGk/ZG7GwOm5JrQGXYDipMB/cGD5N3BnXiyxH5+Wl8LPKA5CWccOGuI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (2048-bit key) header.d=siemens.com header.i=jan.kiszka@siemens.com header.b=KwREujn8; arc=none smtp.client-ip=185.136.65.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=jan.kiszka@siemens.com header.b="KwREujn8" Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20240812141555c2cf8a000135ca0120 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: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer Content-Type: text/plain; charset="utf-8" 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 =3D "125m", "app_125m"; #phy-cells =3D <0>; + starfive,sys-syscon =3D <&sys_syscon 0x18>; }; =20 pciephy0: phy@10210000 { --=20 2.43.0 From nobody Sat Feb 7 16:39:27 2026 Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6658B17DE16 for ; Mon, 12 Aug 2024 14:16:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.65.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723472168; cv=none; b=hK1Mm8N+AD8hWrbx4U/yXfPS2+vySGtMzDQUs1efLyP6JeZnu3u5HWgpr0bvFiP38f8GYcKbgOMxUU5AgGWR9lrBG9D4icIYhw2rl5oPmsZ/+mvdD6hdC8UCCfa1miPoK3t0GrnS+7Z84sC1SeboZ0q9mVXeL9/KaHSGU26hFps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723472168; c=relaxed/simple; bh=0lTutUHBeGzzKw5A1GSrM+tT8FP8h3SfWBA88NFVWZg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NniTVv+iKE5nxDy22AkJ35F5QGbeK2z8tijXbBJxX5lcPjf0AF5m8DS25pfsUzLSIwwh3ZIhvShXwC+gakvVAX7pWzy0pmoO8C25cpojzmuOJWZN1D2EAIvigN7kJ5ZpEiaOBJ6zTJwYOFY5ESIxMENOqnU+Puaml3jei3M3YMs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (2048-bit key) header.d=siemens.com header.i=jan.kiszka@siemens.com header.b=ddLDs8ji; arc=none smtp.client-ip=185.136.65.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=jan.kiszka@siemens.com header.b="ddLDs8ji" Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20240812141555acbe3a2e00c2ae5cf8 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: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer Content-Type: text/plain; charset="utf-8" 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/p= hy-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 =20 #define USB_125M_CLK_RATE 125000000 #define USB_LS_KEEPALIVE_OFF 0x4 #define USB_LS_KEEPALIVE_ENABLE BIT(4) =20 +#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 !=3D PHY_MODE_USB_DEVICE)); } =20 + /* Connect usb 2.0 phy mode */ + regmap_update_bits(phy->sys_syscon, phy->sys_phy_connect, + USB_PDRSTN_SPLIT, USB_PDRSTN_SPLIT); + return 0; } =20 @@ -101,6 +111,7 @@ static int jh7110_usb_phy_probe(struct platform_device = *pdev) struct jh7110_usb2_phy *phy; struct device *dev =3D &pdev->dev; struct phy_provider *phy_provider; + u32 args[1]; =20 phy =3D 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 =3D devm_of_phy_provider_register(dev, of_phy_simple_xlate); =20 + phy->sys_syscon =3D + 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 =3D args[0]; + return PTR_ERR_OR_ZERO(phy_provider); } =20 --=20 2.43.0