summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-19 10:19:40 +0200
committerErich Eckner <git@eckner.net>2019-09-19 10:19:40 +0200
commitb24ce6d769146e9dceda85dfb537864fa72e0f53 (patch)
tree6516013686637e673b45beda5c3aaccd48d50b74
parent14ae93e0b1b8a16863ede35bdc4b1e84a8ca363f (diff)
downloadarchlinuxewe-b24ce6d769146e9dceda85dfb537864fa72e0f53.tar.xz
uboot-sunxi: first trial
-rw-r--r--uboot-sunxi/PKGBUILD278
-rw-r--r--uboot-sunxi/boot.txt16
-rwxr-xr-xuboot-sunxi/mkscr9
-rw-r--r--uboot-sunxi/uboot-sunxi.install22
4 files changed, 325 insertions, 0 deletions
diff --git a/uboot-sunxi/PKGBUILD b/uboot-sunxi/PKGBUILD
new file mode 100644
index 000000000..0b5a713fd
--- /dev/null
+++ b/uboot-sunxi/PKGBUILD
@@ -0,0 +1,278 @@
+# Maintainer: Christopher Reimer <mail+aur[at]c-reimer[dot]de>
+# Former Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
+
+pkgbase=uboot-sunxi
+pkgname=('uboot-a10-olinuxino-lime'
+ 'uboot-a10s-olinuxino-micro'
+ 'uboot-a13-olinuxino'
+ 'uboot-a13-olinuxino-micro'
+ 'uboot-a20-olinuxino-lime'
+ 'uboot-a20-olinuxino-lime2'
+ 'uboot-a20-olinuxino-micro'
+ 'uboot-bananapi'
+ 'uboot-cubieboard'
+ 'uboot-cubieboard2'
+ 'uboot-cubietruck'
+ 'uboot-pcduino'
+ 'uboot-pcduino3'
+ 'uboot-pcduino3-nano')
+pkgver=2019.07
+pkgrel=1
+arch=('any')
+url="http://git.denx.de/u-boot.git/"
+license=('GPL')
+makedepends=('arm-none-eabi-gcc' 'bc' 'dtc' 'python2')
+backup=(boot/boot.txt boot/boot.scr)
+source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
+ 'boot.txt'
+ 'mkscr')
+sha512sums=('879abf0c8773bfcdcbe7f28fc68e2b4369bcb74e276d95d510a9b2d1707e63eb01d82e304ba5a6a570552bc18bc593f27ba9b518bafa1d8f8e5bc83cf107c023'
+ 'f2978ea8acc39fccd0269eb74248e622d1e5daf0b30a2c48ac1d618deda3b4733e949d21bff5dbd2e5b6c39f0df60480c55e3ee1bf8e64df2c8157a51f2fbb49'
+ '7046ab4d88efbba636be049be2f660e18c05e48d161d39437c1580b12795ba4d9197ad57ac4572398f80a38d4777507b57228abf4cc41f0081d196ece27ea9d0')
+
+boards=('A10-OLinuXino-Lime'
+ 'A10s-OLinuXino-M'
+ 'A13-OLinuXino'
+ 'A13-OLinuXinoM'
+ 'A20-OLinuXino-Lime'
+ 'A20-OLinuXino-Lime2'
+ 'A20-OLinuXino_MICRO'
+ 'Bananapi'
+ 'Cubieboard'
+ 'Cubieboard2'
+ 'Cubietruck'
+ 'Linksprite_pcDuino'
+ 'Linksprite_pcDuino3'
+ 'Linksprite_pcDuino3_Nano')
+
+prepare() {
+ cd u-boot-${pkgver}
+
+ sed -i 's/env python$/&2/' tools/binman/binman{,.py}
+}
+
+build() {
+ cd u-boot-${pkgver}
+
+ unset CFLAGS CXXFLAGS LDFLAGS
+
+ for i in ${boards[@]}; do
+ mkdir ../bin_${i}
+ make distclean
+ make ${i}_config
+ make CROSS_COMPILE=arm-none-eabi- EXTRAVERSION=-${pkgrel}
+ mv u-boot-sunxi-with-spl.bin ../bin_${i}
+ done
+
+ tools/mkimage -A arm -O linux -T script -C none -d ../boot.txt ../boot.scr
+}
+
+package_uboot-a10-olinuxino-lime() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for A10 OLinuXino Lime"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_A10-OLinuXino-Lime/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-a10s-olinuxino-micro() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for A10s OLinuXino Micro"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_A10s-OLinuXino-M/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-a13-olinuxino() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for A13 OLinuXino"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_A13-OLinuXino/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-a13-olinuxino-micro() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for A13 OLinuXino Micro"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_A13-OLinuXinoM/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-a20-olinuxino-lime() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for A20 OLinuXino Lime"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_A20-OLinuXino-Lime/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-a20-olinuxino-lime2() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for A20 OLinuXino Lime2"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_A20-OLinuXino-Lime2/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-a20-olinuxino-micro() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for A20 OLinuXino Micro"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_A20-OLinuXino_MICRO/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-bananapi() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for BananaPi"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_Bananapi/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot/u-boot-sunxi-with-spl.bin
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-cubieboard() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for Cubieboard"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_Cubieboard/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot/u-boot-sunxi-with-spl.bin
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-cubieboard2() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for Cubieboard 2"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_Cubieboard2/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot/u-boot-sunxi-with-spl.bin
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-cubietruck() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for Cubietruck"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_Cubietruck/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot/u-boot-sunxi-with-spl.bin
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-pcduino() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for pcDuino"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_Linksprite_pcDuino/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-pcduino3() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for pcDuino3"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_Linksprite_pcDuino3/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
+
+package_uboot-pcduino3-nano() {
+ arch=('armv7h')
+ pkgdesc="U-Boot for pcDuino3 Nano"
+ install=${pkgbase}.install
+ provides=('uboot-sunxi')
+ conflicts=('uboot-sunxi')
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 bin_Linksprite_pcDuino3_Nano/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot
+
+ install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt
+ install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr
+ install -Dm755 mkscr "${pkgdir}"/boot/mkscr
+}
diff --git a/uboot-sunxi/boot.txt b/uboot-sunxi/boot.txt
new file mode 100644
index 000000000..a1c7a59b1
--- /dev/null
+++ b/uboot-sunxi/boot.txt
@@ -0,0 +1,16 @@
+# After modifying, run ./mkscr
+
+if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
+part uuid ${devtype} ${devnum}:${bootpart} uuid
+
+setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait
+
+if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; 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
+ bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
+ else
+ bootz ${kernel_addr_r} - ${fdt_addr_r};
+ fi;
+ fi;
+fi
diff --git a/uboot-sunxi/mkscr b/uboot-sunxi/mkscr
new file mode 100755
index 000000000..272b6a7a5
--- /dev/null
+++ b/uboot-sunxi/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/uboot-sunxi/uboot-sunxi.install b/uboot-sunxi/uboot-sunxi.install
new file mode 100644
index 000000000..cd4afef4b
--- /dev/null
+++ b/uboot-sunxi/uboot-sunxi.install
@@ -0,0 +1,22 @@
+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/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
+ else
+ echo "You can do this later by running:"
+ echo "# dd if=/boot/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8"
+ 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
+}