Add config: sources: families: meson-axg.conf
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
This commit is contained in:
parent
da899b2c93
commit
813bb6a668
72
config/sources/families/meson-axg.conf
Normal file
72
config/sources/families/meson-axg.conf
Normal file
@ -0,0 +1,72 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Copyright (c) 2024 Armbian
|
||||
#
|
||||
# This file is a part of the Armbian Build Framework
|
||||
# https://github.com/armbian/build/
|
||||
#
|
||||
|
||||
# shellcheck source=config/sources/families/include/meson64_common.inc
|
||||
source "${BASH_SOURCE%/*}/include/meson64_common.inc"
|
||||
|
||||
UBOOT_TARGET_MAP="u-boot-dtb.img;;u-boot.bin.sd.bin:u-boot.bin u-boot.bin:u-boot.nosd.bin u-boot-dtb.img"
|
||||
|
||||
uboot_custom_postprocess() {
|
||||
if [[ "$BOARD" == "gateway-gz80x" ]]; then
|
||||
uboot_axg_postprocess_ng "$SRC/cache/sources/amlogic-boot-fip/jethub-j100"
|
||||
else
|
||||
echo "Don't know how to handle FIP trees for board '${BOARD}'"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
write_uboot_platform() {
|
||||
local unable_install_uboot="Unable to install U-Boot."
|
||||
local method=0
|
||||
|
||||
if [[ "$2" == *mmcblk* ]]; then
|
||||
local mmcblk_prefix
|
||||
mmcblk_prefix=$(echo "$2" | grep -Po "mmcblk\d")
|
||||
logger "${FUNCNAME[0]}(): mmcblk_prefix = $mmcblk_prefix"
|
||||
|
||||
if [[ -n "$mmcblk_prefix" ]]; then
|
||||
local mmc_boot=${mmcblk_prefix}boot
|
||||
local of_boot0=/dev/${mmc_boot}0
|
||||
local of_boot1=/dev/${mmc_boot}1
|
||||
if [[ -e $of_boot0 ]]; then
|
||||
method=1
|
||||
logger "${FUNCNAME[0]}(): use install in boot emmc partitions"
|
||||
fi
|
||||
else
|
||||
logger "${FUNCNAME[0]}(): mmcblk_prefix is empty. $unable_install_uboot"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
logger "${FUNCNAME[0]}(): use standart u-boot install."
|
||||
fi
|
||||
|
||||
dd if="$1/u-boot.bin" of="$2" bs=1 count=442 conv=fsync > /dev/null 2>&1
|
||||
dd if="$1/u-boot.bin" of="$2" bs=512 skip=1 seek=1 conv=fsync > /dev/null 2>&1
|
||||
|
||||
if [[ $method == 1 ]]; then
|
||||
logger "${FUNCNAME[0]}(): of_boot0 = $of_boot0"
|
||||
logger "${FUNCNAME[0]}(): of_boot1 = $of_boot1"
|
||||
|
||||
# unset force-read-only flag
|
||||
echo 0 > "/sys/block/${mmc_boot}0/force_ro"
|
||||
echo 0 > "/sys/block/${mmc_boot}1/force_ro"
|
||||
logger "${FUNCNAME[0]}(): /sys/block/${mmc_boot}0/force_ro value after unsetting read-only flag: $(< "/sys/block/${mmc_boot}0/force_ro")"
|
||||
logger "${FUNCNAME[0]}(): /sys/block/${mmc_boot}1/force_ro value after unsetting read-only flag: $(< "/sys/block/${mmc_boot}1/force_ro")"
|
||||
|
||||
local uboot_name=u-boot.bin
|
||||
local uboot_size_in_kbytes=$(($(stat --printf "%s" "$1/$uboot_name") / 1024))
|
||||
local uboot_offset=1 # 512 bytes in dd
|
||||
logger "${FUNCNAME[0]}(): uboot_size_in_kbytes = $uboot_size_in_kbytes"
|
||||
logger "${FUNCNAME[0]}(): uboot_offset = $uboot_offset"
|
||||
dd if="$1/u-boot.bin" of="$of_boot0" bs=512 skip=1 conv=fsync > /dev/null 2>&1
|
||||
dd if="$1/u-boot.bin" of="$of_boot1" bs=512 skip=1 conv=fsync > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
logger "${FUNCNAME[0]}(): u-boot successfulley installed"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user