We have a requirement to enable console access through USB-C interface.
I have updated device tree with dr_mode = "peripheral" and enabled USB Serial Gadget support in kernel configuration.
However, It shows the below error while loading the serial gadget driver.
[ 340.488679] udc-core: couldn't find an available UDC - added [g_serial] to list of pending drivers
$/proc/device-tree/soc/usb@3100000# cat dr_mode
peripheral
/sys/class/udc is empty
I've updated Device Tree as below.
/* USB */
&usb0 {
dr_mode = "peripheral";
maximum-speed = "super-speed";
status = "okay";
};
&usb1 {
status = "okay";
};
dmesg logs:
root@tigershark:/proc/device-tree/soc/usb@3100000# dmesg | grep dwc
[ 3.684912] dwc3 3100000.usb: Adding to iommu group 2
[ 3.690003] dwc3 3100000.usb: Failed to get clk 'ref': -2
[ 3.695417] dwc3 3100000.usb: Configuration mismatch. dr_mode forced to host
[ 3.702690] dwc3 3110000.usb: Adding to iommu group 3
[ 3.707762] dwc3 3110000.usb: Failed to get clk 'ref': -2
Update Kernel menuconfig to enable serial gadget and loaded below kernel modules.
modprobe libcomposite.ko
modprobe u_serial.ko
modprobe usb_f_acm.ko
modprobe usb_f_obex.ko
modprobe usb_f_serial.ko
modprobe g_serial.ko
[ 340.488679] udc-core: couldn't find an available UDC - added [g_serial] to list of pending drivers
Solved! Go to Solution.
Please configure USB_DWC3_DUAL_ROLE=y in your Linux Kernel configuration file.
Please configure USB_DWC3_DUAL_ROLE=y in your Linux Kernel configuration file.
Thanks Yiping. I could enable USB serial gadget (ttyGS0) on lx2160a after enabling USB_DWC3_DUAL_ROLE=y in kernel configuration.