How to enable UART7 (D8, D5) as normal UART like other UART (uartc@C280000)

Hi Sir/Madam,

I set pinmux spreadsheet (D8, D5) and generate dti as following

uart7_tx_pw6 {
				nvidia,pins = "uart7_tx_pw6";
				nvidia,function = "uartg";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

			uart7_rx_pw7 {
				nvidia,pins = "uart7_rx_pw7";
				nvidia,function = "uartg";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

I think UART7 will work but I can’t find signal. So could you confirm which tty is connected to UART7?

Thank you.

I don’t know about this UART, but by tty are you asking about which pins on the carrier board for custom use?

Hi linuxdev,

We have our custom board and use UART7 to control device. Currently, we try all tty device in Linux but there is no any signal. So we want to know which tty device in Linux is connected to UART7(D8, D5). It will be easy for us to debug. Thank you.

I can’t answer the question, but I see in the schematics D5 is UART4_RX, and D8 is UART4_TX. There are cases where the carrier board “UART#” differs from the “UART#” of the module itself.

In the case of the dev carrier this routes to the debug header. The reason this matters is that I see an ECN stating that a pull down was added to UART4_TX for bug 200160113 (which I know nothing about, but perhaps this might be needed in your design as well).

Is it possible that what you really want is UART4?

hello JasonFan,

please check tegra_uart_probe() function at below path and confirm which tty device you’re used.

R28.1/kernel/kernel-4.4/drivers/tty/serial/serial-tegra.c

Hi JerryChang,

I try to add usrt7 (serial@c290000) to dtsi file and looks like working.

serial@c290000{
   compatible = "nvidia, tegra186-hsuart"
   status = "okay"
}

But got error from tegra_uart_probe().

serial-tegra c290000.serial: Failed to add uart port, err -22
serial-tegra: probe of c290000.serial failed with error -22

22 /* Invalid argument */

Is there anything I miss or need to check?

Is the address of UART7 UARTG(c290000)

Thank you

hello JasonFan,

any kernel related failure message shown for reference?
thanks

Hi JerryChang,

The kernel related failure messages are as below

serial-tegra c290000.serial: Failed to add uart port, err -22
serial-tegra: probe of c290000.serial failed with error -22

The whole log is attachement

Thanks

1113.log (90.1 KB)

hello JasonFan,

according to your kernel message, here are all tty devices being detected.
seems you did not add UART(serial@c290000) correctly.

[    3.027817] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 37, base_baud = 0) is a TEGRA_UART
[    3.029079] c280000.serial: ttyTHS2 at MMIO 0xc280000 (irq = 38, base_baud = 0) is a TEGRA_UART
[    3.030399] 3130000.serial: ttyTHS3 at MMIO 0x3130000 (irq = 39, base_baud = 0) is a TEGRA_UART

Hi JerryChang,

Yes. I know ttyTHS1~THS3 can work so I add UART7(serial@c290000) like them. (you can see my previous post)
The problem is UART7 can’t be added or fail to prob after I add it in device tree.

According to “TX2_Parker_TRM_DP07821001p.pdf” it describes UART7 as following.

UART7/UARTG: Primary debug of all subsystems
As such, a new debug UART, interface name UART7 with only the TXD/RXD pins is added in Paker under the control of the dedicated new UART controller (separate from all functional UARTs)

It looks like UART7 is used for another purpose of TX2 original design?
So my question is how to modify/enable UART7 to a normal uart like other uarts (for example: uartc@C280000)
Or UART7 can’t be used for normal UART function?

I found another topic that also dusscuss UART7
[url]UART7 unusable because of strange debugging console - Jetson TX2 - NVIDIA Developer Forums

Thanks

any update? Thanks.

hello JasonFan,

we’re investigating this internally,
will get back to you, thanks

hello JasonFan,

please convert below BPMP DTB file with the dtc tool, and please changing the port number to 255 and converted it back to DTB. thanks
tegra186-a02-bpmp-quill-p3310-1000-c01-00-te770d-ucm2.dtb

Hi JerryChang,

Do you mean modify as the following?

serial{
       port = <0xff>;
       has_input;
};

I did it as above and re-flash by “sudo ./flash.sh jetson-tx2 mmcblk0p1” but still got the same error messages

serial-tegra c290000.serial: Failed to add uart port, err -22
serial-tegra: probe of c290000.serial failed with error -22

Thanks

hello JasonFan,

UART7 device is added successfully just by changing the DT status even without disabling in BPMP DTB.
please make sure your serial@c290000 serial port status has changed from ‘disabled’ to ‘okay’.
thanks

serial@c290000 {
...
    status = "okay";

Hi JerryChang,

I try to change status = “disable” to “okay” in tegra186-soc-uart.dtsi.

And also try to add the following codes in tegra186-quill-p3310-c03-00-base.dts

serial@c290000{
   compatible = "nvidia, tegra186-hsuart"
   status = "okay"
}

Both ways are failed to add uart port.

I also try to add the other serial (serial@3140000) in tegra186-quill-p3310-c03-00-base.dts and ttyTHS4 is added successfully.
Please check the log.

serial@3140000{
   compatible = "nvidia, tegra186-hsuart"
   status = "okay"
}

serial@3150000 has the same issue to serial@c290000(uart7/uartg) so I think serial@3150000 and serial@c290000(uart7/uartg) should be occupied by other functions.

PS: I can’t find any information in doc for uartf (serial@3150000) but it doesn’t matter.

Thanks
uart_1211.log (90.5 KB)

hello JasonFan,

had you compile the device tree correctly?
i’m able to saw the UART7 device is added successfully just by changing the DT status,
share the diff for your reference.

--- a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
+++ b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
@@ -56,6 +56,11 @@
                status = "okay";
        };
 
+       serial@c290000 {
+               compatible = "nvidia,tegra186-hsuart";
+               status = "okay";
+       };

before,

serial@c290000 {
		compatible = "nvidia,tegra186-hsuart";
		#stream-id-cells = <0x1>;
		reg = <0x0 0xc290000 0x0 0x40>;
		reg-shift = <0x2>;
		interrupts = <0x0 0x76 0x4>;
		nvidia,memory-clients = <0xe>;
		dmas = <0x19 0x2 0x19 0x2>;
		dma-names = "rx", "tx";
		clocks = <0xd 0xd8 0xd 0x10d>;
		clock-names = "serial", "parent";
		resets = <0xd 0x70>;
		reset-names = "serial";
		status = "disabled";
		nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
		linux,phandle = <0x89>;
		phandle = <0x89>;
	};

after,

serial@c290000 {
		compatible = "nvidia,tegra186-hsuart";
		#stream-id-cells = <0x1>;
		reg = <0x0 0xc290000 0x0 0x40>;
		reg-shift = <0x2>;
		interrupts = <0x0 0x76 0x4>;
		nvidia,memory-clients = <0xe>;
		dmas = <0x19 0x2 0x19 0x2>;
		dma-names = "rx", "tx";
		clocks = <0xd 0xd8 0xd 0x10d>;
		clock-names = "serial", "parent";
		resets = <0xd 0x70>;
		reset-names = "serial";
		status = "okay";
		nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
		linux,phandle = <0x89>;
		phandle = <0x89>;
	};

Hi JerryChang,

I can make sure I compile the dtb and update correctly because I can add serial@3140000 successfully.

I found we have different source base.
In my “kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi”, I don’t have serial@c290000{


Previously, I only add the following codes in tegra186-quill-common.dtsi but got failure

serial@c290000{
   compatible = "nvidia, tegra186-hsuart"
   status = "okay"
}

Now I add all codes you show in previous post in tegra186-quill-common.dtsi but still got “serial-tegra c290000.serial: Failed to add uart port, err -22”

serial@c290000 {
		compatible = "nvidia,tegra186-hsuart";
		#stream-id-cells = <0x1>;
		reg = <0x0 0xc290000 0x0 0x40>;
		reg-shift = <0x2>;
		interrupts = <0x0 0x76 0x4>;
		nvidia,memory-clients = <0xe>;
		dmas = <0x19 0x2 0x19 0x2>;
		dma-names = "rx", "tx";
		clocks = <0xd 0xd8 0xd 0x10d>;
		clock-names = "serial", "parent";
		resets = <0xd 0x70>;
		reset-names = "serial";
		status = "okay";
		nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
		linux,phandle = <0x89>;
		phandle = <0x89>;
	};

Is anything I miss or does nVidia has new release for TX2?

Thank you

hello JasonFan,

we’re able to reproduce the serial-tegra c290000.serial: Failed to add uart port, err -22 from our side.
will look into this and get back to you.
thanks

hello JasonFan,

confirmed we had fix “serial-tegra c290000.serial: Failed to add uart port, err -22” issue.
the fix will be include in the next JetPack release.
thanks