LS1012a peripheral mode gadget ethernet not working as per section 6.9.3 of SDK doc

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

LS1012a peripheral mode gadget ethernet not working as per section 6.9.3 of SDK doc

1,726 Views
daviddailey
Contributor I

I have a custom LS1012A board that is very similar to the FRDM board, just with USB connected in device(peripheral) mode.  In section 6.9.3 of SDK 0.4 doc, it describes connecting device ethernet over USB using g_ether module.  I see multiple issues. First the " USB Peripheral Controller (Freescale Highspeed USB DR Peripheral Controller) --->" option is not available in LAYERSCAPE processors, so it cannot be selected in the kernel as directed.  If I change Kconfig in kernel to allow fsl_usb2_udc.ko to build, it will not build without errors.  So I try the instructions without this module, and g_ether module fails to load.  The u_rndis module is also not present and I do not see this in the kernel selections.  I have confirmed the bootargs have the usb peripheral mode selected as shown below.  The device tree entries for usb follow the FRDM reference board, and the peripheral mode is selected by the bootargs I show below rather than changing the device tree.

root@ls1012afrdm:~# modprobe udc-core
root@ls1012afrdm:~# modprobe configfs
root@ls1012afrdm:~# modprobe libcomposite
root@ls1012afrdm:~# modprobe u_ether
root@ls1012afrdm:~# modprobe u_rndis
modprobe: FATAL: Module u_rndis not found.
root@ls1012afrdm:~# modprobe usb_f_rndis
root@ls1012afrdm:~# modprobe usb_f_ecm
root@ls1012afrdm:~# modprobe usb_f_ecm_subset
root@ls1012afrdm:~# modprobe g_ether
modprobe: ERROR: could not insert 'g_ether': No such device
root@ls1012afrdm:~# cat /proc/cmdline
console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 fsl_ddr:bank_intlv=auto usb1:dr_mode=peripheral,phy_type=ulpi

Can you show me the correct configuration/commands to get device mode ethernet working on a system similar to the FRDM?

Thank you.

Dave

0 Kudos
4 Replies

921 Views
Pavel
NXP Employee
NXP Employee

It looks like that this the "USB Peripheral Controller (Freescale Highspeed USB DR Peripheral Controller) --->" option is not needed. The LS1012a USB 3.0 controller is not high-speed USB DR controller.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

921 Views
daviddailey
Contributor I

Found the solution was the VBUS pin was not powered when in device mode.  Now I can use usb0 with hw changes.  However it seems to intermittently fail to transfer to some hosts from boot to boot.  But it seems fundamental issue is solved.

0 Kudos

921 Views
daviddailey
Contributor I

Update - I get g_ether to load now after enabling "DWC3 Mode Selection" to gadget only in the kernel, but the device is not seen still by lsusb on the host side.  I also tried statically linking kernel modules but it still doesn't show from host lsusb.

root@ls1012a:~# modprobe g_ether
root@ls1012a:~# lsmod
Module Size Used by
usb_f_ecm 7862 1
g_ether 5911 0
usb_f_rndis 17859 2 g_ether
u_ether 14019 3 usb_f_ecm,usb_f_rndis,g_ether
libcomposite 48299 3 usb_f_ecm,usb_f_rndis,g_ether
configfs 27030 4 usb_f_ecm,usb_f_rndis,libcomposite
bridge 89592 0
stp 2331 1 bridge
llc 5944 2 stp,bridge
pfe 84718 0
root@ls1012a:~# cat /proc/cmdline
root=/dev/mmcblk0p1 rw rootwait console=ttyS0,115200 earlycon=uart8...


--------
HNT:/etc/init.d# lsusb
Bus 002 Device 011: ID 0403:6015 Future Technology Devices International, Ltd
Bus 002 Device 010: ID 0424:2412 Standard Microsystems Corp.
Bus 002 Device 004: ID 148f:3572 Ralink Technology, Corp. RT3572 Wireless Adapte
r
Bus 002 Device 002: ID 0424:2412 Standard Microsystems Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

0 Kudos

921 Views
daviddailey
Contributor I

Another update.  I have put the same dtb and kernel on a FRDM reference board, and the USB3 peripheral mode does not seem to work there either.  I see the usb0 network interface and all the right messages, but the USB devices is not seen by lsusb on the host side.  I have verified the host with another platform that uses g_ether.  Has peripheral mode been tested on a FRDM platform?

[ 1.924607] usbcore: registered new interface driver usb-storage
[ 1.930899] using random self ethernet address
[ 1.935353] using random host ethernet address
[ 1.940427] usb0: HOST MAC be:91:5f:ef:9e:3c
[ 1.944896] usb0: MAC e2:f1:14:b7:f5:bd
[ 1.948763] using random self ethernet address
[ 1.953266] using random host ethernet address
[ 1.957763] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[ 1.964464] g_ether gadget: g_ether ready

dtsi file content:

usb@8600000 {
compatible = "fsl-usb2-dr-v2.5", "fsl-usb2-dr";
reg = <0x0 0x8600000 0x0 0x1000>;
interrupts = <0 139 0x4>;
dr_mode = "host";
phy_type = "ulpi";
fsl,usb-erratum-a005697;
};

usb0: usb3@2f00000 {
compatible = "snps,dwc3";
reg = <0x0 0x2f00000 0x0 0x10000>;
interrupts = <0 60 0x4>;
dr_mode = "peripheral";
configure-gfladj;
snps,dis_rxdet_inp3_quirk;
};

0 Kudos