Project

General

Profile

Linux Kernel

Before you begin

There are multiple ways to customize and compile the Linux kernel for your project. Please try to build the kernel as-is with no changes before you try to add your customizations. This will ensure your environment and toolchain are setup correctly.

  1. ARM toolchain - You can use a previously compiled ARM toolchain provided by ARM.
  2. Yocto Environment - If you are using the docker environment and Yocto for your filesystem, you can use its tools to customize and build your kernel.

In most cases, you will use one of the first two options for initial bring-up and testing. Then, once you have everything working you can integrate into Yocto.

Critical Link Kernel Repository

Critical Link recommends using the mitysom-linux-4.19 branch on our git server: https://support.criticallink.com/gitweb/?p=processor-sdk-linux.git;a=summary.

Other MitySOM-AM57x branches seen on the repository should not be considered stable, and are used for internal feature development.

The mitysom-linux-4.19 branch contains extensions to TI's processor-sdk-linux-4.19.y branch
TI also has the following linux repo which seem to contain patches not yet released to their processor-sdk. ti-linux-kernel

Kernel Build - ARM toolchain

Configuring the Kernel Build Environment

Download the ARM toolchain (Should only need to be done once)

mkdir -p /home/tools/mitysom-57x
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz -O - | tar -Jxv -C /home/tools/mitysom-57x/

Clone the kernel sources

git clone --branch mitysom-linux-4.19 https://support.criticallink.com/git/processor-sdk-linux.git 
cd processor-sdk-linux

Setup the build environment using the following commands (Required everytime you launch a new shell):

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export PATH=$PATH:/home/tools/mitysom-57x/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin

Customize your kernel

Now that you have the kernel source code, you can customize as needed. For most projects, you will want a custom defconfig and a custom device tree. One way to create a custom defconfig is to start with a known config and edit it using the kernel's menuconfig interface:

$ make mitysom-am57x-devkit_defconfig
$ make menuconfig

Press <esc> to exit the menuconfig interface and make sure you save your changes.

Please contact Critical Link if you need help with customizing your defconfig and Device Tree for your application.

DRAFT: Add notes on how to integrate new dts and to extract the Critical Link baseboard defconfig and dts from the Yocto build.

Building the kernel

Run the following commands to build the kernel.

 
$ make dtbs
$ make zImage
$ make modules
$ make INSTALL_MOD_PATH=../rootfs modules_install

This will build the required modules and then install them under ../rootfs
The zImage will be located at arch/arm/boot/zImage
The built dtbs will be located at arch/arm/boot/dts/*.dtb

If you are building the kernel in /home/username/build/processor-sdk-linux, the modules can be found in /home/username/build/rootfs/lib/.
You would then copy the lib directory onto your target FS under /lib.

Alternatively, you can modify INSTALL_MOD_PATH to point to the location of your mounted rootfs. This will allow you to skip the manual copy step.

If INSTALL_MOD_PATH is omitted, the modules_install target will install the modules under /lib on your build machine, which is highly likely to NOT be what you want!

Kernel Build - Yocto

For this option, you should have an environment setup as described in Docker build environment and Building the Yocto Root Filesystem for MitySOM-AM57X.

With this option, the general Yocto setup configures your build environment. You can compile your kernel by running bitbake commands from your build directory.

Customize your kernel

You can change the configuration of the kernel by running:

user@8ec23474095b:~$ MACHINE=mitysom-am57x bitbake -c menuconfig virtual/kernel

Building the kernel

Then, to build the kernel:

user@8ec23474095b:~$ MACHINE=mitysom-am57x bitbake virtual/kernel

Go to top
Add picture from clipboard (Maximum size: 600 MB)