Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
139 lines (122 sloc) 4.73 KB
ARCH=arm64
KERNEL_IMAGE_TYPE=Image
OFFSET=16
BOOTSCRIPT='boot-rockchip64.cmd:boot.cmd'
BOOTENV_FILE='rockchip-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-rockchip64'
BOOTPATCHDIR="u-boot-rockchip64-${BRANCH}"
BOOTBRANCH='branch:rockchip-master'
BOOTDELAY=0
HAS_UUID_SUPPORT=yes
OVERLAY_PREFIX='rockchip'
SERIALCON='ttyFIQ0:1500000'
ATFSOURCE='https://github.com/ayufan-rock64/arm-trusted-firmware'
ATFDIR='arm-trusted-firmware-rockchip64'
ATFBRANCH='branch:rockchip'
ATF_USE_GCC='> 6.3'
GOVERNOR="ondemand"
KERNEL_USE_GCC='> 7.0'
if [[ $BOARD == rockpro64 ]] || [[ $BOARD == rockpi-4* ]]; then
ATF_TARGET_MAP='M0_CROSS_COMPILE=arm-linux-gnueabi- PLAT=rk3399 DEBUG=1 bl31;;trust.bin'
ATF_TOOLCHAIN2="arm-linux-gnueabi-:> 5.0"
UBOOT_TARGET_MAP="BL31=$SRC/cache/sources/rkbin-tools/rk33/rk3399_bl31_v1.17.elf u-boot-dtb.bin spl/u-boot-spl.bin u-boot.itb;;spl/u-boot-spl.bin u-boot.itb"
CPUMIN="600000"
CPUMAX="1900000"
else
ATF_TARGET_MAP='PLAT=rk322xh DEBUG=1 bl31;;trust.bin'
CPUMIN="600000"
CPUMAX="1390000"
fi
case $BRANCH in
default)
KERNELSOURCE='https://github.com/ayufan-rock64/linux-kernel'
KERNELBRANCH='tag:4.4.190-1233-rockchip-ayufan'
KERNELDIR='linux-rockchip64'
;;
dev)
KERNELSOURCE='https://github.com/ayufan-rock64/linux-mainline-kernel'
KERNELBRANCH='tag:5.3.0-rc4-1118-ayufan'
KERNELDIR='linux-rockchip64'
;;
esac
write_uboot_platform()
{
if [[ -f $1/rksd_loader.img ]] ; then
dd if=$1/rksd_loader.img of=$2 seek=64 conv=notrunc status=none >/dev/null 2>&1
else
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
fi
}
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
if [[ $BOARD == rockpro64 ]] || [[ $BOARD == rockpi-4* ]]; then
# 3399
tools/mkimage -n rk3399 -T rksd -d $SRC/cache/sources/rkbin-tools/rk33/rk3399_ddr_933MHz_v1.13.bin rksd_loader.img
cat spl/u-boot-spl.bin >> rksd_loader.img
dd if=u-boot.itb of=rksd_loader.img seek=448 conv=notrunc
cp rksd_loader.img $SRC/.tmp/$uboot_name/usr/lib/$uboot_name/$f_dst
tools/mkimage -n rk3399 -T rksd -d $SRC/cache/sources/rkbin-tools/rk33/rk3399_ddr_933MHz_v1.13.bin rkspi_loader.img
cat spl/u-boot-spl.bin >> rkspi_loader.img
for i in `seq 1 128`; do dd count=4 status=none; dd if=/dev/zero count=4 status=none; done < rkspi_loader.img > rkspi_loader.tmp
mv rkspi_loader.tmp rkspi_loader.img
dd if=u-boot.itb of=rkspi_loader.img seek=1024 conv=notrunc
cp rkspi_loader.img $SRC/.tmp/$uboot_name/usr/lib/$uboot_name/$f_dst
else
# 3328
tools/mkimage -n rk3328 -T rksd -d $SRC/cache/sources/rkbin-tools/rk33/rk3328_ddr_786MHz_v1.13.bin idbloader.bin
cat $SRC/cache/sources/rkbin-tools/rk33/rk3328_miniloader_v2.46.bin >> idbloader.bin
loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x200000
fi
}
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()
{
# install and enable Bluetooth
chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools"
if [[ $BOARD == z28pro ]]; then
echo "fdtfile=rockchip/rk3328-z28pro.dtb" >> $SDCARD/boot/armbianEnv.txt
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable z28pro-bluetooth.service >/dev/null 2>&1"
fi
if [[ $BOARD == rockpi-4b ]]; then
chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools"
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable rk3399-bluetooth.service >/dev/null 2>&1"
fi
}
family_tweaks_bsp()
{
if [[ $BOARD == z28pro ]]; then
mkdir -p $destination/usr/local/bin
# Bluetooth
install -m 755 $SRC/packages/bsp/rk3328/z28pro/8822b_hciattach $destination/usr/bin
install -m 755 $SRC/packages/bsp/rk3328/z28pro/start_bt.sh $destination/usr/local/bin
cp $SRC/packages/bsp/rk3328/z28pro/z28pro-bluetooth.service $destination/lib/systemd/system/
fi
if [[ $BOARD == rockpi-4b ]]; then
# Bluetooth
install -m 755 $SRC/packages/bsp/rk3399/brcm_patchram_plus_rk3399 $destination/usr/bin
cp $SRC/packages/bsp/rk3399/rk3399-bluetooth.service $destination/lib/systemd/system/
fi
}
You can’t perform that action at this time.