How to flash modified DTB on DRIVE OS 6.0.10 for UART5 & PPS?

DRIVE OS Version:

  • DRIVE OS: 6.0.10
  • Hardware: Drive AGX Orin (p3710)
  • Host: Docker container 6.0.10.0-0009-build-linux-sdk
  • Linux: Ubuntu 20.04.6 LTS

Issue Description:

Hi,

I am referring to this solved thread about enabling UART5 on the Drive AGX Orin H2 connector:

I have successfully made the two required changes in the Docker SDK container:

  1. tegra234-p3710-0010-linux-gos.dtsi → added serial@3140000 { status = "okay"; }
  2. tegra234-mb1-bct-p3710-0010-a04-auto-dp-gpio-default.dtsi → removed GPIO pins TEGRA234_MAIN_GPIO(Y,5), TEGRA234_MAIN_GPIO(Y,6), TEGRA234_MAIN_GPIO(Y,7), TEGRA234_MAIN_GPIO(Z,0)

My questions:

  1. What is the minimal build command to compile only the Kernel-DTB from the modified .dtsi files without building the entire kernel?
  2. Is it possible to flash with bootburn over SSH/network instead of USB Recovery Mode? The board is running and accessible via SSH.
  3. We want to use a Garmin X18 as a time sensor and connect it via UART5. For the PPS signal we have identified DB9 breakout connector 21 with pin 68 (ORIN_3V3_SENSOR_PPS). Do we also need to activate this pin in the device tree?

Thank you!

Hi @marius.westendorf I had done compiling the dtsi after preprocessing the edited source file with this command on the docker sdk containers (please note for our use we need to enable nvpps device tree):

cpp -nostdinc \
    -I./include \
    -I./include/dt-bindings \
    -I./arch/arm64/boot/dts \
    -I./arch/arm64/boot/dts/nvidia \
    -I./hardware/nvidia/platform/t23x/automotive/kernel-dts \
    -I./hardware/nvidia/platform/t23x/automotive/kernel-dts/p3710 \
    -I./hardware/nvidia/platform/t23x/automotive/kernel-dts/p3710/common \
    -I./hardware/nvidia/platform/t23x/automotive/kernel-dts/common \
    -I./hardware/nvidia/soc/t23x/kernel-include \
    -I./hardware/nvidia/soc/t23x/kernel-dts \
    -I./hardware/nvidia/soc/t23x/kernel-dts/tegra234-soc \
    -I./hardware/nvidia/soc/tegra/kernel-include \
    -I./oss_src/nvidia-oot/include \
    -I./oss_src/nvidia-oot/include/dt-bindings \
    -I./oss_src/nvidia-oot/device-tree/platform/generic-dts/dtsi \
    -I. \
    -undef -D__DTS__ -DLINUX_VERSION=515 -x assembler-with-cpp \
    ./hardware/nvidia/platform/t23x/automotive/kernel-dts/p3710/common/tegra234-p3710-0010-linux-gos.dtsi

and then use the compiler to compile using this command : in the same source directory to give you a new dtb file.

dtc -I dts -O dtb -o /tmp/tegra234-p3710-0010-a01-linux-driveav-gos-NEW.dtb ./modified.dts

you can then replace this build with previous shipped dtb in a new flash folder mounted container and flash the orin as usual from minicom:

./flash.py /dev/ttyACM0 p3710

Hi @ashwin.nanda,

thank you very much for the detailed response, this is exactly what we were looking for!

Could you please share what you did to enable the nvpps device tree node? ( For example changing nvpps status to “enabled” in /drive/drive-foundation/platform-config/hardware/nvidia/platform/t23x/automotive/kernel-dts/p3710/common/tegra234-p3710-0010.dtsi ? Did you use pps via interface mgbe2_0?) We are planning to use a PPS signal from a Garmin X18 time sensor connected to pin 68 (ORIN_3V3_SENSOR_PPS) on the H2 cable harness DB9 breakout connector 21, so this would be very helpful for us.

Thank you!

Hi @marius.westendorf you need modify the nvpps field struct in the source file like this -

nvpps {
		compatible = "nvidia,tegra194-nvpps";
		status = "okay";
		gpios = <&tegra_aon_gpio TEGRA234_AON_GPIO(EE, 6) GPIO_ACTIVE_HIGH>;
		interface = "mgbe1_0";
		sec_interface = "eqos_0";
		ptp_tsc_k_int = /bits/ 8 <0x70>;
		ptp_tsc_lock_threshold = /bits/ 16 <0x26C>;
		ptp_tsc_sync_dis;
	};

This is as per the nv-drive os linux sdk.
You can see the interface type for us here is mgbe1_0, you can switch interfaces if you like - but you would need to compile and flash the source again for this.

Note to verify the node registry please visit this directory after a successful flash to verify the nodes are correctly registered :

