I would like to know if it is possible to ensure that during boot up, the USB OTG on the Apalis T30 remains as a DEVICE and never switches over to a HOST.
The reason why I ask this is that we have a USB-to-ethernet adapter which, when connected to the OTG port, enumerates during initialisation. However, once the kernel full boots and the OTG port goes back to device mode the USB-to-Ethernet device and its ethernet endpoint no longer function.
It would appear that at some point, the
tegra-otg driver swaps to HOST initially, as the SMSC9500 device is enumerated (see log below) during boot.
At this point, the
eth0 endpoint no longer exists and the USB device remains in the
lsusb list. The only way to remove it is by rebooting the Apalis T30 module with the SMSC9500 device disconnected.
dmesg | tail -50:
[ 16.804205] Switched to NOHz mode on CPU #1
[ 17.168339] tegra-otg tegra-otg: HOST --> SUSPEND
[ 17.168412] tegra-ehci tegra-ehci.0: remove, state 1
[ 17.168438] usb usb3: USB disconnect, device number 1
[ 17.168446] usb 3-1: USB disconnect, device number 2
[ 17.168558] eth0: unregister 'smsc9500' usb-tegra-ehci.0-1, smsc9500 USB 2.0 Ethernet
[ 17.444221] usb 2-1: new high speed USB device number 3 using tegra-ehci
Bus 003 Device 002: ID 0424:9e00 Standard Microsystems Corp.
We manually control the driving of the “USB.ID” signal for the OTG via software so we can enforce when the USB OTG controller should swap to a HOST - the default activity should definitely be for it to remain as a DEVICE though.
Versions of things:
Apalis T30 1.1B
Thanks for writing to the Toradex community!
Could you provide the version of the hardware (including carrier board) and software of your module?
Thanks and best regards,
We’re using a custom carrier board with an Apalis T30 1.1B (I noted this in my original post).
Software-wise, we’re running Linux V2.5 however even using the latest V2.8 for the T30 makes no difference - this was built using OpenEmbedded.
Can anyone advise with regards to this issue, please?
In the newer kernel you can define a property in devicetree thus the USB OTG Port is defined as device only, but in the downstream kernel you have to change this in the kernel sources.
Thanks for your response. I don’t want the USB OTG port to be device only, but I do want it to be configured for device mode during boot up until the ID signal is triggered to switch to host mode.
I’ll do some digging into the USB OTG driver but if you are able to share any additional pointers as to where I may look, this would be most helpful.
My suspicion is that the
board-apalis_t30.c file is where I need to look, around line 1530-ish where the platform data struct is initialised for the USB OTG peripheral however I’m not 100% sure.
Actually for Apalis Standard, we are using true OTG, where a defined Pin should be controlled by carrier board. If this functionality is missing in your carrier board, then you could do the same implementation as Colibri Standard, thus compare the board-colibri_t30.c file with the one from Apalis to see the differences and then use a similar implemtation as Colibri Board for your case.