3.1. Android Kernel

3.1.1. Downloading sources

Fetch the code using repo:

$ mkdir ${YOUR_PATH}/ti-kernel-aosp/ && cd $_
$ repo init -u https://git.ti.com/git/android/manifest.git -b android14-release -m releases/RLS_10_00_Kernel.xml
$ repo sync

Tip

To save some disk space, pass the --depth=1 option to repo init:

$ repo init -u https://git.ti.com/git/android/manifest.git -b android14-release -m releases/RLS_10_00_Kernel.xml --depth=1

A preview for the android15-6.6 kernel is also available for testing via a dedicated manifest:

$ repo init -u https://git.ti.com/git/android/manifest.git -b android14-release -m releases/RLS_10_00_Kernel-6.6.xml

3.1.2. Build Instructions

3.1.2.1. Building everything from scratch

The kernel is compatible with all AM62x boards, such as the SK EVM and the Beagle Play.

$ cd ${YOUR_PATH}/ti-kernel-aosp/
$ export TARGET_KERNEL_USE="6.1" # or "6.6" for experimental kernel
$ export DIST_DIR=${YOUR_PATH}/ti-aosp-14/device/ti/am62x-kernel/kernel/${TARGET_KERNEL_USE}
$ tools/bazel run //common:ti_dist -- --dist_dir=$DIST_DIR

Android uses Kleaf, a Bazel-based build system to build the kernel. AOSP documentation can be found here and Kleaf documentation here

3.1.2.2. Rebuilding faster

$ cd ${YOUR_PATH}/ti-kernel-aosp/
$ export TARGET_KERNEL_USE="6.1" # or "6.6" for experimental kernel
$ export DIST_DIR=${YOUR_PATH}/ti-aosp-14/device/ti/am62x-kernel/kernel/${TARGET_KERNEL_USE}
$ tools/bazel run --config=fast //common:ti_dist -- --dist_dir=$DIST_DIR

3.1.2.3. Defconfig/menuconfig changes

The usual (make menuconfig) is done via bazel command :

$ cd ${YOUR_PATH}/ti-kernel-aosp/
$ tools/bazel run //common:ti_config -- menuconfig

Note

Users must have built the android kernel image prior to building the Android file system. Otherwise pre-built kernel images present in device/ti/am62x-kernel will be used to create boot.img

3.1.2.4. Rebuild Android images

We should re-generate the Android images to include the newly build kernel. Follow the Android Build Instructions to do so.

3.1.3. Flashing instructions

In order to flash a new kernel, several images should be flashed:

$ adb reboot fastboot
< Wait for fastbootd reboot >

$ cd <PATH/TO/IMAGES>
$ fastboot flash boot boot.img
$ fastboot flash vendor_boot vendor_boot.img
$ fastboot flash vendor_dlkm vendor_dlkm.img
$ fastboot reboot

The board should boot with the new kernel.