NVIDIA Tegra
NVIDIA DRIVE 5.0 Linux SDK

Development Guide
5.0.10.3 Release


 
Setting Up Networking on the Host and Target (Optional)
 
Configuring the Network Interface
Connecting the Target to the Host via the Network Interface
Configuring the Private LAN to the Target Network
DRIVE PX 2 10-Gigabit Ethernet Ownership
Configuring the DHCP and NFS Server on the Host
Enabling Internet Access from the Target
Use the information in these topics to set up the network between an Ubuntu host and your NVIDIA DRIVE platform. For example, this is required to enable booting with rootfs over NFS. For more information, see Flashing the Board in the Foundation SDK for DRIVE PX 2 Development Guide. The steps to set up networking entail configuring networking on the host computer, configuring the DHCP and NFS server, and configuring networking on the target.
Configuring the Network Interface
Configuring the network interface for your device entails connecting the target board to the host Linux development system followed by configuring the network interface. The following topics describe those procedures.
Connecting the Target to the Host via the Network Interface
Use the procedures in this topic to connect your target board to the Linux Ubuntu host machine via a private LAN. This private LAN is not the LAN connecting the host to the Internet. You can use two methods to connect:
On-board
USB-to-Ethernet dongle-type adapter (optional for additional Ethernet interfaces)
Note:
To avoid auto detection conflicts with the adapter, do not configure these items with the Network Manager.
To use Ethernet NIC to connect the board and host on the private LAN
1. Using an additional on-board or PCIe-based Ethernet NIC adapter on the host, obtain a CAT-6 patch cable and plug one of the RJ-45 male ends into the additional NIC on the host.
2. Plug the other male end of the CAT-6 cable into the target’s on-board or harness (P2379 only) Ethernet jack.
To use USB-to-Ethernet to connect the board and host on the private LAN
1. Using a USB-to-Ethernet dongle-type adapter on the host, plug the first USB-to-Ethernet adapter USB type A Male end into a USB female type A on the host.
2. Obtain a CAT-6 patch cable and plug one of the RJ-45 male ends into the first USB-to-Ethernet adapter.
3. Plug the other male end of the CAT-6 crossover into the RJ-45 jack on the target.
 
