#U-Boot: Rock64 # Maintainer: Kevin Mihelich pkgname=uboot-rock64 pkgver=2020.04 pkgrel=1 pkgdesc="U-Boot for Rock64" arch=('aarch64') url='http://www.denx.de/wiki/U-Boot/WebHome' license=('GPL') backup=('boot/boot.txt' 'boot/boot.scr') makedepends=('bc' 'git' 'python' 'swig' 'dtc') install=${pkgname}.install _commit_rkbin=15a3e065a49ba7981945d725207618e92ebe8ebb source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}-rc5.tar.bz2" "git+https://github.com/rockchip-linux/rkbin.git#commit=$_commit_rkbin" 'boot.txt' 'mkscr') md5sums=('86f167cfe3a840ac47ddba868d6f1576' 'SKIP' '5f1089c471f39b303bccbb9e1fc196f7' '021623a04afd29ac3f368977140cfbfd') prepare() { mv ${srcdir}/u-boot-${pkgver}{-rc5,} cd ${srcdir}/u-boot-${pkgver/rc/-rc} cp ../rkbin/bin/rk33/rk322xh_bl31_v1.43.elf ./bl31.elf cp ../rkbin/bin/rk33/rk322xh_bl32_v1.54.bin ./bl32.bin sed -i 's/lpddr3-1600/lpddr3-666/g' arch/arm/dts/rk3328-rock64-u-boot.dtsi cd ${srcdir}/u-boot-${pkgver/rc/-rc}/configs echo 'CONFIG_CMD_BTRFS=y' >> rock64-rk3328_defconfig echo 'CONFIG_FS_BTRFS=y' >> rock64-rk3328_defconfig # echo 'CONFIG_NETCONSOLE=y' >> rock64-rk3328_defconfig echo 'CONFIG_IDENT_STRING=" Arch Linux ARM"' >> rock64-rk3328_defconfig # cd ${srcdir}/u-boot-${pkgver/rc/-rc}/fs/btrfs # patch --forward --strip=3 --input="${srcdir}/btrfs_extentio.patch" } build() { cd ${srcdir}/u-boot-${pkgver/rc/-rc} unset CLFAGS CXXFLAGS CPPFLAGS LDFLAGS # make distclean make rock64-rk3328_defconfig make -j4 EXTRAVERSION=-${pkgrel} make -j4 EXTRAVERSION=-${pkgrel} u-boot.itb } package() { cd u-boot-${pkgver/rc/-rc} mkdir -p "${pkgdir}/boot" tools/mkimage -n rk3328 -T rksd -d ./tpl/u-boot-tpl.bin "${pkgdir}/boot/rksd_loader.img" cat ./spl/u-boot-spl.bin >> "${pkgdir}/boot/rksd_loader.img" cp ./u-boot.itb "${pkgdir}/boot/u-boot.itb" tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ../boot.txt "${pkgdir}/boot/boot.scr" cp ../{boot.txt,mkscr} "${pkgdir}"/boot }