Search by Tags

Apalis TK1 Mainline Kernel with Nouveau Driver and Arch Linux Distro


Article updated at 15 Mar 2018
Compare with Revision

Subscribe for this article updates

Attention: This document is deprecated. If you require mainline based image for Apalis TK1 please use our mainline BSP image. If you still want to create arch based image have a look at mesa and kernel patches in our meta-toradex-tegra git.

This document describes how to build the mainline Linux kernel and Nouveau driver from scratch for Apalis TK1.

This manual is based on


Fedora 23/24:

sudo dnf install python glib2-devel autoconf automake libtool libffi-devel expat-devel libxml2-devel uboot-tools libtalloc-devel xorg-x11-util-macros
mkdir ~/bin 
export PATH=~/bin:$PATH 
curl > ~/bin/repo 
chmod a+x ~/bin/repo
git clone
cd PRoot/src
cp proot ~/bin/

Ubuntu 14.04:

sudo apt-get install git build-essential wget proot phablet-tools autoconf automake libtool libc6-i386 lib32stdc++6 lib32z1 pkg-config libwayland-dev
sudo apt-get install bison flex bc u-boot-tools glib-2.0 libffi-dev xutils-dev python-mako intltool libxml2-dev

Scripts use sudo, your user needs to be a sudoer.


All the required projects are synced using Google's repo tool:

mkdir tegra-nouveau-rootfs
cd tegra-nouveau-rootfs
repo init -u -m tegra-nouveau.xml

Sync all the sources:

repo sync -j4 -c

Once all the sources are downloaded, set the TOP environment variable:

export TOP=$PWD

Then download the cross-compilation toolchain that we will use:



By default the scripts included in the NVIDIA repo generate an Arch rootfs. You can prepare an Arch based rootfs by using a simple set of commands:


In case you'd like to use the kernel and kernel modules with a different rootfs you can skip downloading and unpacking Arch and just create appropriate folders needed by the kernel scripts:

mkdir -p $TOP/out/target/arm/ArchLinuxArm/boot/
mkdir -p $TOP/out/target/arm/ArchLinuxArm/lib/modules

Kernel Compilation

Modify the build script to build an uImage instead of a zImage:

vi $TOP/scripts/build-linux


 case $ARCH in
-         KIMAGE=zImage
+         KIMAGE=uImage


 # Build all that we need
- run_make_kernel -j$NPROC oldconfig dtbs $KIMAGE modules
+ run_make_kernel -j$NPROC oldconfig dtbs $KIMAGE modules LOADADDR=0x80008000

To make all peripherals on Apalis TK1 work apply the following patches:

curl > linux/0001-apalis-tk1-remove-spurious-new-lines.patch
patch -d linux -p1 < linux/0001-apalis-tk1-remove-spurious-new-lines.patch

curl > linux/0002-apalis-tk1-temp-alert-pull-up.patch
patch -d linux -p1 < linux/0002-apalis-tk1-temp-alert-pull-up.patch

curl > linux/0003-apalis-tk1-optional-displayport-hot-plug-detect.patch
patch -d linux -p1 < linux/0003-apalis-tk1-optional-displayport-hot-plug-detect.patch

curl > linux/0004-apalis-tk1-adjust-pin-muxing-for-v1.1-hw.patch
patch -d linux -p1 < linux/0004-apalis-tk1-adjust-pin-muxing-for-v1.1-hw.patch

curl > linux/0005-apalis-tk1-working-sd-card-detect-on-v1.1-hw.patch
patch -d linux -p1 < linux/0005-apalis-tk1-working-sd-card-detect-on-v1.1-hw.patch

curl > linux/0006-apalis-tk1-update-compatibility-comment.patch
patch -d linux -p1 < linux/0006-apalis-tk1-update-compatibility-comment.patch

curl > linux/0002-igb-integrate-tools-only-device-support.patch
patch -d linux -p1 < linux/0002-igb-integrate-tools-only-device-support.patch

curl > linux/0003-apalis_t30-tk1-igb-no-nvm-and-Ethernet-MAC-address-h.patch
patch -d linux -p1 < linux/0003-apalis_t30-tk1-igb-no-nvm-and-Ethernet-MAC-address-h.patch

