armbian-build/config/sources/families/meson-g12b.conf
Ricardo Pardini 2079811064
meson64: bump u-boot to 2021.07 // HC4/N2(+) cleanups (#3155)
* meson64: bump u-boot to 2021.07, rework patches

- as always based on chewitt's tree, with differences:
  - squashed versions of HC4+SATA, Radxa Zero, DT tree sync patches
    - so that DTB/config/code changes related to the same feature/board are grouped
  - removed documentation changes and Makefile reordering patches

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* meson64: ODROID HC4/N2: simplify/remove board vs family hacks; better SPI support

- thanks to mainline 2021.07 u-boot and it's HC4 config we can remove the conditionals
- boards now define the u-boot vars instead of conditionals in family
- on the HC4, build u-boot twice: one for SD (old C4 config) and one for HC4 (new SATA/SPI config)
  - reason is that the HC4 version does not work very well unless it is actually booted from SPI
- meson64_common: don't override UBOOT_TARGET_MAP if board-defined
  - but the default UBOOT_TARGET_MAP is still defined if the board didn't
- (sneakily) add lm-sensors fancontrol to the HC4's board packages

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
2021-09-26 20:47:33 +02:00

44 lines
1.6 KiB
Plaintext

source "${BASH_SOURCE%/*}/include/meson64_common.inc"
ASOUND_STATE="asound.state.meson64"
[[ ${BRANCH} == legacy ]] && SERIALCON=ttyS0
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}}"
# 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
else
echo "Don't know how to handle FIP trees for board '${BOARD}'"
exit 2
fi
}
fi