Files
build/config/sources/families/k3.conf
Andrew Davis f98216d2c3 K3: Update to latest U-Boot v2025.01
Now that upstream U-Boot has support for building K3 boot artifacts
we can drop using the ti-u-boot fork. Switch to v2025.01 and
adjust file names and add new dependencies as needed.
2025-01-30 19:03:48 +01:00

99 lines
3.0 KiB
Plaintext

#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
#
declare -g ARCH="arm64"
declare -g LINUXFAMILY="k3"
declare -g OVERLAY_DIR="/boot/dtb/ti/overlay"
declare -g ATFBRANCH="tag:v2.12.0"
declare -g BOOTBRANCH="tag:v2025.01"
declare -g BOOTSCRIPT="boot-k3.cmd:uEnv.txt"
case "${BRANCH}" in
current)
declare -g KERNELSOURCE="https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel"
declare -g KERNEL_MAJOR_MINOR="6.1"
declare -g KERNELBRANCH="branch:ti-linux-6.1.y"
;;
edge)
declare -g KERNEL_MAJOR_MINOR="6.6"
declare -g KERNELBRANCH='branch:linux-6.6.y'
EXTRAWIFI="no"
;;
esac
ATF_PLAT="k3"
ATF_TARGET_MAP="PLAT=$ATF_PLAT TARGET_BOARD=$ATF_BOARD DEBUG=1 ${ATF_K3_USART_OFFSET} bl31;;build/$ATF_PLAT/$ATF_BOARD/debug/bl31.bin:bl31.bin"
UBOOT_TARGET_MAP="BL31=bl31.bin TEE=bl31.bin BINMAN_INDIRS=${SRC}/cache/sources/ti-linux-firmware all;;tiboot3.bin ${SYSFW_FILE:+sysfw.itb} tispl.bin u-boot.img"
# To match what our current SDK produces
BOOT_FS_LABEL="boot"
ROOT_FS_LABEL="root"
function add_host_dependencies__k3_python3_dep() {
display_alert "Preparing K3 U-Boot host-side dependencies" "${EXTENSION}" "info"
declare -g EXTRA_BUILD_DEPS="${EXTRA_BUILD_DEPS} python3-yaml python3-jsonschema yamllint"
}
function compile_k3_bootgen() {
# Source code checkout
(fetch_from_repo "https://git.ti.com/cgit/processor-firmware/ti-linux-firmware" "ti-linux-firmware" "branch:ti-linux-firmware")
pushd ${SRC}/cache/sources/u-boot-worktree/${BOOTDIR}/${BOOTBRANCH##*:} || exit
run_host_command_logged make -j$(nproc) CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm O=build-r5 ${TIBOOT3_BOOTCONFIG}
run_host_command_logged make -j$(nproc) CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm O=build-r5 BINMAN_INDIRS=${SRC}/cache/sources/ti-linux-firmware
popd
}
function pre_config_uboot_target__build_first_stage() {
# Compile first stage bootloader
compile_k3_bootgen
cp ${SRC}/cache/sources/u-boot-worktree/${BOOTDIR}/${BOOTBRANCH##*:}/build-r5/${TIBOOT3_FILE} tiboot3.bin
cp ${SRC}/cache/sources/u-boot-worktree/${BOOTDIR}/${BOOTBRANCH##*:}/build-r5/${SYSFW_FILE} sysfw.itb || true
}
function post_uboot_custom_postprocess__update_uboot_names() {
cp ${TISPL_FILE} tispl.bin || true
cp ${UBOOT_FILE} u-boot.img || true
}
function pre_prepare_partitions() {
# Filesystem must fill partition regardless of alignment
mkopts[fat]='-a'
}
function post_create_partitions() {
display_alert "Setting boot partition flags on" "${SDCARD}.raw" "debug"
# ROM is very particular about boot flags
run_host_command_logged parted "${SDCARD}".raw set 1 boot on
run_host_command_logged parted "${SDCARD}".raw set 1 bls_boot off
}
function format_partitions() {
# ROM is very particular about partition IDs
run_host_command_logged sfdisk --part-type ${LOOP} 1 e
}
function write_uboot_platform() {
cp $1/tiboot3.bin ${MOUNT}/boot
cp $1/sysfw.itb ${MOUNT}/boot || true
cp $1/tispl.bin ${MOUNT}/boot
cp $1/u-boot.img ${MOUNT}/boot
}