armbian-build/config/sources/rk3399.conf

99 lines
2.5 KiB
Plaintext

ARCH=arm64
KERNEL_IMAGE_TYPE=Image
OFFSET=16
BOOTSCRIPT='boot-rk3328.cmd:boot.cmd'
BOOTENV_FILE='rk3399-default.txt'
UBOOT_TARGET_MAP=";;idbloader.bin uboot.img trust.bin"
UBOOT_USE_GCC='> 7.0'
BOOTSOURCE='https://github.com/hardkernel/u-boot'
BOOTBRANCH='branch:odroidn1-v2017.07'
BOOTDIR='u-boot-rk3399'
BOOTPATCHDIR="u-boot-rk3399-${BRANCH}"
HAS_UUID_SUPPORT=yes
BOOTDELAY=0
OVERLAY_PREFIX='rk3328'
ATFSOURCE='https://github.com/ayufan-rock64/arm-trusted-firmware'
ATFDIR='arm-trusted-firmware-rk3328'
ATFBRANCH='branch:rockchip'
ATF_USE_GCC='> 6.3'
ATF_TARGET_MAP='PLAT=rk3399 DEBUG=1 bl31;;trust.bin'
case $BRANCH in
default)
KERNELSOURCE='https://github.com/hardkernel/linux'
KERNELBRANCH='branch:odroidn1-4.4.y'
KERNELDIR='linux-rk3399'
KERNEL_USE_GCC='> 6.3'
SERIALCON=ttyFIQ0
;;
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)
#
#Below is what works with BOOTBRANCH='branch:release'
#
#dd if=$SRC/cache/sources/rkbin-tools/rk33/rk3399_ddr_800MHz_v1.08.bin of=$tempfile bs=4 skip=1
#tools/mkimage -n rk3399 -T rksd -d $tempfile idbloader.bin
# Below is the way it is supposed to work according to Rockchip documentation,
# and how it does work with the mainline-master branch. No 4-byte skip.
#
tools/mkimage -n rk3399 -T rksd -d $SRC/cache/sources/rkbin-tools/rk33/rk3399_ddr_800MHz_v1.08.bin idbloader.bin
cat $SRC/cache/sources/rkbin-tools/rk33/rk3399_miniloader_v1.06.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
}
atf_custom_postprocess()
{
# remove bl31.bin which can be 4+GiB in size and thus may fill the tmpfs mount
rm -f build/rk322xh/debug/bl31.bin
# ATF
trust_merger trust.ini
}
family_tweaks()
{
# enable root login via the serial console
echo "ttyFIQ0" >> $SDCARD/etc/securetty
}