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 <marklmi_at_yahoo.com>
Date: Sun, 23 Oct 2022 06:00:19 UTC
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 = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
                        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 = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
                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.

===
Mark Millard
marklmi at yahoo.com