From nobody Tue Nov 15 13:05:22 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NBRHg18jnz4dBQS for ; Tue, 15 Nov 2022 13:05:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NBRHd6pDZz3Dcl for ; Tue, 15 Nov 2022 13:05:33 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=FvhUOuXg; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com; dmarc=pass (policy=none) header.from=bidouilliste.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1668517526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h0C6gvBORBRNxb9nNlDQpgQFjzjXObX8lZoyXaS1BCs=; b=FvhUOuXgIzjLTrDTG/TV3Cfsq+Qh941frjU4fF+a2yQNmY47Z78W8qYyhRR8bUP6Xgvqa6 wR97Pd4yLagUMgA0iq6TVXmZVEFzNJQLc2tgb38WBMqh4cvyWitfk9g7b5VxURDdWataO4 KNlAzqhYcexlmeUHesNjz7Cox6C6M9s= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id db5b438e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 15 Nov 2022 13:05:26 +0000 (UTC) Date: Tue, 15 Nov 2022 14:05:22 +0100 From: Emmanuel Vadot To: Mark Millard Cc: freebsd-arm Subject: Re: FYI: Rock64 USB3 port no longer works for main [so: 14] (looks like dtb changes invalidating use of the old .dtbo and needing kernel changes) Message-Id: <20221115140522.f94fa1cb62131b6591a073f0@bidouilliste.com> In-Reply-To: References: <8A639ABB-D8CC-47D6-A106-A5E2463E7AEE@yahoo.com> <665C125A-3E2B-408F-8F6E-B2D23237F06A@yahoo.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-1.50 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_TO(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[manu]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4NBRHd6pDZz3Dcl X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On Fri, 4 Nov 2022 12:31:51 -0700 Mark Millard wrote: > On 2022-Oct-22, at 23:00, Mark Millard wrote: > > > Well, turns out that part of the "Import device-tree files > > from Linux 5.14" is: > > > > https://cgit.freebsd.org/src/commit/sys/contrib/device-tree/src/arm64/rockchip/rk3328-rock64.dts?id=5956d97f4b32 > > > > which has: > > > > diff --git a/sys/contrib/device-tree/src/arm64/rockchip/rk3328-rock64.dts b/sys/contrib/device-tree/src/arm64/rockchip/rk3328-rock64.dts > > index 3bef1f39bc6e..1b0f7e4551ea 100644 > > --- a/sys/contrib/device-tree/src/arm64/rockchip/rk3328-rock64.dts > > +++ b/sys/contrib/device-tree/src/arm64/rockchip/rk3328-rock64.dts > > @@ -381,6 +381,11 @@ > > status = "okay"; > > }; > > > > +&usbdrd3 { > > + dr_mode = "host"; > > + status = "okay"; > > +}; > > + > > &usb_host0_ehci { > > status = "okay"; > > }; > > > > usbdrd3 is for USB3, so "host" now has a sort of dtb change > > in the interfacing for supporting host-mode USB3. The old: > > > > /usr/main-src/sys/dts/arm64/overlays/rk3328-dwc3.dtso > > > > has, in part: > > > > usbdrd3: usb@ff600000 { > > compatible = "rockchip,rk3328-dwc3"; > > clocks = <&cru SCLK_USB3OTG_REF>, <&cru SCLK_USB3OTG_SUSPEND>, > > <&cru ACLK_USB3OTG>; > > clock-names = "ref_clk", "suspend_clk", > > "bus_clk"; > > #address-cells = <2>; > > #size-cells = <2>; > > ranges; > > status = "okay"; > > > > usbdrd_dwc3: dwc3@ff600000 { > > compatible = "snps,dwc3"; > > reg = <0x0 0xff600000 0x0 0x100000>; > > interrupts = ; > > dr_mode = "host"; > > phy_type = "utmi_wide"; > > snps,dis_enblslpm_quirk; > > snps,dis-u2-freeclk-exists-quirk; > > snps,dis_u2_susphy_quirk; > > snps,dis_u3_susphy_quirk; > > snps,dis-del-phy-power-chg-quirk; > > snps,dis-tx-ipgap-linecheck-quirk; > > status = "okay"; > > }; > > }; > > > > which looks to me to likely now conflict with the below --given > > the added "host" usage as of 5.14 reported above: > > > > /usr/main-src/sys/contrib/device-tree/src/arm64/rockchip/rk3328.dtsi > > > > that, as of the 5.13 import, has: > > > > usbdrd3: usb@ff600000 { > > compatible = "rockchip,rk3328-dwc3", "snps,dwc3"; > > reg = <0x0 0xff600000 0x0 0x100000>; > > interrupts = ; > > clocks = <&cru SCLK_USB3OTG_REF>, <&cru SCLK_USB3OTG_SUSPEND>, > > <&cru ACLK_USB3OTG>; > > clock-names = "ref_clk", "suspend_clk", > > "bus_clk"; > > dr_mode = "otg"; > > phy_type = "utmi_wide"; > > snps,dis-del-phy-power-chg-quirk; > > snps,dis_enblslpm_quirk; > > snps,dis-tx-ipgap-linecheck-quirk; > > snps,dis-u2-freeclk-exists-quirk; > > snps,dis_u2_susphy_quirk; > > snps,dis_u3_susphy_quirk; > > status = "disabled"; > > }; > > > > My guess would be that some kernel changes are required > > in order to track this structural changes, not just > > avoiding the old .dtbo . Testing showed that disabling > > the load of the .dtbo was insufficient to fix things. > > FYI: > > The mainline Linux commit that addeed usbdrd3 to > arch/arm64/boot/dts/rockchip/rk3328.dtsi is the > following from 2021-03-24: > > https://github.com/torvalds/linux/commit/44dd5e2106dc2fd01697b539085818d1d1c58df0 > > The mainline Linux commit that added the enabling of > the USB3 host mode in > arch/arm64/boot/dts/rockchip/rk3328-rock64.dts > is the following from 2021-05-01: > > https://github.com/torvalds/linux/commit/bbac8bd65f5402281cb7b0452c1c5f367387b459 > > === > Mark Millard > marklmi at yahoo.com > > Hi Mark, See https://reviews.freebsd.org/D37392 (and child reviews) for a fix. This was indeed the import of the new DTS files that caused the first problem (there is no glue node in rk3328.dtsi like in other SoCs or like our overlay). The other commit responsible for breaking USB3 support was the addition to RK356x SoC, the check was bad for when to force USB2. Cheers, -- Emmanuel Vadot