curl > linux/0004-mmc-tegra-apalis-tk1-hack-to-make-sd1-functional.patch
patch -d linux -p1 < linux/0004-mmc-tegra-apalis-tk1-hack-to-make-sd1-functional.patch

Arch requires extra options to work properly:


It can be simply appended to the defconfig file:

echo CONFIG_SECCOMP=y >> $TOP/linux/arch/arm/configs/tegra_defconfig

If you need any special kernel configuration now it's time to edit defconfig:

vi $TOP/linux/arch/arm/configs/tegra_defconfig

Now you can build the Kernel:


And the Nouveau driver:


Afterwards you should have a kernel and several kernel modules (including the Nouveau driver) ready and included in your rootfs.

Extra Packages

To use the GPU in applications you'll need to build custom mesa. Run:


Installing Generated Arch Image on Apalis TK1

UMS Mode

While on the U-Boot prompt enter:

ums 0 mmc 0

Connect the board to the PC, two partitions should show up (boot & rootfs). Mount both of them.

Erase all files on mounted partitions. Then copy rootfs files to rootfs partition:

sudo rsync -aAXv $TOP/out/target/arm/ArchLinuxArm/* /path/to/rootfs/mountpoint/ 

As well as kernel and device tree to boot partition:

sudo cp $TOP/out/target/arm/ArchLinuxArm/boot/uImage-nouveau-arm /path/to/boot/mountpoint/uImage
sudo cp $TOP/out/target/arm/ArchLinuxArm/boot/dtb-nouveau/tegra124-apalis-eval.dtb /path/to/boot/mountpoint/

U-Boot Configuration

You need to clear the vidargs used with the BSP demo image to avoid any problems with displays. Enter U-Boot prompt and enter this commands:

setenv vidargs

Installing Wayland\Weston

By default there is no graphical user interface. Proceed as follows to install weston after having logged in as root/root:

pacman -S weston

After in finished installing, simply run it:


Installing Xorg Server

Initially Arch will not have any Xorg server installed. Proceed as follows to install one after having logged in as root/root:

pacman -S xorg-server xorg-xrandr

And then it may be started as follows:

X &
export DISPLAY=:0.0

To install a full blown desktop environment have a look at the following article on the Arch wiki:

Arch Linux Desktop Environments

E.g. LXDE worked fine for me:

pacman -S lxde
systemctl enable lxdm

GPU Speed

Since there is no dynamic frequency scaling in Nouveau yet. You can check and change the GPU frequency via sysfs:

    cat /sys/kernel/debug/dri/128/pstate
    01: core 72 MHz *
    02: core 108 MHz
    03: core 180 MHz
    04: core 252 MHz
    05: core 324 MHz
    06: core 396 MHz
    07: core 468 MHz
    08: core 540 MHz
    09: core 612 MHz
    0a: core 648 MHz
    0b: core 684 MHz
    0c: core 708 MHz
    0d: core 756 MHz
    0e: core 804 MHz
    0f: core 852 MHz
    DC: core 72 MHz 

echo 0f > /sys/kernel/debug/dri/128/pstate

Known Issues

The following Nouveau kernel boot messages are not to be worried about. The 0 Mib VRAM message is due to the K1 SoC using unified memory rather than separate GPU VRAM. And the ce channel error -22 is due to the GPU being integrated directly on the K1 SoC and not having to pass via PCIe:

[   11.367215] nouveau: loading out-of-tree module taints kernel.
[   11.400352] nouveau 57000000.gpu: NVIDIA GK20A (0ea000a1)
[   11.406127] nouveau 57000000.gpu: imem: using IOMMU
[   11.483058] [TTM] Zone  kernel: Available graphics memory: 378360 kiB
[   11.489737] [TTM] Zone highmem: Available graphics memory: 1033718 kiB
[   11.496474] [TTM] Initializing pool allocator
[   11.501044] [TTM] Initializing DMA pool allocator
[   11.506112] nouveau 57000000.gpu: DRM: VRAM: 0 MiB
[   11.511076] nouveau 57000000.gpu: DRM: GART: 1048576 MiB
[   11.521936] nouveau 57000000.gpu: DRM: failed to create ce channel, -22
[   11.637449] nouveau 57000000.gpu: DRM: MM: using GRCE for buffer copies