UART4 Enable

Hi @KevinFFF , i thought it would be best to establish a complete picture of the configuration I have done up until now, since there seems to be endless forums each going down a different path.
I have configured PINMUX accordingly:

Orin-gdu-pinmux.zip (6.3 KB)
In the .dtsi file, i have included the entry you recommended, and added additional infor for dma as per another forum:
uartd: serial@3130000 {//uart4
compatible = “nvidia,tegra194-hsuart”;
reg = <0x0 0x03130000 0x0 0x10000>;
dma-coherent;
dmas = <&gpcdma 19>, <&gpcdma 19>;
dma-names = “rx”, “tx”;
clocks = <&bpmp TEGRA234_CLK_UARTD>;
resets = <&bpmp TEGRA234_RESET_UARTD>;
reset-names = “serial”;
status = “okay”;
};
I also removed the usage of gpio@2200000 from every camera overlay to ensure the required pins werent being used as gpio’s - this was also in another forum. I also removed the usage of H4 by the one regulator:
vdd_3v3_pcie: regulator-vdd-3v3-pcie {
compatible = “regulator-fixed”;
regulator-name = “VDD_3V3_PCIE”;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
//gpio = <&gpio TEGRA234_MAIN_GPIO(H, 4) GPIO_ACTIVE_HIGH>;
regulator-boot-on;
enable-active-high;
};

In the decompiled device tree following the building of source code, i see this entry for the uart4:
serial@3130000 {
compatible = “nvidia,tegra194-hsuart”;
reg = <0x00 0x3130000 0x00 0x10000>;
interrupts = <0x00 0x73 0x04>;
clocks = <0x03 0x9e>;
resets = <0x03 0x67>;
status = “okay”;
dma-coherent;
dmas = <0xee 0x13 0xee 0x13>;
dma-names = “rx\0tx”;
reset-names = “serial”;
phandle = <0x232>;
};

Heres some of the stuff i see on the jetson, for your analysis:
root@ubuntudev:/home/devdev# sudo busybox devmem 0x02434020
0x00000002
root@ubuntudev:/home/devdev# sudo busybox devmem 0x02434018
0x00000001

root@ubuntudev:/home/devdev# dmesg | grep serial
[ 0.154042] 31d0000.serial: ttyAMA0 at MMIO 0x31d0000 (irq = 120, base_baud = 0) is a SBSA
[ 0.284358] msm_serial: driver initialized
[ 2.026080] 3100000.serial: ttyTHS1 at MMIO 0x3100000 (irq = 112, base_baud = 0) is a TEGRA_UART
[ 2.027167] 3140000.serial: ttyTHS5 at MMIO 0x3140000 (irq = 113, base_baud = 0) is a TEGRA_UART
[ 2.028013] 3130000.serial: ttyTHS3 at MMIO 0x3130000 (irq = 114, base_baud = 0) is a TEGRA_UART
[ 2.028320] serial-tegra 3110000.serial: RX in PIO mode
[ 2.028323] serial-tegra 3110000.serial: TX in PIO mode
[ 2.028356] 3110000.serial: ttyTHS2 at MMIO 0x3110000 (irq = 208, base_baud = 0) is a TEGRA_UART
[ 6.495622] systemd[1]: Created slice Slice /system/serial-getty.

root@ubuntudev:/home/devdev# cat /sys/kernel/debug/gpio | grep PH
gpio-391 (PH.00 )
gpio-392 (PH.01 )
gpio-393 (PH.02 )
gpio-394 (PH.03 )
gpio-395 (PH.04 )
gpio-396 (PH.05 )
gpio-397 (PH.06 )
gpio-398 (PH.07 )

125 (uart4_cts_ph6):
pull=0
tristate=0
enable-input=0
open-drain=1
io-reset=1
rcv-sel=1
io-hv=1
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
gpio-mode=0
function=rsvd1
126 (uart4_rts_ph5):
pull=0
tristate=0
enable-input=0
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
gpio-mode=0
function=rsvd2
127 (uart4_rx_ph4):
pull=0
tristate=0
enable-input=0
open-drain=1
io-reset=1
rcv-sel=1
io-hv=1
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
gpio-mode=0
function=rsvd1
128 (uart4_tx_ph3):
pull=0
tristate=0
enable-input=0
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
gpio-mode=0
function=rsvd2

Some more observations:
the tx and rx lines are both low constantly even when performing loopback test. So something is holding it down, or it hasnt been correctly assigned somewhere in between the pinmux and device tree

note that were using jp6.2.2

Please provide the results of the following commands on your board.

//UART4_TX
$ sudo busybox devmem 0x2434020
//UART4_RX
$ sudo busybox devmem 0x2434018

It is not the expected pinmux results to me if you want to use them as UART.

Please share the detailed steps how do you apply the pinmux change after generating pinmux/gpio dtsi from the spreadsheet.

I take the generated gpio and pinmux files, and replace the tegra234-mb1-bct-pinmux-p3701-0000.dtsi and tegra234-mb1-bct-gpio-p3701-0000.dtsi files with them. I use the name Orin-gdu-pinmux.dtsi and Orin-gdu-gpio-default.dtsi. I then renamed the field PINMUX_CONFIG=“Orin-gdu-pinmux.dtsi”; accordingly in the p3737-0000-p3701-0000.conf file. And thats all I do. I assume the gpio file is pointed to in the pinmux file, and that I dont need to change any fields for that.

If it helps, I can share the github repository that tracks the changes ive made.

@KevinFFF is there anything wrong in my process.

Hi @KevinFFF ,

You were correct, PINMUX may not have been taking effect.

I had not added the name of my new PINMUX to the .conf.common field, I only changed it on this line in the .conf file: PINMUX_CONFIG=“Orin-gdu-pinmux.dtsi”; So i hadnt completed configuration fully.

Is this correct:
root@ubuntudev:/home/devdev# sudo busybox devmem 0x2434020
0x00000400
root@ubuntudev:/home/devdev# sudo busybox devmem 0x2434018
0x00000450

Good, the values of pinmux register look good to me for UART use case.

Is the UART loopback working on UART4 now?

Hi @KevinFFF, thanks so much for your help! The lines toggling as expected, but am yet to do loopback test.

Will be doing testing today, and will close the ticket if all works as expected.

Okay, we are looking forward for your result.

Is this still an issue to support? Any result can be shared?

Hi, apologies for not respondiong. Issues are resolved, thanks.