Skip to content

Instantly share code, notes, and snippets.

@najlepsiwebdesigner
Last active July 8, 2024 23:07
Show Gist options
  • Save najlepsiwebdesigner/fc5f111fcae3e5c4fa5f827909417572 to your computer and use it in GitHub Desktop.
Save najlepsiwebdesigner/fc5f111fcae3e5c4fa5f827909417572 to your computer and use it in GitHub Desktop.
This file documents my efforts to implement linux device tree modifications required to enable USB on custom carrier board

DTB file to edit

this is the correct file In many tutorials elinux,devtalk devtalk on the internet, this file is modified: tegra186-quill-p3310-1000-c03-00-base.dtb

Current official documentation mentions file: tegra186-quill-power-tree-p3310-1000-a00-00.dtb

check currently used configuration from tx2: dmesg | grep "DTS File"

Currently loaded device tree (compiled with hex values)

dtc -I fs -O dts /sys/firmware/devicetree/base >> ~/curent_device_tree.txt && vim ~/curent_device_tree.txt

-> this one reflects is not modified

dtc -I fs -O dts /proc_device_tree -o curent_device_tree.dts

--> this one reflects changes in tegra186-quill-p3310-1000-c03-00-base.dtb

Important documents

  • Tegra_Linux_Driver_Package_TX2_Adaptation_Guide.pdf

Edit of device tree in host pc

this reqrites the file: kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb!

  1. dtc -I dtb -O dts -o extracted.dts kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb
  2. ...edit "extracted.dts"...
  3. dtc -I dts -O dtb -o ./kernel/dtb/custom-mod_tegra186-quill-p3310-1000-c03-00-base.dtb extracted.dts

to backup old configuration: cp kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb.orig

Flash

  1. enter recovery mode
  2. sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1

Patching the DTS

To place system in Force USB Recovery Mode

  • Power down the device. If connected, remove the AC adapter from the device. The device must be powered OFF, and not in a suspend or sleep state.
  • Connect the Micro-B plug on the USB cable to the Recovery (USB Micro-B) Port on the device and the otherend to an available USB port on the host PC.
  • Connect the power adapter to the device.
  • With the system powered on: Press and hold the RECOVERY FORCE button.While depressing the RECOVERY FORCE button, press and release the RESET button.• Wait 2 seconds and release the RECOVERY FORCE button

Change device tree for USB in the runtime , blog article, still to be tested

https://developer.ridgerun.com/wiki/index.php/Edit_device_tree_at_run_time

 
 pinctrl@3520000 {
     vbus-0-supply = <&vdd_usb0_5v>; 
     vbus-1-supply = <&vdd_usb1_5v>;
     - vbus-2-supply = <&vdd_usb2_5v>;
     + vbus-2-supply = <&battery_reg>; 
     vbus-3-supply = <&battery_reg>; 
     vddio-hsic-supply = <&battery_reg>;
     avdd_usb-supply = <&spmic_sd3>;
     vclamp_usb-supply = <&spmic_sd2>;
     avdd_pll_erefeut-supply = <&spmic_sd2>;
  };
  
// runtime getter for values (first path can have aliases defined in section aliases of DTB)
fdtget /boot/tegra186-quill-p3310-1000-c03-00-base.dtb /pinctrl@3520000 vbus-2-supply

// napr fdtget /boot/tegra186-quill-p3310-1000-c03-00-base.dtb /pinctrl@3520000 vbus-3-supply
$ 38


// runtime setter
sudo fdtput -t i /boot/tegra186-quill-p3310-1000-c03-00-base.dtb /pinctrl@3520000 vbus-2-supply 38

nvidia devtalk forum, guiding user to solve USB on custom board

https://forums.developer.nvidia.com/t/tx2-usb2-0-not-working-how-to-fix-it/110032/22

Useful links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment