Khadas VIM4: Update and Fixup U-Boot (#8631)

* Khadas VIM4: U-Boot: Mod bootargs/defconfig and add bootscr support

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Khadas VIM4: Pull U-Boot from CoreELEC instead of Khadas

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Khadas VIM4: Remove setexpr bootargs sub rootfstype= from boot.cmd

This is no longer required

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Meson S4T7: family.conf: Add missing `mkdir -p "${tbasedir}"`

The toolchains fail to download because the dir isn't created

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Meson T7: Add rootfstype= to command line

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Khadas VIM4: Add extra boot arguments

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Remove `viraniac` as maintainer and add `rw` to cmdline

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Amlogic T7: Add `fsck.repair=yes` and `rootwait` to cmdline

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

* Amlogic T7: Move `${bootargs}` placement

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>

---------

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Co-authored-by: Igor <igor@armbian.com>
This commit is contained in:
c0rnelius
2025-09-15 16:44:28 -04:00
committed by GitHub
parent 0e15bd4a01
commit 0a7f461e57
7 changed files with 133 additions and 38 deletions

View File

@@ -2,7 +2,7 @@
BOARD_NAME="Khadas VIM4"
BOARDFAMILY="meson-s4t7"
KERNEL_TARGET="legacy"
BOARD_MAINTAINER="adeepn leggewie rpardini"
BOARD_MAINTAINER="adeepn leggewie pyavitz rpardini"
SERIALCON="ttyS0" # for vendor kernel
# BOOT_FDT_FILE="amlogic/kvim4.dtb" # not set on purpose; u-boot auto-selects kvim4.dtb or kvim4n.dtb for "new VIM4"
@@ -36,3 +36,10 @@ function vim4_bsp_legacy_postinst_link_video_firmware() {
function post_family_tweaks_bsp__vim4_link_video_firmware_on_install() {
postinst_functions+=(vim4_bsp_legacy_postinst_link_video_firmware)
}
function pre_install_kernel_debs__extra_boot_args() {
display_alert "$BOARD" "Add extra boot arguments" "info"
run_host_command_logged echo "extraargs=net.ifnames=0 no_console_suspend fan=auto" >> "${SDCARD}"/boot/armbianEnv.txt
return 0
}

View File

@@ -36,9 +36,7 @@ else
setenv plymouthargs "splash=verbose"
fi
setexpr bootargs sub "rootfstype=\\S*" "rootfstype=${rootfstype}" "${bootargs}"
setenv bootargs "root=${rootdev} ${bootargs} ${consoleargs} partition_type=generic loglevel=${verbosity} ${plymouthargs} ${extraargs} ${extraboardargs}"
setenv bootargs "${bootargs} root=${rootdev} rootfstype=${rootfstype} rw fsck.repair=yes rootwait ${consoleargs} partition_type=generic loglevel=${verbosity} ${plymouthargs} ${extraargs} ${extraboardargs}"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}

View File

@@ -26,7 +26,7 @@ case $BRANCH in
esac
# Lets build uboot from source
BOOTSOURCE="${GITHUB_SOURCE}/khadas/u-boot.git"
BOOTSOURCE="${GITHUB_SOURCE}/CoreELEC/u-boot.git"
BOOTBRANCH="branch:khadas-vims-v2019.01"
BOOTPATCHDIR="u-boot-meson-s4t7"
BOOTENV_FILE='meson.txt'
@@ -62,6 +62,8 @@ function fetch_sources_tools__meson_s4t7_download_uboot_toolchain() {
declare tfile="gcc-linaro-${tversion}-${tos}_aarch64-elf.tar.xz"
declare turl="https://dl.armbian.com/_toolchain/${tfile}"
mkdir -p "${tbasedir}"
if [[ ! -d "${tdir}" ]]; then
run_host_command_logged wget --progress=dot:giga -O "${tbasedir}/${tfile}" "${turl}"
run_host_command_logged tar -C "${tbasedir}" -xf "${tbasedir}/${tfile}"
@@ -108,6 +110,11 @@ function build_custom_uboot__meson_s4t7_build_custom_uboot() {
export CROSS_COMPILE="aarch64-elf-"
rm -rf "${PWD}"/fip/_tmp
# U-Boot Defconfig
run_host_command_logged make -j`nproc` $BOOTCONFIG
# U-Boot Binary
run_host_command_logged make -j`nproc`
# Firmware Image Package (fip)
run_host_command_logged bash fip/mk_script.sh "${KHADAS_BOARD_ID}" "${PWD}"
loop_over_uboot_targets_and_do deploy_built_uboot_bins_for_one_target_to_packaging_area
declare -g EXTENSION_BUILT_UBOOT=yes