USB Load Switches

I don’t see a way to limit current on this board. If that is part of the standard, the Jetson module doesn’t seem to have a way to implement that sort of power control over its devices. The power supply can be either switched on or off, and the devices will draw what they will draw. If a device supports suspending itself, it can enter a low power state, otherwise there is no change. I verified this using a usb power meter. The wireless mouse dongle draws ~40 mA. On sleep it draws <10 mA. The USB camera draws ~290 mA, and on sleep it still draws ~290 mA.

I did make a mistake - I read the macro definitions of the POWER_DOMAIN registers as hexadecimal but they were decimal, so the hex representation in the .dsti source is accurate. Changing them to 0x20 etc., leads to disabled USB ports, but it does somewhat prove that it does what I want - those control the USB load switches.

Can anybody with Nvidia chime in and offer some guidance here?

I figured I’d chime in with another semi-related update… After doing a backup and flashing with the suggested command the .dtb hadn’t changed.

<b>Suggested</b> $ sudo ./flash.sh -r -k DTB -d /path/to/new/dtb jetson-tx1 mmcblk0p1

What I did that worked is renamed system.img and system.img.raw and renamed backup.img and backup.img.raw to take their place. Then running the flash script as:

<b>Works</b>
$ sudo ./flash.sh -r -k APP -G backup.img jetson-tx1 mmcblk0p1
$ mv bootloader/system.img bootloader/system.img.bak && mv system.img.raw system.img.raw.bak
$ mv backup.img bootloader/system.img && mv backup.img.raw bootloader system.img.raw
$ sudo ./flash.sh -r -d /path/to/new/dtb jetson-tx1 mmcblk0p1

The output is:

[   1.4027 ] Sending bootloader and pre-requisite binaries
[   1.4050 ] tegrarcm --download ebt cboot.bin 0 0 --download rp1 compiled.dtb 0
[   1.4071 ] Applet version 00.01.0000
[   1.4237 ] Sending ebt
[   1.4242 ] [................................................] 100%
[   1.5127 ] Sending rp1
[   1.5189 ] [................................................] 100%
[   1.6209 ] 
[   1.6210 ] Retrieving storage infomation
[   1.6235 ] tegrarcm --oem platformdetails storage storage_info.bin
[   1.6259 ] Applet version 00.01.0000
[   1.6440 ] Saved platform info in storage_info.bin
[   1.6910 ] 
[   1.6934 ] tegrarcm --boot recovery
[   1.6955 ] Applet version 00.01.0000
[   1.7124 ] 
[   1.7126 ] Flashing the device
[   1.7314 ] tegradevflash --pt flash.xml.bin --storageinfo storage_info.bin --create
[   1.7337 ] Cboot version 00.01.0000
[   2.4504 ] Writing partition GPT with gpt.bin
[   2.4510 ] [................................................] 100%
[   2.4552 ] Writing partition NVC with nvtboot.bin.encrypt
[   5.3189 ] [................................................] 100%
[   5.3340 ] Writing partition APP with system.img
[   5.3671 ] [................................................] 100%
[ 406.4826 ] Writing partition TBC with nvtboot_cpu.bin.encrypt
[ 408.4072 ] [................................................] 100%
[ 408.4646 ] Writing partition EBT with cboot.bin.encrypt
[ 408.4799 ] [................................................] 100%
[ 408.5152 ] Writing partition BPF with bpmp.bin
[ 408.5497 ] [................................................] 100%
[ 408.5679 ] Writing partition WB0 with warmboot.bin.encrypt
[ 408.5797 ] [................................................] 100%
[ 408.5869 ] Writing partition RP1 with compiled.dtb.encrypt
[ 408.5984 ] [................................................] 100%
[ 408.6400 ] Writing partition TOS with tos.img.encrypt
[ 408.6631 ] [................................................] 100%
[ 408.6713 ] Writing partition EKS with eks.img
[ 408.6829 ] [................................................] 100%
[ 408.6898 ] Writing partition BMP with bmp.blob
[ 408.7011 ] [................................................] 100%
[ 409.0542 ] Writing partition LNX with boot.img.encrypt
[ 409.4117 ] [................................................] 100%
[ 409.4537 ] Writing partition DTB with compiled.dtb.encrypt
[ 409.5062 ] [................................................] 100%
[ 409.5815 ] 
[ 409.5968 ] tegradevflash --write BCT P2180_A00_LP4_DSC_204Mhz.bct
[ 409.5990 ] Cboot version 00.01.0000
[ 409.6018 ] Writing partition BCT with P2180_A00_LP4_DSC_204Mhz.bct
[ 409.6027 ] [................................................] 100%
[ 409.7063 ] 
[ 409.7064 ] Flashing completed

