added alarm/uboot-pine64

This commit is contained in:
Kevin Mihelich 2016-04-22 01:55:03 +00:00
parent d1d095882f
commit de3c6d6024
5 changed files with 143 additions and 0 deletions

View file

@ -0,0 +1,33 @@
From cf3d184596e03706f5320a378c2517ad3fe33a34 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Tue, 12 Apr 2016 21:08:56 -0600
Subject: [PATCH] arch linux arm modifications
---
include/configs/sunxi-common.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 8f11eb9..2a22831 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -174,7 +174,7 @@
#define CONFIG_SYS_NO_FLASH
#define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */
-#define CONFIG_IDENT_STRING " Allwinner Technology"
+#define CONFIG_IDENT_STRING " Arch Linux ARM"
#define CONFIG_DISPLAY_BOARDINFO
#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */
@@ -518,7 +518,6 @@ extern int soft_i2c_gpio_scl;
CONSOLE_ENV_SETTINGS \
MEM_LAYOUT_ENV_SETTINGS \
DFU_ALT_INFO_RAM \
- "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
"console=ttyS0,115200\0" \
BOOTCMD_SUNXI_COMPAT \
BOOTENV
--
2.7.2

View file

@ -0,0 +1,64 @@
# U-Boot: Pine64
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
buildarch=8
pkgname=uboot-pine64
pkgver=2016.05rc1
pkgrel=1
pkgdesc="U-Boot for Pine64"
arch=('armv7h')
url='http://www.denx.de/wiki/U-Boot/WebHome'
license=('GPL')
backup=('boot/boot.txt' 'boot/boot.scr')
makedepends=('bc' 'dtc' 'git')
install=${pkgname}.install
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2"
'0001-arch-linux-arm-modifications.patch'
'https://archlinuxarm.org/builder/src/pine/bl31.bin'
'https://archlinuxarm.org/builder/src/pine/boot0.bin'
'https://archlinuxarm.org/builder/src/pine/pine64_image.c'
'https://archlinuxarm.org/builder/src/pine/scp.bin'
'boot.txt'
'mkscr')
md5sums=('aa190afb64ae4f59d1a02d351e4ceedd'
'77cad572cf8d40a7c9c0c6a1dccd1ccf'
'7af966e1c846879b511d73210cc8147f'
'cbad13361ebef9b9e0897e1d42c69ba7'
'4c2b592d3bece0cbf118c9eee3cd1b8a'
'9130de1a9cac42cc0ab8697dcb7b3ae5'
'6400a8b8a70816865429404f24aafdef'
'021623a04afd29ac3f368977140cfbfd')
prepare() {
cd u-boot-${pkgver/rc/-rc}
git apply ../0001-arch-linux-arm-modifications.patch
}
build() {
cd u-boot-${pkgver/rc/-rc}
unset CFLAGS
unset CXXFLAGS
unset CPPFLAGS
make distclean
make pine64_plus_defconfig
make EXTRAVERSION=-${pkgrel}
gcc ../pine64_image.c -o pine64_image
}
package() {
cd u-boot-${pkgver/rc/-rc}
mkdir -p "${pkgdir}"/boot
cat ../bl31.bin u-boot.bin > bl31uboot.bin
./pine64_image ../scp.bin bl31uboot.bin u-boot.img
cp ../boot0.bin u-boot.img ../boot.txt "${pkgdir}"/boot
sed -i 's|@@FDTFILE@@|allwinner/sun50i-a64-pine64-plus.dtb|' "${pkgdir}"/boot/boot.txt
tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d "${pkgdir}"/boot/boot.txt "${pkgdir}"/boot/boot.scr
}

View file

@ -0,0 +1,13 @@
part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait
setenv fdtfile @@FDTFILE@@
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
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-pine64/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,24 @@
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/boot0.bin of=/dev/mmcblk0 seek=16
dd if=/boot/u-boot.img of=/dev/mmcblk0 seek=80
else
echo "You can do this later by running:"
echo "# dd if=/boot/boot0.bin of=/dev/mmcblk0 seek=16"
echo "# dd if=/boot/u-boot.img of=/dev/mmcblk0 seek=80"
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
}