Note:
If an USB-to-Ethernet dongle is plugged into the target system, then the Ethernet interface mapped to the Tegra code-name Parker EQOS controller and the USB-to-Ethernet adapter is unpredictable. In most instances, the EQOS controller is enumerated as eth0 (which is the desired outcome), but in some instances, the USB-to-Ethernet adapter instead is enumerated as eth0.
This unpredictability may cause rootfs mount failures when booting over NFS. The NFS boot logic in Yocto initramfs relies on the USB-to-Ethernet adapter being enumerated as eth1.
Configuring the Private LAN to the Target Network
Use the following procedure to configure the host interface for the private LAN connected to the target platform. The procedure assumes eth1 is the Ethernet port on the host PC connected to the NVIDIA board.
To configure the private LAN to the target
1. Determine which host eth<n> port is connected to the target, where <n> is the port instance.
Find the eth device with the following command:
dmesg | grep -i eth
In the grep results, identify the eth<n> port for the smsc95xx or similar USB Ethernet adapter.
For example, the following dmesg result indicates that the eth1 port is connected to the target:
[1310932.166153] smsc95xx 2-5.1:1.0: eth1: register 'smsc95xx' at usb-0000:00:1d.7-5.1, smsc95xx USB 2.0 Ethernet, 00:04:4b:1b:32:6b
2. On the host, find and edit the following file:
/etc/network/interfaces
This file is read-only, so you must open it with administrative privileges, for example:
sudo vim etc/network/interfaces
3. Depending on your connection to the target, modify the interfaces file:
Additional NIC card/adapter: Add the following to the interfaces file:
auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0
USB Ethernet adapter: Add the following to the interfaces file:
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0
post-up /etc/init.d/isc-dhcp-server restart
4. Restart the host’s networking with the following command:
sudo /etc/init.d/networking restart
DRIVE PX 2 10-Gigabit Ethernet Ownership
The DRIVE PX 2 10 gigabit (Gb) Ethernet adapter can be connected to either Tegra using the PEX8724 switch. However, by default it is part of virtual switch domain 0 (VS0) of the PEX8724, therefore it gets enumerated in the Tegra A PCIe hierarchy. You can switch it to virtual switch domain 1 (VS1) at runtime, using the following procedures.
10 Gb Ethernet Ownership
10 Gb Ethernet can be switched from the Tegra A to the Tegra B PCIe host domain, or the reverse, at runtime.
Limitations
Tegra B reset is not supported when the 10Gb Ethernet port is part of the Tegra B virtual PCIe domain (VS1).
To switch 10-Gb Ethernet from Tegra A to Tegra B
Note:
Not all input streams are shared. Share all of the streams before issuing the following example commands.
1. Disable PCIe on Tegra A with the following command:
rmmod ixgbe
2. Issue the command on Tegra A and Tegra B :
echo 1 > /sys/bus/pci/devices/0000\:00\:01.0/remove
3. Run the move10GbePhy_B.sh script on Tegra B with the following command:
bash /root/move10GbePhy_B.sh
This prompts the I2C command to run on AURIX.
Move PCIe controls to Tegra B with the following command in the AURIX console:
'i2cwrite 0x1 0x77 0x3 0x1 0xFF'
'i2cwrite 0x1 0x77 0x7 0x1 0xe0'
for Tegra B, then hit any key to continue.
4. Press enter on Tegra B after the i2cwrite command executes on the AURIX console.
5. Re-scan the pci device on both TA/TB and make sure 10G interface is enumerating as per expectation.
echo 1 > /sys/bus/pci/rescan
lspci
To switch 10-Gb Ethernet from Tegra B to Tegra A
Note:
Not all input streams are shared. Share all of the streams before issuing the following example commands.
1. Disable PCIe on Tegra B with the following command:
rmmod ixgbe
2. Issue the command on Tegra A and Tegra B :
echo 1 > /sys/bus/pci/devices/0000\:00\:01.0/remove
3. Run the move10GbePhy_A.sh script on Tegra A with the following command:
bash /root/move10GbePhy_A.sh
This prompts the I2C command to run on AURIX.
Move PCIe controls to Tegra A with the following command in the AURIX console:
'i2cwrite 0x1 0x77 0x3 0x1 0xF8'
'i2cwrite 0x1 0x77 0x7 0x1 0xe0'
for Tegra A, then hit any key to continue.
4. Press enter on Tegra A after the i2cwrite command executes on the AURIX console.
5. Re-scan the pci device on both TA/TB and make sure 10G interface is enumerating as per expectation.
echo 1 > /sys/bus/pci/rescan
lspci
Configuring the DHCP and NFS Server on the Host
This topic explains the installation and configuration of DHCP and NFS servers. The DHCP server on the host is used to assign the IP address to NVIDIA target board and the NFS server is used to mount the root file system on the NVIDIA target board via NFS.
If the DHCP and NFS servers are not yet installed on the host, the SDK installer installs and configures them. Alternatively, those servers can be installed and configured as explained in the following procedures.
To set the DHCP server
1. Install the DHCP server on the host:
sudo apt-get install isc-dhcp-server
2. Specify the interface on which the server should listen for leasing an IP address from the target over the private LAN.
Locate and edit the following file:
/etc/default/isc-dhcp-server
This file is read-only, so you must open it with administrator privileges.
Modify the isc-dhcp-server file to set INTERFACES to the eth<n> connection you determined when connecting your network interface.
For example, add the following line if the DHCP server should listen on eth1 interface.
INTERFACES="eth1"
Note:
Changing the interface to “eth3” can result in the following error. To resolve this error, delete the /etc/udev/rules.d/70-persistent-net.rules file.
udevd[148]: error changing net interface name eth0 to eth3: Device or resource busy
3. Configure your host DHCP server for the target interface.
Locate and edit the following file:
/etc/dhcp/dhcpd.conf
Because the file is read-only, open it with administrator privileges.
Modify the dhcpd.conf file to contain the following:
ddns-update-style none;
allow bootp;
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.1;
option domain-name <domain_name>;
option domain-name-servers <DNS1>, <DNS2>, ... ;
default-lease-time 345600;
max-lease-time 31557600;
range 10.0.0.2 10.0.0.254;
option root-path "10.0.0.1:/<top>/drive-t186ref-linux/targetfs,wsize=8192,rsize=8192,v3";
}
Where:
<domain_name> is your company domain name.
<DNS1>, <DNS2> are the DNS servers that you already added to the /etc/resolv.conf file on your host system. Multiple DNS servers are separated by commas. For example, the Google public DNS IP addresses are formatted as:
8.8.8.8, 8.8.4.4
4. Restart the DHCP server:
sudo /etc/init.d/isc-dhcp-server restart
To set the NFS server
1. Install the NFS server on the host using apt-get:
sudo apt-get install nfs-kernel-server nfs-common portmap
2. Locate and edit the following file:
/etc/exports
Add the corresponding path to the target file system:
<path_to_targetfs> *(async,rw,no_root_squash,no_all_squash,no_subtree_check)
Where <path_to_targetfs> is the path where the targetfs file system resides.
This change exports the target file system.
3. Restart the NFS server:
sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -a
Enabling Internet Access from the Target
This topic contains instructions for setting up the Linux host and the target for accessing the Internet from the target.
The target file system is apt-get compatible, so with Internet access you can download and install additional packages using apt-get directly from the Ubuntu server (Ubuntu ARM port).
Note:
Online versions can change; hence, it cannot be guaranteed that the latest server pulled from the online repository works with your product.
Applies to: Releases supporting X Windows only: For X installations, the board must be booted before attempting to set up Internet connectivity. This ensures that the X server and other packages are installed from the local repository instead of online.
To enable Internet access from the target
1. On the Linux host, enter the following commands to enable settings on the host:
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo iptables -F
$ sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
Where eth1 is the interface connected to the network that is connected to the Internet on the host.
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Where eth0 is the private LAN interface connected to target from the host.
2. On the target, enter the following commands to enable settings on the target device:
$ sudo ip route add default via 10.0.0.1
$ dhclient <ethernet interface>
Where 10.0.0.1 is the IP address of the host as seen from the target.
The dhclient command also generates the name server configuration in the file:
/etc/resolv.conf
Note:
If you trying to enable Internet access from on NFS mounted system and the dhclient initially fails or hangs, you must manually add an /etc/resolv.conf file. For more information, ask your NVIDIA customer engineer.
3. On the target, resynchronize the package index files with the following command:
apt-get update