added alarm/uboot-rock64

This commit is contained in:
Kevin Mihelich 2018-04-03 00:29:30 +00:00
parent 393d3e8578
commit a7f6de0d71
5 changed files with 125 additions and 0 deletions

View file

@ -0,0 +1,54 @@
# U-Boot: Rock64
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
buildarch=8
pkgname=uboot-rock64
pkgver=2018.03
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' 'rockchip-tools')
install=${pkgname}.install
_commit_rkbin=f64ded672836b47db3f6a0d04d8ccb4180fb3d55
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')
md5sums=('02922bdf0ee003fe25bfc32749ffdeab'
'SKIP'
'15d010d12cb4bbaa5488505cc5c14147'
'c926f318d8fa7a5c89108331cbd3f8e2'
'021623a04afd29ac3f368977140cfbfd')
build() {
cd u-boot-${pkgver/rc/-rc}
unset CLFAGS CXXFLAGS CPPFLAGS LDFLAGS
make evb-rk3328_defconfig
echo 'CONFIG_IDENT_STRING=" Arch Linux ARM"' >> .config
make EXTRAVERSION=-${pkgrel}
}
package() {
cd u-boot-${pkgver/rc/-rc}
mkdir -p "${pkgdir}/boot"
tools/mkimage -n rk3328 -T rksd -d ../rkbin/rk33/rk3328_ddr_786MHz_v1.06.bin "${pkgdir}/boot/idbloader.img"
cat ../rkbin/rk33/rk3328_miniloader_v2.43.bin >> "${pkgdir}/boot/idbloader.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"
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

@ -0,0 +1,21 @@
# After modifying, run ./mkscr
# MAC address (use spaces instead of colons)
setenv macaddr da 19 c8 7a 6d f4
part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs console=ttyS2,1500000 root=PARTUUID=${uuid} rw rootwait earlycon=uart8250,mmio32,0xff130000
setenv fdtfile rockchip/rk3328-rock64.dtb
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
fdt addr ${fdt_addr_r}
fdt resize
fdt set /ethernet@ff540000 local-mac-address "[${macaddr}]"
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
booti ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi

9
alarm/uboot-rock64/mkscr Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
if [[ ! -x /usr/bin/mkimage ]]; then
echo "mkimage not found. Please install uboot-tools:"
echo " pacman -S uboot-tools"
exit 1
fi
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr

View file

@ -0,0 +1,15 @@
[VERSION]
MAJOR=1
MINOR=2
[BL30_OPTION]
SEC=0
[BL31_OPTION]
SEC=1
PATH=../rkbin/rk33/rk3328_bl31_v1.34.bin
ADDR=0x10000
[BL32_OPTION]
SEC=0
[BL33_OPTION]
SEC=0
[OUTPUT]
PATH=trust.img

View file

@ -0,0 +1,26 @@
flash_uboot() {
echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0."
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
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"
fi
}
## arg 1: the new package version
post_install() {
flash_uboot
}
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
flash_uboot
}