System Software Components and Interfaces

This topic provides guidance on using system software and component interfaces to interact with the platform. Examples of platform interfaces are file system components, I2C drivers, and SPI drivers.

Enabling/Disabling Serial Port Bus

The UART ports are configured via device tree (DT) nodes and boot loader configuration files. To reconfigure or update the UART port functionality:
Change/update device tree files
Enable the UART port
Change/update the bootloader configuration files
Optionally assign ownership of the port to a VM
The following sections detail how to accomplish these tasks.

Location and Default Configuration of Serial Device Tree Files

The serial ports are defined in the included device tree file:
drive-t186ref-<os>/bsp/device-tree/hardware/nvidia/soc/t19x/kernel-dts/tegra194-soc/tegra194-soc-uart.dtsi
All serial bus definitions are listed in this file and are disabled by default. For non-safety builds they are enabled in the included DT file:
drive-t186ref-<os>/bsp/device-tree/hardware/nvidia/platform/t19x/automotive/kernel-dts/e3550/common/tegra194-e3550-0001-A.dtsi
In QNX safety builds they are disabled in the safety override DT file:
drive-t186ref-<os>/bsp/device-tree/qnx-device-tree/platform/t19x/common/tegra194-drive-common-qnx-vm1-safety-overrides.dtsi
If you are working with dual-QNX there is a separate override for VM2:
drive-t186ref-<os>/bsp/device-tree/qnx-device-tree/platform/t19x/common/tegra194-drive-common-dual-qnx-vm2-safety-overrides.dtsi
By default, the only serial ports enabled are as follows:
Bus Function
Bus Name
DTB Node
Status Standard
Status Safety
Debug serial
serial0 / uartc
serial@c280000
Enabled
Disabled
GPS/IMU
serial1 / uartb
serial@3110000
Enabled
Enabled

Enabling Debug Serial0 (UARTC) In Safety Configuration

In safety QNX platforms, the debug serial port is disabled by default. Three steps are required to enable it:
1. Edit DT file to enable serial0 bus (node serial@c280000)
2. Edit the disable_uart.subcfg under virtualization
3. Bind partitions with prod_debug_extra variant
To edit the DT file and enable the debug serial port (node serial@c280000), see the steps above.
To edit the disable_uart.subcfg from PDK_TOP, navigate to:
cd drive-t186ref-foundation/virtualization/pct
Navigate to the platform/SOC you wish to enable the debug serial. For this example, we are working with e3550b03-t194a and the QNX OS platform.
cd e3550b03-t194a/qnx
We want to edit disable_uart.subcfg to allow the debug console. There are six choices for the user:
Debug Level
Configuration Variable
Disabled
Verbosity = 0
Critical
Verbosity = 1
Error
Verbosity = 2
Warning
Verbosity = 3
Informative
Verbosity = 4
Debug
Verbosity = 5
Choose the log level you want and save the file. Then, run bind partitions as normal to pick up the changes.
export PDK_TOP=$PWD
export NV_OUTDIR="$PDK_TOP/drive-t186ref-foundation/out"
export QNX_BASE="$PDK_TOP/toolchains/qnx_toolchain/"
export QNX_TARGET="$QNX_BASE/target/qnx7/"
export QNX_HOST="$QNX_BASE/host/linux/x86_64"
export QNX_TOP="$PDK_TOP/drive-t186ref-qnx"
export NV_ROOTFS_LOCAL_DIR="$QNX_TOP/targetfs"
cd drive-t186ref-foundation
make -f Makefile.bind PCT=qnx PCT_VARIANT=prod_debug_extra BOARD=e3550b03-t194a clean
make -f Makefile.bind PCT=qnx PCT_VARIANT=prod_debug_extra BOARD=e3550b03-t194a
Flash the target.

Changing the DTB Used By VM

To use a custom DTB within the VM:
Alter the VM config file
Make bind partitions
As with changing disable_uart.subcfg, navigate from PDK_TOP to:
cd drive-t186ref-foundation/virtualization/pct
Navigate to the platform/SOC you wish to reconfigure. For this example, we are working with e3550b03-t194a and the QNX OS platform.
cd e3550b03-t194a/qnx
Edit qnx_vm1_storage_emmc.cfg and change the file name under the kernel-dtb section to your custom DTB. In the config file the default fields are:
[partition]
name=kernel-dtb
allocation_policy=sequential
filesystem_type=basic
size=0x40000
partition_attribute=0
#if defined ENABLE_DUAL_GUEST_VMS
filename=<PDK_TOP>/drive-t186ref-qnx/bsp/images/tegra194-<DTB_VARIANT>-dual-qnx-vm
#else
filename=<PDK_TOP>/drive-t186ref-qnx/bsp/images/tegra194-<DTB_VARIANT>-qnx-vm1<COM
#endif
os_args="aurixfw=AFW root=/dev/vblk_mnand0 secondary_ifs=/dev/pvblk_mnand100:/ <DBG_OVERLAY_OS_ARGS>"
authentication_group=1
After you edit the config file, run bind partitions as shown above.

Assigning Ownership to Guest VM

The UART port can be mapped to a specific VM address space so that it is the sole owner of the port. There are three choices that can be made:
1. Hypervisor owned: All access is trapped by hypervisor
2. Guest<n> owned: The UART port is mapped to the numbered VM address space
3. Unassigned: Not owned by any VM
The default configuration can be found in:
drive-t186ref-foundation/virtualization/pct/<BOARD_TYPE>/drive_av/guest_io_periph_assign.h
The current default configuration is as follows
UART PORT
OWNER
TEGRA_UART_A
UNASSIGNED
TEGRA_UART_B
GOS0_VM
TEGRA_UART_C
HYPERVISOR
TEGRA_UART_D
UNASSIGNED
TEGRA_UART_E
UNASSIGNED
TEGRA_UART_F
UNASSIGNED

QNX Serial Driver

The QNX driver for the serial bus is devc-nvser and is located in the at:
<top>/drive-t186ref-qnx/nvidia-bsp/aarch64le/sbin/devc-nvser
The driver is loaded from the QNX Image File System (IFS) build file. It is located here:
drive-t186ref-qnx/bsp/images/nvidia-t186.build_vm_safety
drive-t186ref-qnx/bsp/images/nvidia-t186.build_vm1_safety
drive-t186ref-qnx/bsp/images/nvidia-t186.build_vm2_safety
Search for the lines:
# NVIDIA serial driver bins
[uid=2140 gid=0 perms=0500] devc-nvser
The driver is launched from the startup script within the same build file and has the form:
#######################################################################
## Start serial drivers
#######################################################################
iolauncher -c uart -U 2140:2140,2120,2400 -A pathspace,public_channel,rsrcdbmgr
To change the permissions, owner, or order where the serial driver is launched, edit the appropriate build file and rebuild the IFS.