Thanks to @Oleksii for figuring out that the issue is that the USB-C controller is set to OTG mode rather than host mode.
This is illustrated by the rk3399-nanopc-t4.dtb which, when decompiled, contains the following:
usb@fe800000 {
compatible = "rockchip,rk3399-dwc3";
#address-cells = < 0x02 >;
#size-cells = < 0x02 >;
ranges;
clocks = < 0x08 0x81 0x08 0x83 0x08 0xf6 0x08 0xf8 0x08 0xf4 0x08 0xf9 >;
clock-names = "ref_clk\0suspend_clk\0bus_clk\0aclk_usb3_rksoc_axi_perf\0aclk_usb3\0grf_clk";
resets = < 0x08 0x125 >;
reset-names = "usb3-otg";
status = "okay";
phandle = < 0xd6 >;
usb@fe800000 {
compatible = "snps,dwc3";
reg = < 0x00 0xfe800000 0x00 0x100000 >;
interrupts = < 0x00 0x69 0x04 0x00 >;
clocks = < 0x08 0x81 0x08 0xf6 0x08 0x83 >;
clock-names = "ref\0bus_early\0suspend";
dr_mode = "otg";
phys = < 0x33 0x34 >;
phy-names = "usb2-phy\0usb3-phy";
phy_type = "utmi_wide";
snps,dis_enblslpm_quirk;
snps,dis-u2-freeclk-exists-quirk;
snps,dis_u2_susphy_quirk;
snps,dis-del-phy-power-chg-quirk;
snps,dis-tx-ipgap-linecheck-quirk;
power-domains = < 0x1a 0x18 >;
status = "okay";
phandle = < 0xd7 >;
};
};
So, as @Oleksii pointed out, dr_mode is set to "otg" rather than "host", and that is why the USB-C port is treated as a USB peripheral rather than a USB host, and why you can't get any device plugged onto that port to be recognized.
The solution is fairly simple:
Create a rockchip-usb-c-host.dts file in /boot/dtb/rockchip/overlay with the following content:
/dts-v1/;
/plugin/;
/ {
compatible = "rockchip,rk3399";
fragment@0 {
target = <&usbdrd_dwc3_0>;
__overlay__ {
dr_mode = "host";
};
};
};
Issue the command:
armbian-add-overlay rockchip-usb-c-host.dts
Reboot as asked. Devices plugged into the USB-C port should now be detected. You can also verify that the USB-C port is set to host mode by issuing:
cat /sys/firmware/devicetree/base/usb@fe800000/usb@fe800000/dr_mode
which should now report host rather than otg.
I'll see if I can create a Pull Request to generate this .dtbo in https://github.com/armbian/build/blob/master/patch/kernel/rockchip64-dev/general-rockchip-overlays.patch.