This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

J721EXSOMXEVM: USB as peripheral mode

Part Number: J721EXSOMXEVM

Hello,

I have a J7 board and USB1 connected to another Soc. I have to configure USB1 as a peripheral mode in J7 as the other side of USB is configured Host in other SoC.  I added the following DT entries to configure USB1 as a peripheral J7. 

&usbss1 {
	pinctrl-names = "default";
	status = "okay";
	ti,usb2-only;
};

&usb1 {
	pinctrl-names = "default";
	status = "okay";
	dr_mode = "peripheral";
	maximum-speed = "high-speed";
};

With these entries, I get these logs. However, I am expecting five ttyUSBX (0-4) under /dev directory.

[   10.853740] cdns-usb3 6400000.usb: DRD version v1 (ID: 0004024e, rev: 00000200)
[   11.026626] cdns-usb3 6400000.usb: Initialized  ep0 support:  
[   11.127164] cdns-usb3 6400000.usb: Initialized  ep1out support: BULK, INT ISO
[   11.231235] cdns-usb3 6400000.usb: Initialized  ep2out support: BULK, INT ISO
[   11.324873] cdns-usb3 6400000.usb: Initialized  ep3out support: BULK, INT ISO
[   11.387903] cdns-usb3 6400000.usb: Initialized  ep4out support: BULK, INT ISO
[   11.447621] cdns-usb3 6400000.usb: Initialized  ep5out support: BULK, INT ISO
[   11.477751] cdns-usb3 6400000.usb: Initialized  ep6out support: BULK, INT ISO
[   11.508373] cdns-usb3 6400000.usb: Initialized  ep7out support: BULK, INT ISO
[   11.557491] cdns-usb3 6400000.usb: Initialized  ep8out support: BULK, INT ISO
[   11.596567] cdns-usb3 6400000.usb: Initialized  ep9out support: BULK, INT ISO
[   11.678009] cdns-usb3 6400000.usb: Initialized  ep10out support: BULK, INT ISO
[   11.704986] cdns-usb3 6400000.usb: Initialized  ep11out support: BULK, INT ISO
[   11.829680] cdns-usb3 6400000.usb: Initialized  ep12out support: BULK, INT ISO
[   11.955461] cdns-usb3 6400000.usb: Initialized  ep13out support: BULK, INT ISO
[   12.016889] cdns-usb3 6400000.usb: Initialized  ep14out support: BULK, INT ISO
[   12.133274] cdns-usb3 6400000.usb: Initialized  ep15out support: BULK, INT ISO
[   12.212009] cdns-usb3 6400000.usb: Initialized  ep1in support: BULK, INT ISO
[   12.252501] cdns-usb3 6400000.usb: Initialized  ep2in support: BULK, INT ISO
[   12.282407] cdns-usb3 6400000.usb: Initialized  ep3in support: BULK, INT ISO
[   12.312079] cdns-usb3 6400000.usb: Initialized  ep4in support: BULK, INT ISO
[   12.335828] cdns-usb3 6400000.usb: Initialized  ep5in support: BULK, INT ISO
[   12.371663] cdns-usb3 6400000.usb: Initialized  ep6in support: BULK, INT ISO
[   12.399503] cdns-usb3 6400000.usb: Initialized  ep7in support: BULK, INT ISO
[   12.420599] cdns-usb3 6400000.usb: Initialized  ep8in support: BULK, INT ISO
[   12.435012] cdns-usb3 6400000.usb: Initialized  ep9in support: BULK, INT ISO
[   12.458886] cdns-usb3 6400000.usb: Initialized  ep10in support: BULK, INT ISO
[   12.493776] cdns-usb3 6400000.usb: Initialized  ep11in support: BULK, INT ISO
[   12.510580] cdns-usb3 6400000.usb: Initialized  ep12in support: BULK, INT ISO
[   12.526215] cdns-usb3 6400000.usb: Initialized  ep13in support: BULK, INT ISO
[   12.541388] cdns-usb3 6400000.usb: Initialized  ep14in support: BULK, INT ISO
[   12.564178] cdns-usb3 6400000.usb: Initialized  ep15in support: BULK, INT ISO

Could you please let me know - 

How to set USB1 as peripheral in J7?

What is the meaning of this log?

Thanks,

Satish

  • Hi Satish,

    The logs seen above are completely fine. This denotes that the USB driver has configured in device (peripheral) mode.

    At this point in time, you can load your preferred gadget driver.

    For example, if the "usb serial" support is desired, we can load the g_serial gadget driver with the below command:

    root@j7-evm:~# modprobe g_serial

    On a successful load, you would see below logs

     [ 1767.541181] g_serial gadget: Gadget Serial v2.4
    [ 1767.545753] g_serial gadget: g_serial ready
    [ 1768.199910] g_serial gadget: high-speed config #2: CDC ACM config6.

    Also if we call "ls /dev", we must see the entry /dev/ttyGS0

    On the host side, it must enumerate  a new device and when we call  "lsusb", we must see a new device listed there. Also if we call "ls /dev", we must see the entry /dev/ttyACM0

    For more info on this, you can read Linux Gadget Serial Driver v2.0 — The Linux Kernel documentation

    Thanks.