Project

General

Profile

Building the Linux Kernel and Device Tree outside of Yocto 18.1

This guide covers the creation of the Critical Link provided Linux kernel and device tree for the MitySOM-5CSx Dev Kit outside of Yocto. The kernel and device tree should be built separately during development since the kernel name will be inconsistent in some places and will affect module loading.

Overview

Critical Link has a kernel repository on our local Git server. The kernel project for the MitySOM-5CSx tracks the linux-socfpga kernel on rocketboards.org, and only modifications to support the MitySOM-5CSx module have been added. Currently, that amounts to a new kernel configuration file and device tree settings file. The current supported kernel version is 4.9.78-ltsi.

The Critical Link Dev Kit includes the following device tree sources:
  • socfpga_mitysom5cse_devkit.dts
  • socfpga_mitysom5cse-h4-3ya_devkit.dts
  • socfpga_mitysom5cse-h4-8ya_devkit.dts
  • socfpga_mitysom5csx_devkit.dts
  • socfpga_mitysom5csx-h6-4ya_devkit.dts
  • socfpga_mitysom5csx-h6-53b_devkit.dts

Prerequisites

Using a Linux machine (Ubuntu 18.04, is what this was tested on) or WSL2 in Windows (guide for install WSL can be found here: https://learn.microsoft.com/en-us/windows/wsl/install)

  1. Download the pre-built Yocto SDK installer: poky-glibc-x86_64-mitysom-image-base-cortexa9hf-neon-toolchain-2.4.4.sh
  2. Install the script to /opt/poky/2.4.4/.
    ./Downloads/poky-glibc-x86_64-mitysom-image-base-cortexa9hf-neon-toolchain-2.4.4.sh
    

Building the kernel and device tree

The following steps will recreate the kernel and device tree for the MitySOM-5CSx Dev Kit. Note: The kernel and DTB will normally be built through the Yocto build, but the steps here are provided for development.

  1. Source the Yocto SDK.
    source /opt/poky/2.4.4/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
    
  2. Grab the kernel from our Git repo.
    git clone https://support.criticallink.com/git/linux-socfpga.git -b socfpga-4.9.78-ltsi
    
  3. Change into that directory.
    cd linux-socfpga
    
  4. Set a base configuration for the kernel.
    make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -j8 mitysom5csx_devkit_defconfig
    
  5. Build the kernel. The kernel will be built at arch/arm/boot/zImage.
    make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -j8 zImage
    
  6. Build the device tree blobs. The device tree blobs will be built in arch/arm/boot/dts.
    make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -j8 dtbs
    

Building Kernel Modules

Below are instructions on how to build kernel modules. These instructions expect you to be in your kernel directory, with the toolchain sourced, and kernel already built.

  1. Build the modules
    make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -j8 modules
    
  2. Copy all the modules into /tmp so they can easily be copied to an SD card at /lib of the rootfs
    make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- INSTALL_MOD_PATH=/tmp modules_install
    
  3. Manually copy /tmp/lib to rootfs of your SD card

Go to top
Add picture from clipboard (Maximum size: 1 GB)