210 lines
4.9 KiB
Plaintext
210 lines
4.9 KiB
Plaintext
BOOTSOURCE=$MAINLINE_UBOOT_SOURCE
|
|
BOOTDIR=$MAINLINE_UBOOT_DIR
|
|
BOOTBRANCH='tag:v2019.07'
|
|
|
|
UBOOT_USE_GCC='> 7.0'
|
|
UBOOT_TARGET_MAP="u-boot-dtb.img;;u-boot.bin.sd.bin:u-boot.bin u-boot-dtb.img"
|
|
BOOTSCRIPT="boot-meson64.cmd:boot.cmd"
|
|
BOOTENV_FILE='meson64-next.txt'
|
|
|
|
ARCH=arm64
|
|
KERNEL_IMAGE_TYPE=Image
|
|
SERIALCON=ttyAML0
|
|
|
|
OVERLAY_PREFIX='meson'
|
|
|
|
if [[ $BOARD == odroidc2 ]]; then
|
|
UBOOT_TARGET_MAP=";;$SRC/cache/sources/odroidc2-blobs/bl1.bin.hardkernel u-boot.bin"
|
|
|
|
BOOTENV_FILE='odroidc2-next.txt'
|
|
fi
|
|
|
|
if [[ $BOARD == lafrite ]]; then
|
|
UBOOT_TARGET_MAP="u-boot-dtb.img;;u-boot.bin:u-boot.bin u-boot-dtb.img"
|
|
fi
|
|
|
|
case $BRANCH in
|
|
|
|
default)
|
|
|
|
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
|
KERNELBRANCH='branch:linux-4.14.y'
|
|
KERNELDIR=$MAINLINE_KERNEL_DIR
|
|
KERNEL_USE_GCC='> 7.0'
|
|
SERIALCON='ttyAML0'
|
|
|
|
;;
|
|
|
|
next)
|
|
|
|
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
|
KERNELBRANCH='branch:linux-4.19.y'
|
|
KERNELDIR=$MAINLINE_KERNEL_DIR
|
|
KERNEL_USE_GCC='> 7.0'
|
|
SERIALCON='ttyAML0'
|
|
;;
|
|
|
|
dev)
|
|
|
|
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
|
KERNELBRANCH='branch:linux-5.3.y'
|
|
KERNELDIR=$MAINLINE_KERNEL_DIR
|
|
SERIALCON='ttyAML0'
|
|
KERNEL_USE_GCC='> 7.0'
|
|
|
|
;;
|
|
esac
|
|
|
|
CPUMIN=500000
|
|
CPUMAX=1536000
|
|
GOVERNOR=conservative
|
|
|
|
# this helper function includes postprocess for p212 and its variants.
|
|
# $1 PATH for uboot blob repo
|
|
# $2 dir name in uboot blob repo
|
|
uboot_gxl_postprocess()
|
|
{
|
|
mv u-boot.bin bl33.bin
|
|
|
|
$1/blx_fix.sh $1/$2/bl30.bin \
|
|
$1/$2/zero_tmp \
|
|
$1/$2/bl30_zero.bin \
|
|
$1/$2/bl301.bin \
|
|
$1/$2/bl301_zero.bin \
|
|
$1/$2/bl30_new.bin bl30
|
|
|
|
python $1/acs_tool.pyc $1/$2/bl2.bin \
|
|
$1/$2/bl2_acs.bin \
|
|
$1/$2/acs.bin 0
|
|
|
|
$1/blx_fix.sh $1/$2/bl2_acs.bin \
|
|
$1/$2/zero_tmp \
|
|
$1/$2/bl2_zero.bin \
|
|
$1/$2/bl21.bin \
|
|
$1/$2/bl21_zero.bin \
|
|
$1/$2/bl2_new.bin bl2
|
|
|
|
$1/$2/aml_encrypt_gxl --bl3enc --input $1/$2/bl30_new.bin
|
|
$1/$2/aml_encrypt_gxl --bl3enc --input $1/$2/bl31.img
|
|
$1/$2/aml_encrypt_gxl --bl3enc --input bl33.bin
|
|
|
|
$1/$2/aml_encrypt_gxl --bl2sig --input $1/$2/bl2_new.bin \
|
|
--output bl2.n.bin.sig
|
|
|
|
$1/$2/aml_encrypt_gxl --bootmk \
|
|
--output u-boot.bin \
|
|
--bl2 bl2.n.bin.sig \
|
|
--bl30 $1/$2/bl30_new.bin.enc \
|
|
--bl31 $1/$2/bl31.img.enc \
|
|
--bl33 bl33.bin.enc
|
|
}
|
|
|
|
uboot_custom_postprocess()
|
|
{
|
|
if [[ $BOARD == odroidc2 ]]; then
|
|
local t=$SRC/cache/sources/odroidc2-blobs/
|
|
$t/fip_create --bl30 $t/gxb/bl30.bin \
|
|
--bl301 $t/gxb/bl301.bin \
|
|
--bl31 $t/gxb/bl31.bin \
|
|
--bl33 u-boot.bin \
|
|
fip.bin
|
|
$t/fip_create --dump fip.bin
|
|
cat $t/gxb/bl2.package fip.bin > boot_new.bin
|
|
rm -f u-boot.img
|
|
$t/gxb/aml_encrypt_gxb --bootsig \
|
|
--input boot_new.bin \
|
|
--output u-boot.img
|
|
rm -f u-boot.bin
|
|
dd if=u-boot.img of=u-boot.bin bs=512 skip=96 status=none
|
|
fi
|
|
|
|
if [[ $BOARD == lepotato ]]; then
|
|
uboot_gxl_postprocess $SRC/cache/sources/odroidc2-blobs/ gxl
|
|
fi
|
|
|
|
if [[ $BOARD == kvim1 ]]; then
|
|
uboot_gxl_postprocess $SRC/cache/sources/odroidc2-blobs/ vim1
|
|
fi
|
|
|
|
if [[ $BOARD == nanopik2-s905 ]]; then
|
|
local t=$SRC/cache/sources/odroidc2-blobs/
|
|
mv u-boot.bin bl33.bin
|
|
|
|
$t/blx_fix.sh $t/k2/bl30.bin \
|
|
$t/k2/zero_tmp \
|
|
$t/k2/bl30_zero.bin \
|
|
$t/k2/bl301.bin \
|
|
$t/k2/bl301_zero.bin \
|
|
$t/k2/bl30_new.bin bl30
|
|
|
|
$t/k2/fip_create --bl30 $t/k2/bl30_new.bin \
|
|
--bl31 $t/k2/bl31.img \
|
|
--bl33 bl33.bin \
|
|
$t/k2/fip.bin
|
|
|
|
$t/k2/fip_create --dump $t/k2/fip.bin
|
|
|
|
python $t/acs_tool.pyc $t/k2/bl2.bin \
|
|
$t/k2/bl2_acs.bin \
|
|
$t/k2/acs.bin 0
|
|
|
|
$t/blx_fix.sh $t/k2/bl2_acs.bin \
|
|
$t/k2/zero_tmp \
|
|
$t/k2/bl2_zero.bin \
|
|
$t/k2/bl21.bin \
|
|
$t/k2/bl21_zero.bin \
|
|
$t/k2/bl2_new.bin bl2
|
|
|
|
cat $t/k2/bl2_new.bin $t/k2/fip.bin > boot_new.bin
|
|
|
|
$t/k2/aml_encrypt_gxb --bootsig \
|
|
--input boot_new.bin \
|
|
--output u-boot.bin
|
|
|
|
fi
|
|
}
|
|
|
|
|
|
if [[ $BOARD == odroidc2 ]]; then
|
|
|
|
write_uboot_platform()
|
|
{
|
|
dd if=$1/bl1.bin.hardkernel of=$2 bs=1 count=442 conv=fsync > /dev/null 2>&1
|
|
dd if=$1/bl1.bin.hardkernel of=$2 bs=512 skip=1 seek=1 conv=fsync > /dev/null 2>&1
|
|
dd if=$1/u-boot.bin of=$2 bs=512 seek=97 conv=fsync > /dev/null 2>&1
|
|
}
|
|
|
|
else
|
|
|
|
write_uboot_platform()
|
|
{
|
|
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
|
|
}
|
|
|
|
fi
|
|
|
|
family_tweaks()
|
|
{
|
|
if [[ $BOARD == lafrite ]]; then
|
|
echo "fdtfile=amlogic/meson-gxl-s805x-libretech-ac.dtb" >> $SDCARD/boot/armbianEnv.txt
|
|
fi
|
|
}
|
|
|
|
family_tweaks_bsp()
|
|
{
|
|
mkdir -p $destination/etc/udev/rules.d
|
|
mkdir -p $destination/usr/local/bin
|
|
cp $SRC/packages/bsp/rockchip/hdmi.rules $destination/etc/udev/rules.d
|
|
install -m 755 $SRC/packages/bsp/rockchip/hdmi-hotplug $destination/usr/local/bin
|
|
|
|
mkdir -p "$destination"/etc/X11/xorg.conf.d
|
|
cat <<-EOF > "$destination"/etc/X11/xorg.conf.d/02-driver.conf
|
|
# set fbdev as default driver.
|
|
Section "Device"
|
|
Identifier "NOGPU"
|
|
Driver "fbdev"
|
|
EndSection
|
|
EOF
|
|
}
|