Enable ttyTHS0 on serial@3100000, device tree missing reset and reset names (TX2 4.2)

Been having some issues getting the new Jetpack 4.2 version setup the same as the 3.2 version on my TX2.
My system needs to use uart0 as a high speed UART, I need to use ttyTHS0.

On the previous jetpack version I was able to do this by following various posts like per
https://devtalk.nvidia.com/default/topic/1025894/jetson-tx2/uart1-acts-as-default-debug-port-on-tx2-r28-1/post/5220368/#5220368

However following the same method on the newer version it does not work. At boot I get the following and ttyTHS0 is not created.


Serial: 8250/16550 driver, 4 ports, IRQ shared disabled
serial-tegra 3100000.serial: Couln’t get the reset
serial-tegra: probe of 3100000.serial failed with error -2
3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 37, base_baud = 0) is a TEGRA_UART)

I’ve noticed in the device tree file tegra186-quill-p3310-1000-c03-00-base.dtb that in the serial@3100000 section that there is no reset or reset-names listed and am wondering if this is the cause. The previous jetpack version did have these fields for the serial@3100000 device.

If this is the case what would I set these values to?

Thanks

james.miller,

Could you try to remove the “nvidia,tegra20-uart” and those two /delete-property/ lines?

41         serial@3100000 {
  42                 compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
  43                 console-port;
  44                 sqa-automation-port;
  45                 /delete-property/ resets;
  46                 /delete-property/ reset-names;
  47                 status = "okay";
  48         };

We remove these two properties in device tree because bootloader already initiated this serial, so we don’t need to reset it again after kernel is up.

Hi Wayne,

Thanks, that’s what I initially tried as it use to work on the 3.2 version. But on 4.2 it is not working as I don’t get a ttyTHS0 loaded.

My tegra186-quill-p3310-1000-c03-base.dtb has the following.
Am I also meant to update the tegra186-quill-p3310-1000-a00-00-base.dtb file?

serial@3100000 {
		compatible = "nvidia,tegra186-hsuart";
		iommus = <0x11 0x20>;
		reg = <0x0 0x3100000 0x0 0x40>;
		reg-shift = <0x2>;
		interrupts = <0x0 0x70 0x4>;
		nvidia,memory-clients = <0xe>;
		dmas = <0x25 0x8 0x25 0x8>;
		dma-names = "rx", "tx";
		clocks = <0x10 0x37 0x10 0x10d>;
		clock-names = "serial", "parent";
		status = "okay";
		nvidia,tolerance-low-range = <0x0>;
		nvidia,tolerance-high-range = <0x4>;
		nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
		console-port;
		sqa-automation-port;
		linux,phandle = <0x107>;
		phandle = <0x107>;
	};

So please remove the the “/delete-property/” lines in “hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi”

Thanks Wayne, Still a bit new to this device tree stuff. Where is that file located, I can’t seem to find it.

Hi James,

You should already downloaded the dts source file from our download center, right?

If so, could you share what is under the folder?

Hi Wanye, I’ve just downloaded the New 4.2 JetPack SDK Manager and have been working from these instructions at
https://github.com/stanfordroboticsclub/jetson-config/wiki/UART0-Configuration-(RoboClaws)

to extract the dts and then make my changes and recomplie the dtb.

I have then been running ./apply-binaries script and then using the sdk manager to flash the tx2.

In my previous post is the contents for the /nvidia_sdk/JetPack_4.2_Linux_P3310/Linux_for_Tegra/kernel/dtb/tegra186-quill-p3310-1000-c03-base.dtb file after I decompile it using

dtc -I dtb -O dts -o ~/extracted.dts Linux_for_Tegra/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb

The extracted dts doesn’t have the reset or reset-names fields for serial@3100000 device

When you say dts sources I’m assuming you mean building everything from scratch. Will the sources_sync.sh script pull down the sources you are talking about? And if so is there some instructions somewhere that runs through how to build them?

My Folder structure is as below

nvidia_sdk/JetPack_4.2_Linux_P3310/Linux_for_Tegra/

apply_binaries.sh
bootloader
build_l4t_bup.sh
flash.sh
jetson-tx2-as-4GB.conf -> p2771-0000-as-0888.conf
jetson-tx2.conf -> p2771-0000-devkit.conf
jetson-tx2i.conf -> p2771-3489-ucm1.conf
jetson-xavier.conf -> p2972-0000-devkit.conf
jetson-xavier-maxn.conf -> p2972-0000-devkit-maxn.conf
etson-xavier-slvs-ec.conf -> p2972-0000-devkit-slvs-ec.conf
kernel
nv_tegra
p2771-0000-as-0888.conf
p2771-0000.conf.common
p2771-0000-devkit.conf
p2771-0000-dsi-hdmi-dp.conf
p2771-3489-ucm1.conf
p2771-3489-ucm2.conf
p2972-0000.conf.common
p2972-0000-devkit.conf
p2972-0000-devkit-maxn.conf
p2972-0000-devkit-slvs-ec.conf
rootfs
source_sync.sh

I ended up pulling down the sources using the sources_sync.sh script.

I made the changes suggested in the hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi file and then rebuilt the kernel using the instructions here
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fkernel_custom.html in the Kernel Customization section.

After re-flashing the TX2 I now saw ttyTHS0 get loaded in the boot messages, however the device was now hanging on boot at the message - Started Update UTMP about System …

I tried just copying across the new /dtb directory and left the kernel Image as it was before and reflashed it and it now booted and also has the ttyTHS0 loaded. Not sure why it was hanging before due to my new kernel Image, but any suggestions would be appreciated. I didn’t do anything with the modules, did I need to?

I’ll fully test the ttyTHS01 and post and update once done.

Thanks again Wayne

Yes, it is better if you also building the modules. The mismatch kernel name would cause the modules not be loaded. Other forum topics hit this problem too.