IMX6 4x Kernel Compile Guide

From embeddedTS Manuals
Revision as of 12:03, 5 February 2021 by Derek (talk | contribs) (Fix broken link)

This board uses a 4.1.15 kernel on most all images. Our kernels are based on NXP's which are changed from upstream for their board support. We change them to support the various hardware we use with this processor.

  • embeddedarm/linux-3.10.17-imx6
  • The "imx_4.1.15_1.0.0_ga" branch includes support for our TS-4900, TS-7970, TS-7990, and TS-4100.
    • This kernel works with all our Debian releases, Ubuntu, Yocto Jethro, and Yocto Krogoth.

The kernel branch can be selected once the git repository is cloned as outlined below. The kernel can be rebuilt by cross compiling from an X86/X86_64 Linux. Our default kernels are rebuilt using the toolchains built by Yocto. You can download the appropriate cross toolchain for your Linux system here: /u/home/ftp/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/

chmod a+x poky-*toolchain-*.sh
sudo ./poky-*toolchain-*.sh

This will ask for the install directory for the toolchain. Our instructions will assume the default path is used.

This also requires several tools from the host PC linux distribution. For Ubuntu/Debian:

sudo apt-get install git build-essential lzop u-boot-tools libncursesw5-dev

Once those are installed:

# This will pull our shared kernel, using the 4.1.15 branch, use a folder linux-imx6, and only
# download the latest changes.
git clone https://github.com/embeddedarm/linux-3.10.17-imx6.git -b imx_4.1.15_1.0.0_ga linux-imx6 --depth 1
cd linux-imx6

# These two must be run each time you open a terminal to build the kernel.
export CROSS_COMPILE="/opt/poky/2.2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-"
# Or if you are using the i686 toolchain:
# export CROSS_COMPILE="ccache /opt/poky/2.2.2/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-"
export ARCH=arm
export LOADADDR=0x10008000

make ts4900_defconfig

## Make any changes in "make menuconfig" or driver modifications, then compile
make && make uImage

To install this to an SD card, use a USB SD card reader connected to the host PC. Assuming the SD card has the Linux rootfs set up on "sdc1":

export DEV=/dev/sdc1
sudo mount "$DEV" /mnt/sd
sudo rm /mnt/sd/boot/uImage
sudo cp arch/arm/boot/uImage  /mnt/sd/boot/uImage
sudo cp arch/arm/boot/dts/imx6*ts*.dtb /mnt/sd/boot/
INSTALL_MOD_PATH="/mnt/sd" sudo -E make modules_install 
sudo -E make headers_install INSTALL_HDR_PATH="/mnt/sd/usr"
sudo umount /mnt/sd/
sync

Change Kernel Splash Screen

Note: that the HDMI does not support this method of a splash screen. On the TS-7970 this only applies to LVDS displays.

The kernel splashscreen allow for a 224 color image, up to the full screen resolution. For the fastest boot speed, it should be kept as small as possible. The image will be centered around a black background.

To convert an image, for example, "mylogo.png":

convert mylogo.png mylogo.ppm
ppmquant 224 mylogo.ppm > mylogo-224.ppm
pnmnoraw mylogo-224.ppm > logo_user_clut224.ppm
cp logo_user_clut224.ppm <kernel build sources>/drivers/video/logo/

Recompile the kernel following the guide in the previous section to have the splashscreen appear on all future boots.

Add to the kernel cmdline in U-Boot, "logo.nologo" in order to completely disable the splash screen.