temporary disable USB interfaces to save power

Is it possible to disable USB interfaces on TX1 to save power at runtime?

Hi DmitriK,
By default this is not supported. You have to make USB controller driver loadable and do not load controller drivers (xHCI/EHCI) when not needed or unload controller drivers when not needed.

How to force USB2 mode only on specific port?

If the port supports USB3 you could use a USB2 HUB to limit to this. An example of something similar is that I have a USB1.1 HUB, and a breakout board for attaching a USB analyzer to this; the analyzer only goes up to USB1.1, which is why I use the HUB to limit speed.

If on the other hand you are trying to tell a port to never drop speed below USB2, then you can’t do this…the speed is negotiated with the device, and the fastest speed supported is used…if something drops below USB2 speed it is because it is not capable of USB2 and the only choice is to physically remove the device. An example of this being a problem is that some devices demand USB3 speed or they cannot do their job (e.g., fast/high-res video)…those devices will not support a USB2 interface and the device will not even be visible when connected to a USB2 port.

On the JTK1 the driver and port mapping of the full-size connector was shipped set for USB2, but could be configured to run with USB3 speed (kernel parameter “usb_port_owner_info” was set to “0” or “2” to configure the controller).

What do you specifically want to accomplish, removal of slower speeds, or removal of faster speeds?

I am trying to save power. I hope usb_port_owner_info will power off USB3 block.

Setting USB2 won’t save power. The usb_port_owner_info was about assigning which lanes and controllers are associated during boot…I don’t think you can actually turn off a port this way, at least not on demand.

Static, for specific port only. Not on demand.

I’ve only seen usb_port_owner_info as a way to select between USB2 and USB3 (such as to limit the port to USB2 from the prior question) at the moment of boot. If an invalid value is set it may just go to a default value, I don’t know. You could experiment and see if there is a value where plugging in a USB device does not produce a connect event (perhaps monitor “dmesg --follow” to watch as you plug in/unplug something to the port). Someone at NVIDIA could check if usb_port_owner_info has a value specifically for “no mapping…isolate the port or controller”.

Something to think about though…having the controller powered but not routed to a port is the same as having the port configured but nothing plugged in to the port (not routing to a port and not plugging something in to a port are essentially the same thing). Any attempt to isolate a port from connecting to a controller might not save power if the controller itself is still powered. It seems like what you want to do is not really a question of disabling the USB interface but instead controlling power rails to the USB controllers themselves.

I’m sure USB controllers have a standby state, it’s part of the USB specification since some peripherals like mouse and keyboard must have the option of waking up the system through a notification to the system’s own low-power/standby state. Even in such a state the specification says more about passing the state change on to peripherals and reducing current available to the port…I don’t think it says anything at all about the power consumed by the controller itself (this would be logical but I do not think it is defined in a standard). However, with no devices enumerated on the port I’d have to wonder if the USB controller ever leaves the low-power/standby state…if no devices are connected then there is no need to wake up (and conversely no need to sleep). I’m uncertain as to what you would do to test controller low-power/standby state to see if it is already in such a state, but there is probably something in “/sys/” you could verify this with.

How to disable USB3 and have only USB2 on TX1?

This worked on the TK1, and probably works on the TX1 (much of the structure of Tegra SoCs is constant…this part should match between TK1 and TX1). Look at “/boot/extlinux/extlinux.conf”. See the “usb_port_owner_info=0” parameter of the APPEND key/value pair. Change the “0” to “2”. After boot verify all root hubs are speed “480M” via “lsusb -t”. Or the reverse…not sure…if it is 0 edit it to 2, if it is 2, edit to 0.