summaryrefslogtreecommitdiff
path: root/libre/uboot-am335x_bone
diff options
context:
space:
mode:
Diffstat (limited to 'libre/uboot-am335x_bone')
-rw-r--r--libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch43
-rw-r--r--libre/uboot-am335x_bone/PKGBUILD53
-rw-r--r--libre/uboot-am335x_bone/extlinux.conf46
-rw-r--r--libre/uboot-am335x_bone/uEnv.txt1
-rw-r--r--libre/uboot-am335x_bone/uboot-am335x_bone.install38
5 files changed, 181 insertions, 0 deletions
diff --git a/libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch b/libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch
new file mode 100644
index 000000000..2574a7929
--- /dev/null
+++ b/libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch
@@ -0,0 +1,43 @@
+diff -Nur u-boot-2015.04.orig/include/configs/am335x_evm.h u-boot-2015.04/include/configs/am335x_evm.h
+--- u-boot-2015.04.orig/include/configs/am335x_evm.h 2015-04-13 11:53:03.000000000 -0300
++++ u-boot-2015.04/include/configs/am335x_evm.h 2016-02-22 21:45:18.256462447 -0300
+@@ -67,11 +67,18 @@
+
+ #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
++/* Enable extlinux boot support */
++#define CONFIG_CMD_PXE
++#define CONFIG_MENU
++#define BOOT_TARGET_DEVICES(func)
++#include <config_distro_bootcmd.h>
++
+ #ifndef CONFIG_SPL_BUILD
+ #define CONFIG_EXTRA_ENV_SETTINGS \
++ BOOTENV \
+ DEFAULT_LINUX_BOOT_ENV \
+ "boot_fdt=try\0" \
+- "bootpart=0:2\0" \
++ "bootpart=0:1\0" \
+ "bootdir=/boot\0" \
+ "bootfile=zImage\0" \
+ "fdtfile=undefined\0" \
+@@ -80,8 +87,10 @@
+ "uuid_disk=${uuid_gpt_disk};" \
+ "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
+ "optargs=\0" \
++ "devtype=mmc\0" \
++ "devnum=0\0" \
+ "mmcdev=0\0" \
+- "mmcroot=/dev/mmcblk0p2 ro\0" \
++ "mmcroot=/dev/mmcblk0p1 ro\0" \
+ "mmcrootfstype=ext4 rootwait\0" \
+ "rootpath=/export/rootfs\0" \
+ "nfsopts=nolock\0" \
+@@ -149,6 +158,7 @@
+ "echo Running uenvcmd ...;" \
+ "run uenvcmd;" \
+ "fi;" \
++ "usb start; run scan_dev_for_boot;" \
+ "if run loadimage; then " \
+ "run mmcloados;" \
+ "fi;" \
diff --git a/libre/uboot-am335x_bone/PKGBUILD b/libre/uboot-am335x_bone/PKGBUILD
new file mode 100644
index 000000000..a62861a9f
--- /dev/null
+++ b/libre/uboot-am335x_bone/PKGBUILD
@@ -0,0 +1,53 @@
+# U-Boot: BeagleBone and BeagleBone Black
+# Maintainer: André Silva <emulatorman@parabola.nu>
+# Contributor: Jookia <166291@gmail.com>
+# Contributor: Márcio Silva <coadde@parabola.nu>
+
+buildarch=4
+
+pkgname=uboot-am335x_bone
+pkgver=2015.04
+pkgrel=2
+pkgdesc="U-Boot for BeagleBone and BeagleBone Black"
+arch=('armv7h')
+url="http://git.denx.de/u-boot.git/"
+replaces=('uboot-beaglebone-linux-libre' 'uboot-beaglebone-linux-libre-lts'
+ 'uboot-beaglebone-linux-libre-grsec' 'uboot-beaglebone-linux-libre-pck'
+ 'uboot-beaglebone')
+conflicts=('uboot-beaglebone-linux-libre' 'uboot-beaglebone-linux-libre-lts'
+ 'uboot-beaglebone-linux-libre-grsec' 'uboot-beaglebone-linux-libre-pck'
+ 'uboot-beaglebone' 'uboot4grub-am335x_bone')
+makedepends=('bc')
+license=('GPL')
+backup=(boot/extlinux/extlinux.conf)
+install=${pkgname}.install
+source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
+ '0001-parabola-arm-modifications.patch'
+ 'extlinux.conf'
+ 'uEnv.txt')
+md5sums=('570bdc2c47270c2a98ca60ff6c5c74cd'
+ '7aaf785aa34682a174424f50988728e5'
+ 'cde2078db6208585d36d2f6a3c830860'
+ 'ccb79775b81654e16fca18825c7f2506')
+
+prepare() {
+ cd u-boot-${pkgver}
+ patch -Np1 -i ../0001-parabola-arm-modifications.patch
+}
+
+build() {
+ cd u-boot-${pkgver}
+
+ unset CFLAGS CXXFLAGS LDFLAGS
+
+ make distclean
+ make am335x_evm_config
+ make
+}
+
+package() {
+ cd u-boot-${pkgver}
+ mkdir -p "${pkgdir}"/boot/extlinux
+ cp MLO u-boot.img "${srcdir}"/uEnv.txt "${pkgdir}"/boot
+ cp "${srcdir}"/extlinux.conf "${pkgdir}"/boot/extlinux
+}
diff --git a/libre/uboot-am335x_bone/extlinux.conf b/libre/uboot-am335x_bone/extlinux.conf
new file mode 100644
index 000000000..4d65ed61f
--- /dev/null
+++ b/libre/uboot-am335x_bone/extlinux.conf
@@ -0,0 +1,46 @@
+menu title Welcome to Parabola!
+
+label Parabola GNU/Linux-libre w/ linux-libre kernel
+ kernel /boot/vmlinuz-linux-libre
+ append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+ fdtdir /boot/dtbs/linux-libre
+
+#label Parabola GNU/Linux-libre w/ linux-libre-lts kernel
+# kernel /boot/vmlinuz-linux-libre-lts
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-lts
+
+#label Parabola GNU/Linux-libre w/ linux-libre-knock kernel
+# kernel /boot/vmlinuz-linux-libre-knock
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-knock
+
+#label Parabola GNU/Linux-libre w/ linux-libre-lts-knock kernel
+# kernel /boot/vmlinuz-linux-libre-lts-knock
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-lts-knock
+
+#label Parabola GNU/Linux-libre w/ linux-libre-grsec kernel
+# kernel /boot/vmlinuz-linux-libre-grsec
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-grsec
+
+#label Parabola GNU/Linux-libre w/ linux-libre-grsec-knock kernel
+# kernel /boot/vmlinuz-linux-libre-grsec-knock
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-grsec-knock
+
+#label Parabola GNU/Linux-libre w/ linux-libre-audit kernel
+# kernel /boot/vmlinuz-linux-libre-audit
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-audit
+
+#label Parabola GNU/Linux-libre w/ linux-libre-pck kernel
+# kernel /boot/vmlinuz-linux-libre-pck
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-pck
+
+#label Parabola GNU/Linux-libre w/ linux-libre-rt kernel
+# kernel /boot/vmlinuz-linux-libre-rt
+# append root=/dev/mmcblk0p1 rw console=ttyO0,115200n8
+# fdtdir /boot/dtbs/linux-libre-rt
diff --git a/libre/uboot-am335x_bone/uEnv.txt b/libre/uboot-am335x_bone/uEnv.txt
new file mode 100644
index 000000000..f432efc6b
--- /dev/null
+++ b/libre/uboot-am335x_bone/uEnv.txt
@@ -0,0 +1 @@
+optargs=coherent_pool=1M
diff --git a/libre/uboot-am335x_bone/uboot-am335x_bone.install b/libre/uboot-am335x_bone/uboot-am335x_bone.install
new file mode 100644
index 000000000..0a71c804a
--- /dev/null
+++ b/libre/uboot-am335x_bone/uboot-am335x_bone.install
@@ -0,0 +1,38 @@
+flash_instructions() {
+ echo "# dd if=/boot/MLO of=/dev/mmcblk0 count=1 seek=1 conv=notrunc bs=128k"
+ echo "# dd if=/boot/u-boot.img of=/dev/mmcblk0 count=2 seek=1 conv=notrunc bs=384k"
+}
+
+extlinux_warning() {
+ echo ">>> WARNING: for new entries, edit /boot/extlinux/extlinux.conf"
+}
+
+flash_uboot() {
+ root=$(mount | awk '/ on \/ / { print $1; }')
+ if [[ $root =~ ^/dev/mmcblk.*$ ]]; then
+ root=${root:0:12}
+ echo "A new U-Boot version needs to be flashed onto $root."
+ echo "Do this now? [y|N]"
+ read -r shouldwe
+ if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
+ dd if=/boot/MLO of=$root count=1 seek=1 conv=notrunc bs=128k
+ dd if=/boot/u-boot.img of=$root count=2 seek=1 conv=notrunc bs=384k
+ else
+ echo "You can do this later by running:"
+ flash_instructions
+ fi
+ else
+ echo "Flash the new U-Boot version onto your boot device. For example:"
+ flash_instructions
+ fi
+}
+
+post_install() {
+ flash_uboot
+ extlinux_warning
+}
+
+post_upgrade() {
+ flash_uboot
+ extlinux_warning
+}