186 lines
4.3 KiB
Plaintext
186 lines
4.3 KiB
Plaintext
BOOTSOURCE=$MAINLINE_UBOOT_SOURCE
|
|
BOOTDIR=$MAINLINE_UBOOT_DIR
|
|
BOOTBRANCH='tag:v2019.04'
|
|
|
|
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
|
|
|
|
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.0.y'
|
|
KERNELDIR=$MAINLINE_KERNEL_DIR
|
|
SERIALCON='ttyAML0'
|
|
KERNEL_USE_GCC='> 7.0'
|
|
|
|
;;
|
|
esac
|
|
|
|
CPUMIN=500000
|
|
CPUMAX=1536000
|
|
GOVERNOR=conservative
|
|
|
|
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
|
|
local t=$SRC/cache/sources/odroidc2-blobs/
|
|
mv u-boot.bin bl33.bin
|
|
|
|
$t/blx_fix.sh $t/gxl/bl30.bin \
|
|
$t/gxl/zero_tmp \
|
|
$t/gxl/bl30_zero.bin \
|
|
$t/gxl/bl301.bin \
|
|
$t/gxl/bl301_zero.bin \
|
|
$t/gxl/bl30_new.bin bl30
|
|
|
|
python $t/acs_tool.pyc $t/gxl/bl2.bin \
|
|
$t/gxl/bl2_acs.bin \
|
|
$t/gxl/acs.bin 0
|
|
|
|
$t/blx_fix.sh $t/gxl/bl2_acs.bin \
|
|
$t/gxl/zero_tmp \
|
|
$t/gxl/bl2_zero.bin \
|
|
$t/gxl/bl21.bin \
|
|
$t/gxl/bl21_zero.bin \
|
|
$t/gxl/bl2_new.bin bl2
|
|
|
|
$t/gxl/aml_encrypt_gxl --bl3enc --input $t/gxl/bl30_new.bin
|
|
$t/gxl/aml_encrypt_gxl --bl3enc --input $t/gxl/bl31.img
|
|
$t/gxl/aml_encrypt_gxl --bl3enc --input bl33.bin
|
|
|
|
$t/gxl/aml_encrypt_gxl --bl2sig --input $t/gxl/bl2_new.bin \
|
|
--output bl2.n.bin.sig
|
|
|
|
$t/gxl/aml_encrypt_gxl --bootmk \
|
|
--output u-boot.bin \
|
|
--bl2 bl2.n.bin.sig \
|
|
--bl30 $t/gxl/bl30_new.bin.enc \
|
|
--bl31 $t/gxl/bl31.img.enc \
|
|
--bl33 bl33.bin.enc
|
|
|
|
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()
|
|
{
|
|
echo "#Allow ttyAML0 root" >> $SDCARD/etc/securetty
|
|
echo "ttyAML0" >> $SDCARD/etc/securetty
|
|
}
|
|
|
|
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
|
|
}
|