How to configure LS1021A in USB Gadget mode serial port (legacy g_serial)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure LS1021A in USB Gadget mode serial port (legacy g_serial)

576 Views
janakw
Contributor I

I am trying to get USB gadget serial port (using legacy/g_serial.ko) up in our custom board based on LS1021a-twr. Current linux kernel is based on NXP tag lf-5.15.32-2.0.0 When I insert g_serial.ko module I get below error. #insmod g_serial.ko root@ls1021atwr:/lib/modules/5.15[ 6609.125266] udc-core: couldn't find an available UDC - added [g_serial] to list of pending drivers.

I tried to follow NXP article hoping it will insert any missing dependencies. https://docs.nxp.com/bundle/GUID-C241BB12-95F6-4D6B-A205-7EFD35551DE2/page/GUID-FFE157FA-E8DF-4494-8... In there it mentions to set, CONFIG_USB_FSL_MPH_DR_OF (Enable NXP EHCI USB controller) However I cannot see this option available in kernel config. I cannot find this kernel source file included either, "drivers/usb/gadget/fsl_usb2_udc.c", as mentioned in the same article.

0 Kudos
Reply
1 Reply

554 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following procedure

     Update kernel menuconfig

yipingwang_0-1675324680090.png

 

yipingwang_1-1675324680432.png

 

yipingwang_2-1675324680385.png

 

Device tree

Device Tree update, change property dr_mode’s data from “host” to “peripheral”, add property maximum-speed = “super-speed”; as below

yipingwang_3-1675324680382.png

 

 

Build whole Linux kernel, below KO will be compiled:

LD [M] drivers/usb/gadget/function/usb_f_acm.ko

LD [M] drivers/usb/gadget/function/u_serial.ko

LD [M] drivers/usb/gadget/function/usb_f_obex.ko

LD [M] drivers/usb/gadget/function/usb_f_serial.ko

LD [M] drivers/usb/gadget/legacy/g_serial.ko

 

Insmod ko on Layerscape board console

insmod libcomposite.ko

insmod u_serial.ko

insmod usb_f_acm.ko

insmod usb_f_obex.ko

insmod usb_f_serial.ko

insmod g_serial.ko

 

yipingwang_4-1675324679740.png

 

 

0 Kudos
Reply