From nobody Fri Jun 19 20:14:09 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB193C433EF for ; Wed, 30 Mar 2022 11:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343682AbiC3Lgg (ORCPT ); Wed, 30 Mar 2022 07:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235330AbiC3Lge (ORCPT ); Wed, 30 Mar 2022 07:36:34 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55EE1DB3FB; Wed, 30 Mar 2022 04:34:48 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id C84172223B; Wed, 30 Mar 2022 13:34:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1648640086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Ph+DJmySTVnCueq7y0elmi8YWqWsk1ZHnb9P8HZcO0s=; b=VOAsdyv3D/mIs0Y3TMWCQDse9A+nwd9W/DIiDoqBbah6UNFoslTueYRFCANVRjf4htRrP1 T1c83hgKkM2IkbGlD7KiRhDSJzwUkPR+bMg+pSrUZhtAc0PAw1K86RJZjfuqNMfyWFRH8/ 2NmPH+5zXkGcJaBRAk+li0u2lOJh+sw= From: Michael Walle To: Shawn Guo , Li Yang , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH] arm64: dts: ls1028a: default to OTG mode for USB Date: Wed, 30 Mar 2022 13:34:42 +0200 Message-Id: <20220330113442.3402940-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" At the moment, the dtsi will force the dr_mode to host. This is problematic because it will always turn on the Vbus voltage regardless if the port is host or device. This might lead to a "shortcut" between the two USB endpoints because both might have their Vbus supplies enabled. Therefore, the default should be "otg" for any ports which aren't host only (from a SoC point of view) and have a user of the dtsi file overwrite that explicitly. Move the 'dr_mode =3D "host";' into the board dts. Now that the dtsi doesn't set the dr_mode anymore, we can also drop the 'dr_mode =3D "otg";' in the board dts because that is the default value if dr_mode is not set. Signed-off-by: Michael Walle --- arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts | 1 + arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts | 2 ++ arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 2 +- arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 -- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts b/a= rch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts index fef1bb585dce..68d11a9c67f3 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts @@ -341,5 +341,6 @@ &usb0 { }; =20 &usb1 { + dr_mode =3D "host"; status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts b/arch/arm64= /boot/dts/freescale/fsl-ls1028a-qds.dts index 19d3952dbffe..5baf060acf93 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts @@ -382,9 +382,11 @@ &sata { }; =20 &usb0 { + dr_mode =3D "host"; status =3D "okay"; }; =20 &usb1 { + dr_mode =3D "host"; status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64= /boot/dts/freescale/fsl-ls1028a-rdb.dts index 68c31cb8eead..e0cd1516d05b 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts @@ -299,10 +299,10 @@ &sata { }; =20 &usb0 { + dr_mode =3D "host"; status =3D "okay"; }; =20 &usb1 { - dr_mode =3D "otg"; status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi b/arch/arm64/bo= ot/dts/freescale/fsl-ls1028a.dtsi index 088271d49139..92465f777603 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi @@ -599,7 +599,6 @@ usb0: usb@3100000 { compatible =3D "fsl,ls1028a-dwc3", "snps,dwc3"; reg =3D <0x0 0x3100000 0x0 0x10000>; interrupts =3D ; - dr_mode =3D "host"; snps,dis_rxdet_inp3_quirk; snps,quirk-frame-length-adjustment =3D <0x20>; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; @@ -610,7 +609,6 @@ usb1: usb@3110000 { compatible =3D "fsl,ls1028a-dwc3", "snps,dwc3"; reg =3D <0x0 0x3110000 0x0 0x10000>; interrupts =3D ; - dr_mode =3D "host"; snps,dis_rxdet_inp3_quirk; snps,quirk-frame-length-adjustment =3D <0x20>; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; --=20 2.30.2