From nobody Tue Nov 15 23:06:24 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 4NBhdJ3gFGz4dKZJ for ; Tue, 15 Nov 2022 23:06:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-21.consmr.mail.gq1.yahoo.com (sonic305-21.consmr.mail.gq1.yahoo.com [98.137.64.84]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NBhdJ0FCLz3Ksc for ; Tue, 15 Nov 2022 23:06:43 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668553602; bh=aZr/PPgWt5Izdv0zLU7JG+Xr95g1vfJdPmlHHq1jlGw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=BsYnDsPA+UiRAmN07FpO02tIhxRusEp8yqpI/PGPXwMHZEgsLXjW5PkDxyWA0iJqqNnXQGHPtN0G3RWA/Afg75PyeWcbClYkyeLNFV4oKi5F5pKxNAiw2GCsVXCbL4jSycm1ftbVqiTq2Uq+GtlK88xL4qBVzDJKYldx7KPEZmtmdV0hr/ez5O0zOKJniXYGr0VDE/r8JvuDztWvz3thbdhHsTgDEkoIYACc2d5qEpxOGybhNCseW8E9WOZQnz52P0jOhFyO222hi5hT5CLTpX/PvI0srtuiMX050rJnXRgA3gENe4Q0525RwA5bp8yJnDYrU9qI2ejRJ2kx8FmDzg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668553602; bh=u6KB6cixLOliqdtDiOp0sSYPN/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iB6WdYvjN312LdYiTn79ISIicZ8azXI5TxYvt0bOxcO8Qsb2O1Yxwu4fJMqci4 v0yIdOasvH_ZbBTDd2ACC65pPAPTB3jb43vXCYbgm9pRYeaSCjEilVTJ99P_XdBfg3kpTe8X5iu6 dcZSpKavmCg0ReMQK7yPPlDxug_TKhVlav8Us9hZygu1PXjZ4ODRsN0U6qUMiCiVqntXvQMWSsnf Uaiqo1V1IS5KUdus6j2hIBuLNiWSG.WzoE8jeSyD.43qV5w2dXPrO5Bf4IDYJ4Sz3_Jg1bzIV4E1 mmWQvzG8j1ANMP_4Id9sV0FxFHCZUna9NUHNJdIXYqPKvJIItU6Eq7nl3OqtjoesQKJraicvIMhn 0o1Ls5SNkA4DJKXdTEdyByQZ90DoTro2gZE3xF3_tteKzhGdiAX9fUAPG4auHgw.tlWbYUfx4dHF _nZxWptnv6kAyRKVTAfoccm2HO2k0OIh7getrEIMFT2FRYNcZnyuNMMmFKdI46tnffr9pDnqt2YA mIk.j9VmW82vOEvMi5jczmXiKw2Bg95JxiceU55zxBSiL5xUlOFhimXn7P0sGQzXX8W2TyNBPZiT p X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.gq1.yahoo.com with HTTP; Tue, 15 Nov 2022 23:06:42 +0000 Received: by hermes--production-bf1-5878955b5f-pzkd6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1986155e279fadc8debd680359835dc3; Tue, 15 Nov 2022 23:06:37 +0000 (UTC) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) 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) From: Mark Millard In-Reply-To: <20221115221236.6c93f74861e2e58f3aa5a2e9@bidouilliste.com> Date: Tue, 15 Nov 2022 15:06:24 -0800 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: References: <8A639ABB-D8CC-47D6-A106-A5E2463E7AEE@yahoo.com> <665C125A-3E2B-408F-8F6E-B2D23237F06A@yahoo.com> <20221115140522.f94fa1cb62131b6591a073f0@bidouilliste.com> <041B0111-7D71-4FBF-B661-E03F2CCD7D9A@yahoo.com> <20221115221236.6c93f74861e2e58f3aa5a2e9@bidouilliste.com> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3731.200.110.1.12) X-Rspamd-Queue-Id: 4NBhdJ0FCLz3Ksc X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Nov 15, 2022, at 13:12, Emmanuel Vadot wrote: > On Tue, 15 Nov 2022 13:03:45 -0800 > Mark Millard wrote: >=20 >> On Nov 15, 2022, at 05:05, Emmanuel Vadot = wrote: >>=20 >>> On Fri, 4 Nov 2022 12:31:51 -0700 >>> Mark Millard wrote: >>>=20 >>>> On 2022-Oct-22, at 23:00, Mark Millard wrote: >>>>=20 >>>>> Well, turns out that part of the "Import device-tree files >>>>> from Linux 5.14" is: >>>>>=20 >>>>> = https://cgit.freebsd.org/src/commit/sys/contrib/device-tree/src/arm64/rock= chip/rk3328-rock64.dts?id=3D5956d97f4b32 >>>>>=20 >>>>> which has: >>>>> . . . >>>>=20 >>>>=20 >>>=20 >>> Hi Mark, >>>=20 >>> 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. >>=20 >> Thanks. >>=20 >> I applied the diff and the 2 child diff's and rebuilt and >> installed, including updating the kernel on the e.MMC that >> is historically used to mount the rootfs on USB3 when the >> USB3 drive is plugged in there. (U-boot does not handle >> the USB context I want.) >>=20 >> . . . >>=20 >>=20 >=20 > Looks like you're missing https://reviews.freebsd.org/D37394 Hopefully this time I have all the childern, grandchildern, etc. Sorry for the screwup. But the behavior observed is unchanged in this attempt. A diff of the console output of booting via USB2 this time vs. the prior report's USB3 failure log reveals no differences between the latter part of the block of: clknode_link_recalc: Attempt to use unresolved linked clock: hdmi_phy Cannot get frequency for clk: hdmi_phy, error: 9 and the later: Trying to mount root from ufs:/dev/gpt/Rock64root []... uhub2: 1 port with 1 removable, self powered uhub1: 1 port with 1 removable, self powered uhub0: 1 port with 1 removable, self powered No DWC3, XHCI, etc. But a boot -v does report: ofwbus0: mem 0xff600000-0xff6fffff irq 50 compat = rockchip,rk3328-xhci (no driver attached) Note the "xhci" instead of "dwc3". The overall list of no driver notices that do not mention "disabled" is listed below. It does reference a "rockchip,rk3328-usb2phy" as well as the above. ofwbus0: compat operating-points-v2 (no driver attached) ofwbus0: compat rockchip,display-subsystem (no = driver attached) ofwbus0: mem 0xff030000-0xff030fff irq 11 compat = rockchip,rk3328-spdif (no driver attached) ofwbus0: mem 0xff040000-0xff040fff disabled compat = rockchip,pdm (no driver attached) rk_grf0: mem 0xff100000-0xff100fff compat = rockchip,rk3328-io-voltage-domain (no driver attached) rk_grf0: mem 0xff100000-0xff100fff compat = rockchip,rk3328-grf-gpio (no driver attached) rk_grf0: mem 0xff100000-0xff100fff compat = rockchip,rk3328-power-controller (no driver attached) rk_grf0: mem 0xff100000-0xff100fff compat = syscon-reboot-mode (no driver attached) ofwbus0: mem 0xff1a0000-0xff1a00ff irq 20 compat = rockchip,rk3328-wdt (no driver attached) ofwbus0: mem 0xff1f0000-0xff1f3fff irq 22,23 compat = arm,pl330 (no driver attached) ofwbus0: mem 0xff260000-0xff26004f compat = rockchip,rk3328-efuse (no driver attached) ofwbus0: mem 0xff300000-0xff33ffff irq = 26,27,28,29,30,31,32 compat rockchip,rk3328-mali (no driver attached) ofwbus0: mem 0xff350000-0xff3507ff irq 35 compat = rockchip,rk3328-vpu (no driver attached) ofwbus0: mem 0xff350800-0xff35083f irq 36 compat = rockchip,iommu (no driver attached) ofwbus0: mem 0xff370000-0xff373efb irq 38 compat = rockchip,rk3328-vop (no driver attached) ofwbus0: mem 0xff373f00-0xff373fff irq 39 compat = rockchip,iommu (no driver attached) ofwbus0: mem 0xff3c0000-0xff3dffff irq 40,41 compat = rockchip,rk3328-dw-hdmi (no driver attached) ofwbus0: mem 0xff410000-0xff410fff compat = rockchip,rk3328-codec (no driver attached) ofwbus0: mem 0xff430000-0xff43ffff irq 42 compat = rockchip,rk3328-hdmi-phy (no driver attached) simple_mfd0: mem 0-0xff44ffff,0-0xffff compat = rockchip,rk3328-usb2phy (no driver attached) ofwbus0: mem 0xff600000-0xff6fffff irq 50 compat = rockchip,rk3328-xhci (no driver attached) ofwbus0: compat gpio-ir-receiver (no driver attached) ofwbus0: compat linux,spdif-dit (no driver attached) ofwbus0: mem = 0xff400000-0xff400fff,0xff780000-0xff782fff,0xff100000-0xff100fff,0xff4400= 00-0xff440fff,0xff720000-0xff720fff,0xff798000-0xff798fff compat = rockchip,rk3328-dmc (no driver attached) ofwbus0: compat u-boot,sysinfo-smbios (no driver attached) pcm0: no driver attached to codec node pcm1: no driver attached to codec node pcm2: no driver attached to cpu node For reference: # git -C /usr/main-src/ diff sys/dev/usb/controller/ sys/arm64/rockchip/ = sys/dts/ sys/modules/ diff --git a/sys/arm64/rockchip/rk_dwc3.c b/sys/arm64/rockchip/rk_dwc3.c index 8582f7a86999..645a1cffbd95 100644 --- a/sys/arm64/rockchip/rk_dwc3.c +++ b/sys/arm64/rockchip/rk_dwc3.c @@ -54,12 +54,10 @@ __FBSDID("$FreeBSD$"); #include =20 enum rk_dwc3_type { - RK3328 =3D 1, - RK3399, + RK3399 =3D 1, }; =20 static struct ofw_compat_data compat_data[] =3D { - { "rockchip,rk3328-dwc3", RK3328 }, { "rockchip,rk3399-dwc3", RK3399 }, { NULL, 0 } }; diff --git a/sys/dev/usb/controller/dwc3.c = b/sys/dev/usb/controller/dwc3.c index 2e8f868bc47b..d5e3b3f50a9d 100644 --- a/sys/dev/usb/controller/dwc3.c +++ b/sys/dev/usb/controller/dwc3.c @@ -86,6 +86,14 @@ struct snps_dwc3_softc { bus_space_tag_t bst; bus_space_handle_t bsh; uint32_t snpsid; + uint32_t snpsversion; + uint32_t snpsrevision; + uint32_t snpsversion_type; +#ifdef FDT + clk_t clk_ref; + clk_t clk_suspend; + clk_t clk_bus; +#endif }; =20 #define DWC3_WRITE(_sc, _off, _val) \ @@ -384,8 +392,31 @@ snps_dwc3_common_attach(device_t dev, bool is_fdt) sc->bsh =3D rman_get_bushandle(sc->mem_res); =20 sc->snpsid =3D DWC3_READ(sc, DWC3_GSNPSID); - if (bootverbose) - device_printf(sc->dev, "snps id: %#012x\n", sc->snpsid); + sc->snpsversion =3D DWC3_VERSION(sc->snpsid); + sc->snpsrevision =3D DWC3_REVISION(sc->snpsid); + if (sc->snpsversion =3D=3D DWC3_1_IP_ID || + sc->snpsversion =3D=3D DWC3_2_IP_ID) { + sc->snpsrevision =3D DWC3_READ(sc, DWC3_1_VER_NUMBER); + sc->snpsversion_type =3D DWC3_READ(sc, DWC3_1_VER_TYPE); + } + if (bootverbose) { + switch (sc->snpsversion) { + case DWC3_IP_ID: + device_printf(sc->dev, "SNPS Version: DWC3 (%x = %x)\n", + sc->snpsversion, sc->snpsrevision); + break; + case DWC3_1_IP_ID: + device_printf(sc->dev, "SNPS Version: DWC3.1 (%x = %x %x)\n", + sc->snpsversion, sc->snpsrevision, + sc->snpsversion_type); + break; + case DWC3_2_IP_ID: + device_printf(sc->dev, "SNPS Version: DWC3.2 (%x = %x %x)\n", + sc->snpsversion, sc->snpsrevision, + sc->snpsversion_type); + break; + } + } #ifdef DWC3_DEBUG snps_dwc3_dump_ctrlparams(sc); #endif @@ -394,9 +425,32 @@ snps_dwc3_common_attach(device_t dev, bool is_fdt) if (!is_fdt) goto skip_phys; =20 - /* Get the phys */ node =3D ofw_bus_get_node(dev); =20 + /* Get the clocks if any */ + if (ofw_bus_is_compatible(dev, "rockchip,rk3328-dwc3") =3D=3D 1) = { + if (clk_get_by_ofw_name(dev, node, "ref_clk", = &sc->clk_ref) !=3D 0) + device_printf(dev, "Cannot get ref_clk\n"); + if (clk_get_by_ofw_name(dev, node, "suspend_clk", = &sc->clk_suspend) !=3D 0) + device_printf(dev, "Cannot get suspend_clk\n"); + if (clk_get_by_ofw_name(dev, node, "bus_clk", = &sc->clk_bus) !=3D 0) + device_printf(dev, "Cannot get bus_clk\n"); + } + + if (sc->clk_ref !=3D NULL) { + if (clk_enable(sc->clk_ref) !=3D 0) + device_printf(dev, "Cannot enable ref_clk\n"); + } + if (sc->clk_suspend !=3D NULL) { + if (clk_enable(sc->clk_suspend) !=3D 0) + device_printf(dev, "Cannot enable = suspend_clk\n"); + } + if (sc->clk_bus !=3D NULL) { + if (clk_enable(sc->clk_bus) !=3D 0) + device_printf(dev, "Cannot enable bus_clk\n"); + } + + /* Get the phys */ usb2_phy =3D usb3_phy =3D NULL; error =3D phy_get_by_ofw_name(dev, node, "usb2-phy", &usb2_phy); if (error =3D=3D 0 && usb2_phy !=3D NULL) @@ -404,12 +458,19 @@ snps_dwc3_common_attach(device_t dev, bool is_fdt) error =3D phy_get_by_ofw_name(dev, node, "usb3-phy", &usb3_phy); if (error =3D=3D 0 && usb3_phy !=3D NULL) phy_enable(usb3_phy); - else { - reg =3D DWC3_READ(sc, DWC3_GUCTL1); - if (bootverbose) - device_printf(dev, "Forcing USB2 clock only\n"); - reg |=3D DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK; - DWC3_WRITE(sc, DWC3_GUCTL1, reg); + if (sc->snpsversion =3D=3D DWC3_IP_ID) { + if (sc->snpsrevision >=3D 0x290A) { + uint32_t hwparams3; + + hwparams3 =3D DWC3_READ(sc, DWC3_GHWPARAMS3); + if (DWC3_HWPARAMS3_SSPHY(hwparams3) =3D=3D = DWC3_HWPARAMS3_SSPHY_DISABLE) { + reg =3D DWC3_READ(sc, DWC3_GUCTL1); + if (bootverbose) + device_printf(dev, "Forcing USB2 = clock only\n"); + reg |=3D = DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK; + DWC3_WRITE(sc, DWC3_GUCTL1, reg); + } + } } snps_dwc3_configure_phy(sc, node); skip_phys: @@ -427,6 +488,16 @@ snps_dwc3_common_attach(device_t dev, bool is_fdt) snsp_dwc3_dump_regs(sc, "Post XHCI init"); #endif =20 +#ifdef FDT + if (error) { + if (sc->clk_ref !=3D NULL) + clk_disable(sc->clk_ref); + if (sc->clk_suspend !=3D NULL) + clk_disable(sc->clk_suspend); + if (sc->clk_bus !=3D NULL) + clk_disable(sc->clk_bus); + } +#endif return (error); } =20 diff --git a/sys/dev/usb/controller/dwc3.h = b/sys/dev/usb/controller/dwc3.h index 21a87a1917ee..fd61d1129df3 100644 --- a/sys/dev/usb/controller/dwc3.h +++ b/sys/dev/usb/controller/dwc3.h @@ -31,6 +31,15 @@ #ifndef _DWC3_H_ #define _DWC3_H_ =20 +#define DWC3_IP_ID 0x5533 +#define DWC3_1_IP_ID 0x3331 +#define DWC3_2_IP_ID 0x3332 + +#define DWC3_VERSION_MASK 0xFFFF0000 +#define DWC3_REVISION_MASK 0xFFFF +#define DWC3_VERSION(x) (((x) & DWC3_VERSION_MASK) >> = 16) +#define DWC3_REVISION(x) ((x) & DWC3_REVISION_MASK) + #define DWC3_GSBUSCFG0 0xc100 #define DWC3_GSBUSCFG1 0xc104 #define DWC3_GTXTHRCFG 0xc108 @@ -80,6 +89,9 @@ #define DWC3_GPRTBIMAP_HSLO 0xc180 #define DWC3_GPRTBIMAP_FSLO 0xc188 =20 +#define DWC3_1_VER_NUMBER 0xc1a0 +#define DWC3_1_VER_TYPE 0xc1a4 + #define DWC3_GUSB2PHYCFG0 0xc200 #define DWC3_GUSB2PHYCFG0_PHYSOFTRST (1 << 31) #define DWC3_GUSB2PHYCFG0_U2_FREECLK_EXISTS (1 << 30) @@ -98,6 +110,11 @@ #define DWC3_GUSB3PIPECTL0_DELAYP1TRANS (1 << 18) #define DWC3_GUSB3PIPECTL0_SUSPENDUSB3 (1 << 17) =20 +#define DWC3_HWPARAMS3_SSPHY(x) (x & 0x3) +#define DWC3_HWPARAMS3_SSPHY_DISABLE 0 +#define DWC3_HWPARAMS3_SSPHY_GEN1 1 +#define DWC3_HWPARAMS3_SSPHY_GEN2 2 + #define DWC3_GTXFIFOSIZ(x) (0xc300 + 0x4 * (x)) #define DWC3_GRXFIFOSIZ(x) (0xc380 + 0x4 * (x)) #define DWC3_GEVNTADRLO0 0xc400 diff --git a/sys/dts/arm64/overlays/rk3328-dwc3.dtso = b/sys/dts/arm64/overlays/rk3328-dwc3.dtso deleted file mode 100644 index bade60b60d57..000000000000 --- a/sys/dts/arm64/overlays/rk3328-dwc3.dtso +++ /dev/null @@ -1,39 +0,0 @@ -/dts-v1/; -/plugin/; - -#include -#include -#include - -/ { - compatible =3D "rockchip,rk3328"; -}; - -&{/} { - usbdrd3: usb@ff600000 { - compatible =3D "rockchip,rk3328-dwc3"; - clocks =3D <&cru SCLK_USB3OTG_REF>, <&cru = SCLK_USB3OTG_SUSPEND>, - <&cru ACLK_USB3OTG>; - clock-names =3D "ref_clk", "suspend_clk", - "bus_clk"; - #address-cells =3D <2>; - #size-cells =3D <2>; - ranges; - status =3D "okay"; - - usbdrd_dwc3: dwc3@ff600000 { - compatible =3D "snps,dwc3"; - reg =3D <0x0 0xff600000 0x0 0x100000>; - interrupts =3D ; - dr_mode =3D "host"; - phy_type =3D "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 =3D "okay"; - }; - }; -}; diff --git a/sys/modules/dtb/rockchip/Makefile = b/sys/modules/dtb/rockchip/Makefile index 1e0c6a2d4362..4f4a21f51a39 100644 --- a/sys/modules/dtb/rockchip/Makefile +++ b/sys/modules/dtb/rockchip/Makefile @@ -22,7 +22,6 @@ DTS=3D \ DTSO=3D rk3328-analog-sound.dtso \ rk3328-i2c0.dtso \ rk3328-uart1.dtso \ - rk3328-dwc3.dtso \ rk3399-mmc0-disable.dtso \ rk3399-mmc1-disable.dtso \ rk3399-sdhci-disable.dtso =3D=3D=3D Mark Millard marklmi at yahoo.com