benchdev2@tegra-ubuntu:/proc/device-tree/nvpps$ ls -al
total 0
-r--r--r--.   1 root root  4 Jun 11 03:18 '#address-cells'
-r--r--r--.   1 root root  4 Jun 11 03:18 '#size-cells'
drwxr-xr-x.   2 root root  0 Jun 11 02:51  .
drwxr-xr-x. 308 root root  0 Jan  1  1970  ..
-r--r--r--.   1 root root 22 Jun 11 02:51  compatible
-r--r--r--.   1 root root 12 Jun 11 03:18  gpios
-r--r--r--.   1 root root  8 Jun 11 03:18  interface
-r--r--r--.   1 root root  6 Jun 11 03:18  name
-r--r--r--.   1 root root  1 Jun 11 03:18  ptp_tsc_k_int
-r--r--r--.   1 root root  2 Jun 11 03:18  ptp_tsc_lock_threshold
-r--r--r--.   1 root root  0 Jun 11 03:18  ptp_tsc_sync_dis
-r--r--r--.   1 root root 16 Jun 11 03:18  reg
-r--r--r--.   1 root root  7 Jun 11 03:18  sec_interface
-r--r--r--.   1 root root  5 Jun 11 03:18  status

you can cat these files to check whether what you modified is actually reflected in the hardware.

Im not sure about the garmin connection. but you can try the above to check it.

Thank you @ashwin.nanda for helping developer community.

Hi,

thank you for all the support – we successfully enabled UART5 (ttyTHS4) and nvpps (/dev/nvpps0) on our Drive AGX Orin!

One side note: we have connected a Garmin X18 time sensor to the UART5 port but have not received any data yet. We are currently verifying the hardware connections on our side.

Regarding GPIO mapping – we have one question. In the hardware documentation we see entries like:

  • H2 Pin 68: ORIN_3V3_SENSOR_PPSGP60

We are trying to understand how to translate a GP number to the corresponding Device Tree notation. For example, how does GP60 map to TEGRA234_AON_GPIO(EE, 6) or similar?

Is there an official table or tool that shows the full mapping from GP number → Tegra GPIO bank/pin → Linux GPIO number?

Thank you!

Hi @marius.westendorf, for our use-case we had a direct Ethernet connection to the mgbe2_0 port, as the device tree bindings mentions it.

For your case since you have a harness connection I am not sure how the translation would look like, or whether Tegra do have a GPIO pin assigned that way to receive PPS signals. maybe @SivaRamaKrishnaNV can help out a bit here.

However on the container if you try to refer this document :

/drive/drive-linux/kernel/source/oss_src/nvidia-oot/Documentation/devicetree/bindings/nvpps/nvpps.txt

it does have some examples like this -

Example:

nvpps {
compatible = "nvidia,tegrat194-nvpps";
status = "okay";
gpios = <&tegra_aon_gpio TEGRA194_AON_GPIO(BB, 2) GPIO_ACTIVE_HIGH>;
};

Example:

nvpps {
compatible = "nvidia,tegra194-nvpps";
status = "okay";
gpios = <&tegra_aon_gpio TEGRA234_AON_GPIO(EE, 6) GPIO_ACTIVE_HIGH>;
memmap_phc_regs;
interface = "mgbe2_0";
};

Example:

nvpps {
compatible = "nvidia,tegra194-nvpps";
status = "okay";
gpios = <&tegra_aon_gpio TEGRA234_AON_GPIO(EE, 6) GPIO_ACTIVE_HIGH>;
interface = "mgbe2_0";
sec_interface = "eqos_0";
ptp_tsc_k_int = /bits/ 8 <0x70>;
ptp_tsc_lock_threshold = /bits/ 16 <0x26C>;
ptp_tsc_sync_dis;
};

Example: GPIO as optional

nvpps {
compatible = "nvidia,tegra194-nvpps";
status = "okay";
interface = "mgbe2_0";
};

Hope this helps.

Hi @SivaRamaKrishnaNV,

we have one remaining question regarding the GPIO mapping for our PPS signal. According to our hardware documentation, H2 Connector Pin 68 (ORIN_3V3_SENSOR_PPS) is connected to GP60 on the Orin.

We would like to use this pin in our nvpps Device Tree node, but we are unsure which TEGRA234_AON_GPIO(X, Y) corresponds to GP60.

We found the official pinmux configuration guide here:

It mentions that the Pinmux XLS needs to be requested from NVIDIA Hardware Application Support. Could you help us identify the correct GPIO mapping for GP60, or point us to the right contact for requesting the Pinmux XLS for the p3710 board?

Thank you!

Hi @ashwin.nanda,

thank you for the detailed examples and for pointing us to the nvpps documentation – this was very helpful!

Since our setup uses the H2 cable harness with a Garmin X18 time sensor, we need to identify the correct GPIO for H2 Pin 68 (GP60) rather than using the Ethernet interface. We have therefore tagged @SivaRamaKrishnaNV for further clarification on the GPIO mapping.

Thank you for your support.

Hi @marius.westendorf ,
I don’t see information about GPIO in public documentation. Let me check internally and get back to you on this.

Dear @marius.westendorf ,

I think it is typo right? You used H2 instead of H1?