[ 409.7066 ] Coldbooting the device
[ 409.7091 ] tegradevflash --reboot coldboot
[ 409.7114 ] Cboot version 00.01.0000
[ 409.7145 ] 
*** The target t210ref has been flashed successfully. ***
Reset the board to boot from internal eMMC.

Lines 18 and 28 both show the .dtb file (or some encrypted derivative?) were flashed to two partitions: DTB and RP1. Compared to the suggested command’s output, where DTB doesn’t appear to be written to:

[   1.5383 ] Sending bootloader and pre-requisite binaries
[   1.5407 ] tegrarcm --download ebt cboot.bin 0 0 --download rp1 compiled.dtb 0
[   1.5429 ] Applet version 00.01.0000
[   1.5650 ] Sending ebt
[   1.5654 ] [................................................] 100%
[   1.6553 ] Sending rp1
[   1.6560 ] [................................................] 100%
[   1.7534 ] 
[   1.7560 ] tegrarcm --boot recovery
[   1.7582 ] Applet version 00.01.0000
[   1.7780 ] 
[   1.7781 ] Writing partition
[   1.7804 ] tegradevflash --write DTB /home/fred/Jetpack/64_TX1/Linux_for_Tegra/bootloader/signed/compiled_sigheader.dtb.encrypt
[   1.7824 ] Cboot version 00.01.0000
[   2.4026 ] Nothing to write
[   2.4026 ] 
[   2.4027 ] Coldbooting the device
[   2.4045 ] tegradevflash --reboot coldboot
[   2.4061 ] Cboot version 00.01.0000
[   2.4087 ] 
*** The [DTB] has been updated successfully. ***

The backup and restore method is time consuming, but it works… I did a quick search in the flash.sh file and it isn’t apparent where the tegradevflash command comes from, so I’m not sure why it isn’t finding the appropriate file to write or what works up to generating that file. As you can see, it completes without informing the user that an error occurred.

Hi Fred_Z,
Please check if it helps by disabling/enabling the regulator:

$ echo disabled >  /sys/class/regulator/regulator.35/state
$ echo enabled >  /sys/class/regulator/regulator.35/state

USB_VBUS_EN1 should be

en_usb_vbus2: regulator@208 {
			compatible = "regulator-fixed-sync";
			reg = <208>;
			regulator-name = "en-usb-vbus2";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&gpio TEGRA_GPIO(CC, 5) 0>;
			gpio-open-drain;
			enable-active-high;
		};

It maps to regulator.35:

$ ls -l /sys/class/regulator/
(skip...)
lrwxrwxrwx 1 root root 0 May  3 09:17 regulator.35 -> ../../devices/regulators/regulators:regulator@208/regulator/regulator.35
(...skip)

It is not the function supported by default. Hopefully it helps your case.

Hi Dane,

That works well, it lets me control the USB power without any external hardware. Thanks!

Hi Fred,

Could you please elaborate a bit more on your solution? I am having the same problem with my TX2

https://devtalk.nvidia.com/default/topic/1042460/jetson-tx2/usb-power-control/