odroidn2: bump to 2022.10 u-boot with boot order patch and nothing else; remove old legacy uboot crap (odroidn2 hasn't even had a legacy BRANCH for a while)

This commit is contained in:
Ricardo Pardini 2023-03-26 18:01:52 +02:00 committed by Igor Pečovnik
parent 62f5fe1596
commit 667ac5afb7
2 changed files with 29 additions and 49 deletions

View File

@ -5,15 +5,14 @@ KERNEL_TARGET="current,edge"
FULL_DESKTOP="yes"
FORCE_BOOTSCRIPT_UPDATE="yes"
BOOT_LOGO="desktop"
# Odroid N2 requires Odroid's u-boot for legacy kernel booting.
# These vars will be handled by the family (meson-g12b.conf)
USE_ODROID_UBOOT="legacy"
BOOTCONFIG="odroid-n2_defconfig" # For mainline uboot
BOOTCONFIG_ODROID="odroidn2_config" # For odroid uboot
BOOTSCRIPT_ODROID="boot-odroid-n2.ini:boot.ini" # For odroid uboot, default BOOTSCRIPT is boot-meson64.cmd for mainline (in meson64_common.inc)
# Newer u-boot for the N2/N2+, less patches: a single boot order patch
BOOTBRANCH_BOARD="tag:v2022.10"
BOOTPATCHDIR="v2022.10"
# Enable writing u-boot to SPI on the N2(+) for current and edge
# @TODO: replace this with an overlay, after meson64 overlay revamp
# To enable the SPI NOR the -spi .dtb is required, because eMMC shares a pin with SPI on the N2(+). To use it:
# fdtfile=amlogic/meson-g12b-odroid-n2-plus-spi.dtb # in armbianEnv.txt and reboot, then run nand-sata-install
UBOOT_TARGET_MAP="u-boot-dtb.img;;u-boot.bin.sd.bin:u-boot.bin u-boot-dtb.img u-boot.bin:u-boot-spi.bin"
@ -22,6 +21,7 @@ write_uboot_platform_mtd() {
}
# MAX might be different for N2/N2+, for now use N2+'s
# @TODO: remove? cpufreq is not used anymore, instead DT should be patched
CPUMIN=1000000
CPUMAX=2400000
GOVERNOR=performance # some people recommend performance to avoid random hangs after 24+ hours running.
@ -30,3 +30,5 @@ GOVERNOR=performance # some people recommend performance to avoid random hangs a
# https://github.com/u-boot/u-boot/blob/v2021.04/board/amlogic/odroid-n2/odroid-n2.c#L35-L106
# Unfortunately it uses n2_plus instead of n2-plus as the Kernel expects it.
# So there is a hack at and around config/bootscripts/boot-meson64.cmd L90
# If needed (eg for extlinux) you can specify the N2/N2+/ DTB in BOOT_FDT_FILE, example for the N2+:
# BOOT_FDT_FILE="amlogic/meson-g12b-odroid-n2-plus.dtb"

View File

@ -9,47 +9,25 @@
source "${BASH_SOURCE%/*}/include/meson64_common.inc"
ASOUND_STATE="asound.state.meson64"
if [[ -n ${USE_ODROID_UBOOT} ]] && [[ "${USE_ODROID_UBOOT}" == *"${BRANCH}"* ]]; then
# Current BRANCH is listed in USE_ODROID_UBOOT; use _ODROID variants if set.
BOOTCONFIG="${BOOTCONFIG_ODROID:-${BOOTCONFIG}}"
BOOTSCRIPT="${BOOTSCRIPT_ODROID:-${BOOTSCRIPT}}"
# Mainline u-boot, everything is done by meson64_common.inc, we just need to handle FIP blobs
# Enable Odroid's legacy u-boot building. This requires old toolchains etc, but does NOT require FIP trees.
UBOOT_TARGET_MAP=';;sd_fuse/u-boot.bin'
UBOOT_USE_GCC='< 4.9'
UBOOT_TOOLCHAIN2="arm-none-eabi-:< 5.0"
UBOOT_COMPILER="aarch64-none-elf-"
BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidg12-v2015.01'
BOOTPATCHDIR='u-boot-odroid'
BOOTDIR='u-boot-odroid'
write_uboot_platform() {
dd if=$1/u-boot.bin of=$2 bs=512 seek=1 conv=fsync > /dev/null 2>&1
}
else
# Mainline u-boot, everything is done by meson64_common.inc, we just need to handle FIP blobs
# Handling of FIP blobs
uboot_custom_postprocess() {
# @TODO: these should come from FIP_TREE_BOARD/FIP_TREE_FAMILY vars in board.conf instead of hardcoded here
if [[ $BOARD == odroidn2* ]]; then
# FIP trees 'odroid-n2-plus' and 'odroid-n2' are identical.
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/odroid-n2 g12b
elif [[ $BOARD == khadas-vim3 ]]; then
# 'khadas-vim3' FIP tree contains 'lpddr3_1d.fw' which will trigger '--ddrfw9' in uboot_g12_postprocess
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/khadas-vim3 g12b
elif [[ $BOARD == radxa-zero2 ]]; then
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/radxa-zero2 g12b
elif [[ $BOARD == bananapim2s ]]; then
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/bananapi-m2s g12b
elif [[ $BOARD == bananapicm4io ]]; then
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/bananapi-m2s g12b
else
echo "Don't know how to handle FIP trees for board '${BOARD}'"
exit 2
fi
}
fi
# Handling of FIP blobs
function uboot_custom_postprocess() {
# @TODO: these should come from FIP_TREE_BOARD/FIP_TREE_FAMILY vars in board.conf instead of hardcoded here
if [[ $BOARD == odroidn2* ]]; then
# FIP trees 'odroid-n2-plus' and 'odroid-n2' are identical.
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/odroid-n2 g12b
elif [[ $BOARD == khadas-vim3 ]]; then
# 'khadas-vim3' FIP tree contains 'lpddr3_1d.fw' which will trigger '--ddrfw9' in uboot_g12_postprocess
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/khadas-vim3 g12b
elif [[ $BOARD == radxa-zero2 ]]; then
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/radxa-zero2 g12b
elif [[ $BOARD == bananapim2s ]]; then
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/bananapi-m2s g12b
elif [[ $BOARD == bananapicm4io ]]; then
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/bananapi-m2s g12b
else
echo "Don't know how to handle FIP trees for board '${BOARD}'"
exit 2
fi
}