armbian-build/config/sources/rk3328.conf
2017-09-25 13:20:07 +03:00

97 lines
2.4 KiB
Plaintext

ARCH=arm64
KERNEL_IMAGE_TYPE=Image
OFFSET=16
BOOTSCRIPT='boot-rk3328.cmd:boot.cmd'
BOOTENV_FILE='rk3328-default.txt'
UBOOT_TARGET_MAP=";;idbloader.bin uboot.img trust.bin"
UBOOT_USE_GCC='> 7.0'
BOOTSOURCE='https://github.com/ayufan-rock64/linux-u-boot'
BOOTDIR='u-boot-rk3328'
BOOTPATCHDIR="u-boot-rk3328-${BRANCH}"
HAS_UUID_SUPPORT=yes
BOOTDELAY=0
OVERLAY_PREFIX='rk3328'
ATFSOURCE='https://github.com/rockchip-linux/arm-trusted-firmware'
ATFDIR='arm-trusted-firmware-rk3328'
ATFBRANCH='branch:master'
ATF_USE_GCC='> 6.3'
ATF_TARGET_MAP='PLAT=rk3328 DEBUG=1 bl31;;trust.bin'
case $BRANCH in
default)
BOOTBRANCH='branch:release'
KERNELSOURCE='https://github.com/ayufan-rock64/linux-kernel'
KERNELBRANCH='branch:release-4.4'
KERNELDIR='linux-rk3328'
KERNEL_USE_GCC='> 6.3'
SERIALCON=ttyFIQ0
;;
dev)
BOOTBRANCH='branch:mainline-master'
KERNELSOURCE='https://github.com/ayufan-rock64/linux-mainline-kernel'
KERNELBRANCH='branch:master'
KERNELDIR='linux-rk3328-mainline'
KERNEL_USE_GCC='> 7.0'
SERIALCON=ttyS2
;;
esac
write_uboot_platform()
{
dd if=$1/idbloader.bin of=$2 seek=64 conv=notrunc status=none >/dev/null 2>&1
dd if=$1/uboot.img of=$2 seek=16384 conv=notrunc status=none >/dev/null 2>&1
dd if=$1/trust.bin of=$2 seek=24576 conv=notrunc status=none >/dev/null 2>&1
}
setup_write_uboot_platform()
{
if grep -q "ubootpart" /proc/cmdline; then
local tmp=$(cat /proc/cmdline)
tmp="${tmp##*ubootpart=}"
tmp="${tmp%% *}"
[[ -n $tmp ]] && local part=$(findfs PARTUUID=$tmp 2>/dev/null)
[[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2>/dev/null)
[[ -n $dev ]] && DEVICE="/dev/$dev"
fi
}
uboot_custom_postprocess()
{
# bootloader image
local tempfile=$(mktemp)
dd if=$SRC/cache/sources/rkbin-tools/rk33/rk3328_ddr_786MHz_v1.06.bin of=$tempfile bs=4 skip=1
tools/mkimage -n rk3328 -T rksd -d $tempfile idbloader.bin
cat $SRC/cache/sources/rkbin-tools/rk33/rk3328_miniloader_v2.43.bin >> idbloader.bin
# u-boot
#
# Total hours wasted before finding that the new "load address" parameter is not optional: 3
# https://github.com/rockchip-linux/build/commit/fff8f5a2d91fd11f8c4f6d605cac704d28baab4d
#
loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x200000
}
atf_custom_postprocess()
{
# remove bl31.bin which can be 4+GiB in size and thus may fill the tmpfs mount
rm -f build/rk3328/debug/bl31.bin
# ATF
trust_merger trust.ini
}
family_tweaks()
{
# enable root login via the serial console
echo "ttyFIQ0" >> $SDCARD/etc/securetty
}