diff --git a/alarm/uboot-dragonboard/0001-arch-linux-arm-modifications.patch b/alarm/uboot-dragonboard/0001-arch-linux-arm-modifications.patch new file mode 100644 index 000000000..586dd63bd --- /dev/null +++ b/alarm/uboot-dragonboard/0001-arch-linux-arm-modifications.patch @@ -0,0 +1,25 @@ +From 8c190679b688cf186e132a9f26052ac26ab717c3 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Sat, 5 Mar 2016 12:27:57 -0700 +Subject: [PATCH] arch linux arm modifications + +--- + include/configs/dragonboard410c.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h +index 4b00922..15350c1 100644 +--- a/include/configs/dragonboard410c.h ++++ b/include/configs/dragonboard410c.h +@@ -12,7 +12,7 @@ + #include + #include + +-#define CONFIG_IDENT_STRING "\nQualcomm-DragonBoard 410C" ++#define CONFIG_IDENT_STRING " Arch Linux ARM" + + #define CONFIG_MISC_INIT_R /* To stop autoboot */ + +-- +2.9.0 + diff --git a/alarm/uboot-dragonboard/PKGBUILD b/alarm/uboot-dragonboard/PKGBUILD new file mode 100644 index 000000000..71ce5351c --- /dev/null +++ b/alarm/uboot-dragonboard/PKGBUILD @@ -0,0 +1,53 @@ +# U-Boot: Dragonboard 410c +# Maintainer: Kevin Mihelich + +buildarch=8 + +pkgname=uboot-dragonboard +pkgver=2016.09 +pkgrel=1 +pkgdesc="U-Boot for Dragonboard 410c" +arch=('aarch64') +url='http://www.denx.de/wiki/U-Boot/WebHome' +license=('GPL') +install=$pkgname.install +backup=('boot/boot.txt' 'boot/boot.scr') +makedepends=('bc' 'dtc' 'git' 'skales') +source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2" + '0001-arch-linux-arm-modifications.patch' + 'boot.txt' + 'mkscr') +md5sums=('2e69dda70eb28f8042d2f9fbeb1feaa1' + '17601b63768a2c98a04fe20fdcb820c6' + 'fd933e5a372406ab0a9606e2dd696ab9' + '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 CXXFLAGS CPPFLAGS + + make distclean + make dragonboard410c_config + make EXTRAVERSION=-${pkgrel} +} + +package() { + cd u-boot-${pkgver/rc/-rc} + + mkdir -p "${pkgdir}"/boot + + touch rd + dtbTool -o dt.img arch/arm/dts + mkbootimg --kernel=u-boot-dtb.bin --output=u-boot.img --dt=dt.img --pagesize 2048 --base 0x80000000 --ramdisk=rd --cmdline="" + cp u-boot.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 +} diff --git a/alarm/uboot-dragonboard/boot.txt b/alarm/uboot-dragonboard/boot.txt new file mode 100644 index 000000000..a65c4dd68 --- /dev/null +++ b/alarm/uboot-dragonboard/boot.txt @@ -0,0 +1,15 @@ +# After modifying, run ./mkscr + +test -n "${distro_bootpart}" || setenv distro_bootpart 1 +part uuid ${devtype} ${devnum}:${distro_bootpart} uuid +setenv bootargs "console=tty1 console=ttyMSM0,115200n8 root=PARTUUID=${uuid} rw rootwait" + +if load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} /boot/Image; then + if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/dtbs/qcom/${fdtfile}; then + if load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then + booti ${loadaddr} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}; + else + booti ${loadaddr} - ${fdt_addr_r}; + fi; + fi; +fi diff --git a/alarm/uboot-dragonboard/mkscr b/alarm/uboot-dragonboard/mkscr new file mode 100755 index 000000000..272b6a7a5 --- /dev/null +++ b/alarm/uboot-dragonboard/mkscr @@ -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 diff --git a/alarm/uboot-dragonboard/uboot-dragonboard.install b/alarm/uboot-dragonboard/uboot-dragonboard.install new file mode 100644 index 000000000..113c702b3 --- /dev/null +++ b/alarm/uboot-dragonboard/uboot-dragonboard.install @@ -0,0 +1,19 @@ +flash_uboot() { + echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0p8." + echo "Do you want to do this now? [y|N]" + read -r shouldwe + if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then + dd if=/boot/u-boot.img of=/dev/mmcblk0p8 + else + echo "You can do this later by running:" + echo "# dd if=/boot/u-boot.img of=/dev/mmcblk0p8" + fi +} + +post_install() { + flash_uboot +} + +post_upgrade() { + flash_uboot +}