changes for SPL TPL u-boot

This commit is contained in:
Kabbone 2020-04-10 10:01:36 +02:00
parent 2b0c9e3fcc
commit dad7ec2e57
No known key found for this signature in database
GPG Key ID: 7487872DCAE44521
2 changed files with 21 additions and 22 deletions

View File

@ -1,11 +1,9 @@
# U-Boot: Rock64
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
buildarch=8
pkgname=uboot-rock64
pkgver=2020.01
pkgrel=3
pkgrel=2
pkgdesc="U-Boot for Rock64"
arch=('aarch64')
url='http://www.denx.de/wiki/U-Boot/WebHome'
@ -16,25 +14,31 @@ install=${pkgname}.install
_commit_rkbin=15a3e065a49ba7981945d725207618e92ebe8ebb
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2"
"git+https://github.com/rockchip-linux/rkbin.git#commit=$_commit_rkbin"
'rk3328trust.ini'
'boot.txt'
'mkscr'
'sdram_rk3328.c'
'btrfs_extentio.patch')
md5sums=('b6b2e0787b6874e6b57da0a065a84f5a'
'SKIP'
'48946b910716b90d81f47caafb752fef'
'5f1089c471f39b303bccbb9e1fc196f7'
'021623a04afd29ac3f368977140cfbfd'
'46561b6f761dc0ead0d32145bd2c97ed'
'51ff4b7c8cf8833df2f208fac7fafde5')
prepare() {
cp sdram_rk3328.c ${srcdir}/u-boot-${pkgver/rc/-rc}/drivers/ram/rockchip/sdram_rk3328.c
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
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_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"
# cd ${srcdir}/u-boot-${pkgver/rc/-rc}/fs/btrfs
# patch --forward --strip=3 --input="${srcdir}/btrfs_extentio.patch"
}
build() {
@ -42,9 +46,10 @@ build() {
unset CLFAGS CXXFLAGS CPPFLAGS LDFLAGS
make distclean
# make distclean
make rock64-rk3328_defconfig
make -j4 EXTRAVERSION=-${pkgrel}
make -j4 EXTRAVERSION=-${pkgrel} u-boot.itb
}
package() {
@ -52,14 +57,10 @@ package() {
mkdir -p "${pkgdir}/boot"
tools/mkimage -n rk3328 -T rksd -d ../rkbin/bin/rk33/rk3328_ddr_333MHz_v1.16.bin "${pkgdir}/boot/idbloader.img"
cat ../rkbin/bin/rk33/rk322xh_miniloader_v2.50.bin >> "${pkgdir}/boot/idbloader.img"
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"
loaderimage --pack --uboot u-boot-dtb.bin "${pkgdir}/boot/uboot.img" 0x200000
trust_merger ../rk3328trust.ini
cp u-boot-dtb.bin trust.img "${pkgdir}/boot"
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

View File

@ -3,14 +3,12 @@ flash_uboot() {
echo "Do you want to do this now? [y|N]"
read -r shouldwe
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
dd if=/boot/idbloader.img of=/dev/mmcblk0 seek=64 conv=notrunc
dd if=/boot/uboot.img of=/dev/mmcblk0 seek=16384 conv=notrunc
dd if=/boot/trust.img of=/dev/mmcblk0 seek=24576 conv=notrunc
dd if=/boot/rksd_loader.img of=/dev/mmcblk0 seek=64 conv=notrunc
dd if=/boot/u-boot.itb of=/dev/mmcblk0 seek=16384 conv=notrunc
else
echo "You can do this later by running:"
echo "# dd if=/boot/idbloader.img of=/dev/mmcblk0 seek=64 conv=notrunc"
echo "# dd if=/boot/uboot.img of=/dev/mmcblk0 seek=16384 conv=notrunc"
echo "# dd if=/boot/trust.img of=/dev/mmcblk0 seek=24576 conv=notrunc"
echo "# dd if=/boot/rksd_loader.img of=/dev/mmcblk0 seek=64 conv=notrunc"
echo "# dd if=/boot/u-boot.itb of=/dev/mmcblk0 seek=16384 conv=notrunc"
fi
}