From a11600aa0b29a916f0ebcf8552a36f0035c6f3eb Mon Sep 17 00:00:00 2001 From: fridtjof Date: Mon, 11 Nov 2024 13:34:00 +0100 Subject: [PATCH] rock-5b-plus: add edge u-boot config from rock-5b --- config/boards/rock-5b-plus.conf | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/config/boards/rock-5b-plus.conf b/config/boards/rock-5b-plus.conf index d715d7d0da..b56986ba9f 100644 --- a/config/boards/rock-5b-plus.conf +++ b/config/boards/rock-5b-plus.conf @@ -25,3 +25,39 @@ function post_family_tweaks__rock5b_naming_audios() { return 0 } + +# Mainline u-boot tree +# see rock-5b.conf and https://github.com/armbian/build/pull/7135 +function post_family_config_branch_edge__rock-5b_use_mainline_uboot() { + display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info" + + declare -g BOOTCONFIG="rock5b-rk3588_defconfig" # override the default for the board/family + declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc + declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ Mainline tree + declare -g BOOTBRANCH="tag:v2024.10" # + declare -g BOOTPATCHDIR="v2024.10" # empty; defconfig changes are done in hook below + declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory + declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin" + unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already + + # Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go + function write_uboot_platform() { + dd "if=$1/u-boot-rockchip.bin" "of=$2" bs=32k seek=1 conv=notrunc status=none + } + + function write_uboot_platform_mtd() { + flashcp -v -p "$1/u-boot-rockchip-spi.bin" /dev/mtd0 + } +} + +function post_config_uboot_target__extra_configs_for_rock5b_mainline_environment_in_spi() { + [[ "${BRANCH}" != "edge" ]] && return 0 + + display_alert "$BOARD" "u-boot configs for ${BOOTBRANCH} u-boot config BRANCH=${BRANCH}" "info" + run_host_command_logged scripts/config --set-val CONFIG_ENV_IS_NOWHERE "n" + run_host_command_logged scripts/config --set-val CONFIG_ENV_IS_IN_SPI_FLASH "y" + run_host_command_logged scripts/config --set-val CONFIG_ENV_SECT_SIZE_AUTO "y" + run_host_command_logged scripts/config --set-val CONFIG_ENV_OVERWRITE "y" + run_host_command_logged scripts/config --set-val CONFIG_ENV_SIZE "0x20000" + run_host_command_logged scripts/config --set-val CONFIG_ENV_OFFSET "0xc00000" +}