Custom board adaptation .dtb generation issue

Hi,
I made a custom board for TX2 and there are some changes to perform into the Device Tree.
I follow the Tegra_Linux_Driver_Package_TX2_Adaptation_Guide.
At the first time I need to do exactly the same as described on chapter Power Tree Changes
→ I found the file tegra186-quill-power-tree-p3310-1000-a00-00.dtsi
→ I changed “vdd_usb2_5v” to “battery_reg”
The next step is " 2. Regenerate the DTB."
My question is : How can I do that ?
When I try to execute the command dtc there is an error

dtc -I dts -O dtb -o new.dtb tegra186-quill-p3310-1000-c03-00-base.dts
Error: tegra186-quill-p3310-1000-c03-00-base.dts:16.1-2 syntax error
FATAL ERROR: Unable to parse input tree

The corresponding line is the first include, maybe a path problem ?
Is there something to do to initialize the directory for dtc?

Thanks for support

hello baptiste.lucas,

such syntax error caused by invalidate node definition, you may review your device tree to revise the failure.
it’s suggest to download L4T Driver Package (BSP) Sources and see Kernel Customization chapter to build the device tree blob.

Hello and thank you for support.
I’ve already downloaded sources with the source_sync script to download the kernel sources (but for the 28.2.1 release) like described in the Kernel Customization documentation.
Need I rebuild all the kernel ?
I’m a bit confused.

Into the “kernel/dtb” floder, if I convert from dtb to dts the tegra186-quill-p3310-1000-c03-00-base.dbd file then I convert it again in dtb it works well (but I need to add my customization directly into the generated dts file → not user friendly). After a kernel flash the TX2 is applying my new dtb.

But into the “/sources/hardware/nvidia/platform/t18x/quill/kernel-dts”, it’s where I can’t perform a dts to dtb conversion (my previous post).

I left a bit the kernel recompilation in standby and try to test my custom board with the “vdd_usb2_5v” to “battery_reg” change directly into the tegra186-quill-p3310-1000-c03-00-base.dbd.

My custom board uses:
2x USB3-0:
A39-A40 / C43-C44 / F43-F44
B42-B43 / D42-D43 / G42-G43
1x USB2-0:
B39-B40

The pin B37 (USB0_VBUS_DET) is not connected (still floating).

Both USB3-0 work but the USB2-0 is not working.
The boot output is

dmesg | grep usb
[ 3.174348] xhci-tegra 3530000.xhci: Direct firmware load for tegra18x_xusb_firmware failed with error -2
[ 3.256242] vdd-usb0-5v: disabling
[ 3.256243] vdd-usb1-5v: disabling
[ 7.254729] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 7.262481] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 7.271599] usb usb1: Product: xHCI Host Controller
[ 7.277445] usb usb1: Manufacturer: Linux 4.4.38-tegra xhci-hcd
[ 7.284352] usb usb1: SerialNumber: 3530000.xhci
[ 7.338962] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[ 7.346768] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 7.355952] usb usb2: Product: xHCI Host Controller
[ 7.361828] usb usb2: Manufacturer: Linux 4.4.38-tegra xhci-hcd
[ 7.368738] usb usb2: SerialNumber: 3530000.xhci

and the usb tree is

lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/3p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/4p, 480M

Is there a simple way to fix my issue ?

hello baptiste.lucas,

are you still working on r28 release? the latest release is now r32.6.1


you may disassembler the dtb file into text file for modification, then convert the sources into a new dtb binary, or, re-compiler the *dtsi sources to create a self-build *.dtb; both of the approaches were accepted.
just keep in mind the disassembler property values were using hexadecimal instead of decimal.

I really need help to fix my issue please.
1/ Is it possible that the problem is the non connected USB0_VBUS_DET signal (pin B37) ?
2/ Any other idea of the problem ?

If you are using rel-28, you need to refer to the adaptation guide that published in 2018. That one in 2019 is for rel-32.

Also, it is not possible for us to know your board design. Share your schematic might help.

And you should directly attach the full dmesg instead of parsing them by yourself.

Hi Wayne thanks for reply,

→ it’s exactly what I’ve done (and I won’t have found the “vdd_usb2_5v” to “battery_reg” change without it !)

For the USB0, my schematic is very very simple (maybe too much ?) : it’s used to interface a MCU in USB2-0, with B39 & B40 (USB0_D- & USB0_D+) that’s all.
FYI: With the eval board the MCU was plugged with the microUSB-AB connector (and worked well).

See below the full dmesg log.
dmesg_output.txt (88.5 KB)

Hi Wayne and JerryChang,
Do you need something else to help me to fix my USB issue ?

FYI I made a temporary HW change to my board to continue my work, the USB_Rx & USB-Tx of the MCU (normally plugged to USB0 port of the TX2) are plugged (with an USB cable) to one of the USB3 ports (both work well) → the USB peripheral is correctly loaded and I can discuss with the MCU. So the problem it’s really the USB0 port that doesn’t want to start.

Still need your schematic and dtb. Schematic gives more than your comment.

ok no problem. Here is the TX2 connector pinout:


First USB3.0:

Second USB3.0:

And the USB2.0:

The R5, R6, R100, R197 resistors are no connected , just in case of issue with USB (It was a very very good idea !)
And the dtb :
dtb.zip (250.4 KB)

Hi Wayne and JerryChang,
Do you need something else to help me to fix my USB issue ?
thanks

Hi,

  1. I am not sure why you share so many dtb files here. Does it mean you cannot know which dtb is in use here?

  2. From your dmesg, it says your usb2 is still configured as OTG. So you didn’t change anything in the dts file except vbus? Also, are you sure you want to adopt this design? Your board will not able to get re-flash.

Hi Wayne,

  1. I posted all the /kernel/dtb folder but I use the tegra186-quill-p3310-1000-c03-00-base.dtb (modified).
  2. Yes, like I said previously I don’t know what to change in this file to make it works (and I’m not able to rebuild entire kernel) → It’s exactly why I ask a bit of support.
    This board is designed for embedded application. When it works, we will never re-flash the system.

Did you ever download the kernel source? Sounds like you didn’t know about it either.

Yes of course, it’s the first thing I’m done but I’m not a kernel specialist and I’m not able the execute a new compilation.
So I use the dtc command to change directly the tegra186-quill-p3310-1000-c03-00-base.dtb file.
This file is a bit hard to read and I’m just a poor electronics guy who needs to get his system working.
I read all the posts on the subject, all the nvidia documentation, downloaded the sources in the correct version but I still don’t know what to change in the configuration to make my usb work.

Remove usb2 from xudc node under of the device tree. This will make it not a OTG port anymore.

Thank you Wayne, the problem was of course the OTG feature !

I changed


			usb2-micro-AB {
				nvidia,lanes = "otg-0";
				nvidia,function = "xusb";
				- nvidia,port-cap = <0x3>;
				+ nvidia,port-cap = <0x1>;
				nvidia,oc-pin = <0x0>;
			};

To set it as host instead of OTG and it works.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.