Differences between revisions 15 and 16
Revision 15 as of 2016-12-19 00:14:24
Size: 11485
Comment: Add links to upstream bug reports
Revision 16 as of 2017-01-02 18:22:33
Size: 10980
Comment: Remove i2c issue since initramfs-tools 0.126 is in testing now
Deletions are marked like this. Additions are marked like this.
Line 138: Line 138:
Furthermore, I'm seeing two issues I hadn't seen before when I'm performing an installation now:

 * When I install to an SD card and try to boot, it can't find the card and therefore not the root filesystem. This is because i2c-tegra module is not included in the ramdisk. Without i2c-tegra, mmc0 (eMMC) shows up but mmc1 (SD) does not. initramfs-tools 0.126, which was uploaded to unstable on 15 December, includes all i2c modules (bug #825687) so this will be fixed soon.
 * W
hen I boot into the installed system, the system hangs after displaying a [[http://www.spinics.net/lists/linux-tegra/msg28866.html|page fault error]]. A workaround is to remove all GPU modules (`/lib/modules/.../kernel/drivers/gpu`) from the disk.

With these workarounds, Debian seems to work well so maybe there's hope.
Furthermore, I'm seeing an issue I hadn't seen before: when I boot into the installed system, the system hangs after displaying a [[http://www.spinics.net/lists/linux-tegra/msg28866.html|page fault error]]. A workaround is to remove all GPU modules (`/lib/modules/.../kernel/drivers/gpu`) from the disk.

The Jetson TX1 developer kit from NVIDIA based is based on the Tegra X1 chip (also known as Tegra 210). The Tegra X1 (codenamed "Erista") features four ARM Cortex-A57 cores and four ARM Cortex-A53 cores in big.LITTLE configuration and a Maxwell GPU (GM20B) with 256 CUDA cores. The Jetson TX1 developer kit can run Debian's arm64 port. The Jetson TX1 developer kit is also known as P2371-2180 (see #Terminology).

Status

Support for the Jetson TX1 developer kit is currently work in progress. While the installer itself works, there are some major kernel problems (see below).

Console access

The Jetson TX1 developer kit does not come with a built-in serial console (either via RS-232 or mini-USB). However, the J21 header can be used to get serial output. You can find information about J21 and serial console access on the eLinux wiki. The JetsonHacks web site also has a good table of the J21 header pinout.

Once you have an appropriate connector, you can connect to the serial console using screen or minicom. For example:

screen /dev/ttyUSB0 115200

The board is set up with a 2-second pause during boot, where a character received on this console should interrupt the normal boot process and get you a U-Boot prompt.

/!\ At the moment, you need serial console access to install Debian.

Installing U-Boot

The U-Boot shipped by NVIDIA does not work with Debian, so please install the precompiled U-Boot image provided by Debian.

In order to flash U-Boot to your Jetson, you have to put it in recovery mode:

  • Turn the device off
  • Connect the micro-B USB connector on the Jetson (USB0) with the USB port on your host
  • Hold the "REC" button
  • Turn the board on (while still holding the "REC" button)
  • Release the button after a few seconds
  • You won't see anything on the serial console. However, lsusb on your host should show the following device: 0955:7721 NVidia Corp.

In order to install U-Boot from Debian, please obtain the Linux For Tegra R24.2.1 driver package (Tegra210_Linux_R24.2.1_aarch64.tbz2; November 2016) from NVIDIA's developer site.

If you're running Debian stretch, you can install the Tegra U-Boot package on your host:

sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install u-boot-tegra:arm64

If you're on an older version of Debian, you can download the package and unpack it somewhere (dpkg -x u-boot-tegra*.deb tmp).

Now flash U-Boot to your Jetson:

cd Linux_for_Tegra
sudo ./flash.sh -L /usr/lib/u-boot/p2371-2180/u-boot.bin jetson-tx1 mmcblk0p1

(Change the location of the jetson-tx1 directory if you unpacked the package manually.)

Obtaining Debian installer

You can use the standard Debian installer from stretch to install Debian on your Jetson TX1 developer kit. Debian installer from Debian stable (jessie, Debian 8) does not work because this board is not supported by that kernel.

Download the kernel (linux) and ramdisk (initrd.gz).

The Jetson TX1 requires proprietary firmware for USB support (note that Ethernet is wired up via USB), so please download the xusb.bin firmware file. We can create a compressed cpio archive containing this file which we append to the installer initrd:

mkdir -p initrd/lib/firmware/nvidia/tegra210
cp xusb.bin initrd/lib/firmware/nvidia/tegra210
(cd initrd ; find . | sort | cpio --quiet -o -H newc) > initrd-xusb
gzip initrd-xusb
mv initrd.gz initrd-orig.gz
cat initrd-orig.gz initrd-xusb.gz > initrd.gz

Now copy linux and initrd.gz to an SD card formatted with either the VFAT or EXT2 filesystem. Download the DTB for the Jetson TX1 developer kit and store it on the SD card as /dtbs/tegra210-p2371-2180.dtb.

Finally, we have to create a boot script which will boot the installer. Save the following commands in a file called boot.scr.in:

if test -z "${fdtfile}"; then
  setenv fdtfile tegra210-p2371-2180.dtb
  saveenv
fi

load ${devtype} ${devnum}:${partition} ${kernel_addr_r} linux \
&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} dtbs/${fdtfile} \
&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} initrd.gz \
&& echo "Booting the Debian installer..." \
&& booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}

Now you can create the boot script on the SD card (mounted at /mnt in this example):

mkimage -T script -A arm64 -d boot.src.in /mnt/boot.scr

Loading Debian installer

Put the SD card into the Jetson and reset the board. It should just boot off the SD card. If not, you can do it manually:

run bootcmd_mmc1

Installing Debian

The installer will start and you can perform a normal installation. You can consult the installation guide for more information.

You can install to the internal eMMC or the external SD card (or a USB stick, not covered here).

Installing to Internal flash

To install to the internal eMMC, choose the "manual" partition method instead of "guided". Look for the "APP" partition (normally /dev/mmcblk0p1) and choose that as your root device. It can be formatted with the EXT2 or EXT3 filesystem (EXT4 is not read properly by uboot so will not boot). Leave the other partitions alone as they are used for things like storing the boot loader itself. Ignore the warning about not having selected a partition for swap and format the disk.

/!\ Even though the EXT4 filesystem is supposed to work, it doesn't boot properly. EXT2 and EXT3 work OK. YMMV (see #Known Issues)

The board can boot directly from the eMMC device. After you finish your installation, remove the SD card, and Debian will boot from the internal flash. You can override this by putting in an external bootable SD card.

Installing to External SD

To install to the external SD, choose the guided partitioning method and select "MMC/SD card #2 (mmcblk1)" in the installer.

After you finish your installation, Debian will boot from the external SD card. The external SD card has preference over the internal eMMC.

/!\ Reboot stuck

When you reboot after completing the installation, you'll see "Requesting system reboot" but then nothing happens. You can press the "RST" button to reset the device.

Problems

This sounds all pretty good so far. Unfortunately, there are some major problems. First of all, USB support doesn't work reliably. In the installer, the built-in Ethernet device doesn't show up all the time. Connecting an Ethernet USB adapter seems to work in these cases. Even worse, after the installation, USB doesn't work at all (not even the adapter). I see this in the kernel logs:

usb3-0: tegra210_usb3_port_enable: failed to enable UPHY: -110
usb3-1: tegra210_usb3_port_enable: failed to enable UPHY: -110

My assumption is that this is a timing issue. Unfortunately, NVIDIA hasn't investigated this issue yet. Update: this was with 4.8. So far, I haven't run into this issue with 4.9 and the built-in Ethernet shows up reliably in the installed system (but not necessarily in the installer).

Furthermore, I'm seeing an issue I hadn't seen before: when I boot into the installed system, the system hangs after displaying a page fault error. A workaround is to remove all GPU modules (/lib/modules/.../kernel/drivers/gpu) from the disk.

Running Debian on the Jetson TX1 developer kit

Firmware

The Jetson TX1 developer kit requires some non-free firmware files to operate fully. Please configure Debian's non-free repository in APT and install the firmware-misc-nonfree package. This is required for the operation of:

  • GM20B graphics core (nouveau)
  • USB

Graphics

NVIDIA ported the free nouveau driver to the Maxwell GPU (GM20B) of the Tegra X1.

According to Alexandre Courbot from NVIDIA, "you need to patch X a bit for it to take advantage of Nouveau/GLamor (and also enable DRM_TEGRA_STAGING in the kernel and compile libdrm with --enable-tegra-experimental-api)".

Debian's kernel and the libdrm package have the required options enabled. However, the X patches are missing. This is work in progress.

Boot script

U-Boot needs a script (boot.scr) to boot. This will be installed to /boot by flash-kernel during the install process (the default script /etc/flash-kernel/bootscript/bootscr.uboot-generic is used). If for some reason you don't complete the install you need to do this step manually, by installing the flash-kernel package and running

flash-kernel

(or if need be you could edit the script to fill in the @@KERNEL_VERSION@@ variable yourself (and remove the other @@foo@@ variables) and copy it in manually)

Terminology

The Jetson TX1 developer kit is known as P2371-2180 in U-Boot and Linux. This is because the Jetson TX1 developer kit consists of the P2180 CPU board and the P2597 I/O board. The Jetson TX1 module (P2180) can be bought separately and is found in some products.

Known issues

  • Booting from EXT4 doesn't work reliably. I used EXT4 as the filesystem for the "APP" partition and I was able to boot only once. The other times I always get a failure, mostly because U-Boot thinks some of the files are 0 bytes. When I boot into Debian installer again and inspect the files, they are not 0 byte. I need to investigate this further. This is likely due to a bug in u-boot: https://bugs.debian.org/823500

  • USB support doesn't work reliably. I believe this is due to a timing issue

  • Reboot hangs