summaryrefslogtreecommitdiff
path: root/libre
diff options
context:
space:
mode:
Diffstat (limited to 'libre')
-rw-r--r--libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch267
-rw-r--r--libre/uboot-am335x_bone/PKGBUILD49
-rw-r--r--libre/uboot-am335x_bone/boot.txt21
-rwxr-xr-xlibre/uboot-am335x_bone/mkscr9
-rw-r--r--libre/uboot-am335x_bone/uEnv.txt1
-rw-r--r--libre/uboot-am335x_bone/uboot-am335x_bone.install4
6 files changed, 111 insertions, 240 deletions
diff --git a/libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch b/libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch
index 9968fc0c2..4fa35ee32 100644
--- a/libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch
+++ b/libre/uboot-am335x_bone/0001-parabola-arm-modifications.patch
@@ -1,18 +1,27 @@
-diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
-index 968d041..3406926 100644
---- a/configs/am335x_evm_defconfig
-+++ b/configs/am335x_evm_defconfig
-@@ -1,7 +1,6 @@
- CONFIG_SPL=y
- CONFIG_SPL_STACK_R=y
+From 02714f8c47a6500209907afcc6faf8823e55c0ca Mon Sep 17 00:00:00 2001
+From: Kevin Mihelich <kevin@archlinuxarm.org>
+Date: Mon, 14 Aug 2017 18:37:05 -0600
+Subject: [PATCH] arch linux arm modifications
+
+---
+ configs/am335x_boneblack_defconfig | 1 -
+ include/configs/am335x_evm.h | 8 +++++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/configs/am335x_boneblack_defconfig b/configs/am335x_boneblack_defconfig
+index 3d86c1b34e..b8a72e57df 100644
+--- a/configs/am335x_boneblack_defconfig
++++ b/configs/am335x_boneblack_defconfig
+@@ -5,7 +5,6 @@ CONFIG_AM33XX=y
+ # CONFIG_SPL_NAND_SUPPORT is not set
CONFIG_SPL_STACK_R_ADDR=0x82000000
--CONFIG_SYS_EXTRA_OPTIONS="NAND"
--CONFIG_CONS_INDEX=1
-+CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1"
- CONFIG_ARM=y
- CONFIG_TARGET_AM335X_EVM=y
+ CONFIG_DISTRO_DEFAULTS=y
+-CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT"
+ CONFIG_SYS_CONSOLE_INFO_QUIET=y
+ CONFIG_VERSION_VARIABLE=y
+ CONFIG_ARCH_MISC_INIT=y
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
-index a87059c..e68e848 100644
+index 0c6d2880da..9afc46411d 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -17,6 +17,7 @@
@@ -22,217 +31,41 @@ index a87059c..e68e848 100644
+#define CONFIG_ENV_IS_NOWHERE
#ifndef CONFIG_SPL_BUILD
- #ifndef CONFIG_FIT
-@@ -45,6 +46,9 @@
- /* Enhance our eMMC support / experience. */
- #define CONFIG_CMD_GPT
- #define CONFIG_EFI_PARTITION
-+#define CONFIG_CMD_PART
-+#define CONFIG_PARTITION_UUIDS
-+#define CONFIG_CMD_SETEXPR
+ # define CONFIG_TIMESTAMP
+@@ -76,10 +77,7 @@
- #ifdef CONFIG_NAND
- #define NANDARGS \
-@@ -70,110 +74,79 @@
- #ifndef CONFIG_SPL_BUILD
- #define CONFIG_EXTRA_ENV_SETTINGS \
- DEFAULT_LINUX_BOOT_ENV \
-- "boot_fdt=try\0" \
-- "bootpart=0:2\0" \
-+ "bootpart=0:1\0" \
+ #define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 0) \
+- func(LEGACY_MMC, legacy_mmc, 0) \
+ func(MMC, mmc, 1) \
+- func(LEGACY_MMC, legacy_mmc, 1) \
+- func(NAND, nand, 0) \
+ func(PXE, pxe, na) \
+ func(DHCP, dhcp, na)
+
+@@ -87,6 +85,10 @@
+ "if test ${boot_fit} -eq 1; then " \
+ "run update_to_fit;" \
+ "fi;" \
++ "gpio clear 54; " \
++ "gpio clear 55; " \
++ "gpio clear 56; " \
++ "gpio set 53; " \
+ "run findfdt; " \
+ "run init_console; " \
+ "run envboot; " \
+@@ -104,8 +106,9 @@
+ DEFAULT_FIT_TI_ARGS \
+ "bootpart=0:2\0" \
"bootdir=/boot\0" \
- "bootfile=zImage\0" \
-+ "fdtdir=/boot/dtbs/linux-libre\0" \
+- "fdtfile=undefined\0" \
+ "bootfile=vmlinuz-linux-libre\0" \
- "fdtfile=undefined\0" \
+ "rdfile=initramfs-linux-libre.img\0" \
++ "fdtfile=/boot/dtbs/linux-libre\0" \
"console=ttyO0,115200n8\0" \
"partitions=" \
"uuid_disk=${uuid_gpt_disk};" \
- "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
- "optargs=\0" \
-- "mmcdev=0\0" \
-- "mmcroot=/dev/mmcblk0p2 ro\0" \
-- "mmcrootfstype=ext4 rootwait\0" \
-- "rootpath=/export/rootfs\0" \
-- "nfsopts=nolock\0" \
-- "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
-- "::off\0" \
-- "ramroot=/dev/ram0 rw\0" \
-- "ramrootfstype=ext2\0" \
-+ "cape_disable=\0" \
-+ "cape_enable=\0" \
-+ "cmdline=\0" \
- "mmcargs=setenv bootargs console=${console} " \
- "${optargs} " \
-- "root=${mmcroot} " \
-- "rootfstype=${mmcrootfstype}\0" \
-- "spiroot=/dev/mtdblock4 rw\0" \
-- "spirootfstype=jffs2\0" \
-- "spisrcaddr=0xe0000\0" \
-- "spiimgsize=0x362000\0" \
-- "spibusno=0\0" \
-- "spiargs=setenv bootargs console=${console} " \
-- "${optargs} " \
-- "root=${spiroot} " \
-- "rootfstype=${spirootfstype}\0" \
-- "netargs=setenv bootargs console=${console} " \
-- "${optargs} " \
-- "root=/dev/nfs " \
-- "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
-- "ip=dhcp\0" \
-- "bootenv=uEnv.txt\0" \
-- "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
-- "source ${loadaddr}\0" \
-- "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
-- "importbootenv=echo Importing environment from mmc ...; " \
-- "env import -t -r $loadaddr $filesize\0" \
-- "ramargs=setenv bootargs console=${console} " \
-- "${optargs} " \
-- "root=${ramroot} " \
-- "rootfstype=${ramrootfstype}\0" \
-- "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
-- "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-- "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-- "mmcloados=run mmcargs; " \
-- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-- "if run loadfdt; then " \
-- "bootz ${loadaddr} - ${fdtaddr}; " \
-- "else " \
-- "if test ${boot_fdt} = try; then " \
-- "bootz; " \
-- "else " \
-- "echo WARN: Cannot load the DT; " \
-- "fi; " \
-- "fi; " \
-- "else " \
-- "bootz; " \
-- "fi;\0" \
-- "mmcboot=mmc dev ${mmcdev}; " \
-- "if mmc rescan; then " \
-- "echo SD/MMC found on device ${mmcdev};" \
-- "if run loadbootscript; then " \
-- "run bootscript;" \
-- "else " \
-- "if run loadbootenv; then " \
-- "echo Loaded environment from ${bootenv};" \
-- "run importbootenv;" \
-+ "${cape_disable} " \
-+ "${cape_enable} " \
-+ "root=${root} " \
-+ "${cmdline}\0" \
-+ "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-+ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}\0" \
-+ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
-+ "mmcboot=usb start;" \
-+ "for devtype in mmc usb; do " \
-+ "for devnum in 0 1; do " \
-+ "if ${devtype} dev ${devnum}; then " \
-+ "echo ${devtype} found on device ${devnum};" \
-+ "setenv bootpart ${devnum}:1;" \
-+ "part uuid ${devtype} ${bootpart} uuid;" \
-+ "setenv root PARTUUID=${uuid} rw rootwait fixrtc;" \
-+ "echo Checking for: ${bootdir}/uEnv.txt ...;" \
-+ "gpio set 54;" \
-+ "if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then " \
-+ "load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt;" \
-+ "env import -t ${loadaddr} ${filesize};" \
-+ "echo Loaded environment from ${bootdir}/uEnv.txt;" \
-+ "if test -n ${cape}; then " \
-+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtbase}-${cape}.dtb; then " \
-+ "setenv fdtfile ${fdtbase}-${cape}.dtb; " \
-+ "fi; " \
-+ "echo using: $fdtfile...; " \
-+ "fi; " \
-+ "echo Checking if uenvcmd is set ...;" \
-+ "if test -n ${uenvcmd}; then " \
-+ "echo Running uenvcmd ...;" \
-+ "run uenvcmd;" \
-+ "fi;" \
-+ "fi;" \
-+ "gpio set 55;" \
-+ "if run loadimage; then " \
-+ "run mmcargs;" \
-+ "if run loadfdt; then " \
-+ "gpio set 56;" \
-+ "if run loadrd; then " \
-+ "bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr};" \
-+ "else " \
-+ "bootz ${loadaddr} - ${fdtaddr};" \
-+ "fi;" \
-+ "fi;" \
-+ "else " \
-+ "echo No kernel found;" \
-+ "fi;" \
-+ "gpio clear 54; gpio clear 55;" \
-+ "setexpr devnum ${devnum} + 1;" \
- "fi;" \
-- "if test -n $uenvcmd; then " \
-- "echo Running uenvcmd ...;" \
-- "run uenvcmd;" \
-- "fi;" \
-- "if run loadimage; then " \
-- "run mmcloados;" \
-- "fi;" \
-- "fi ;" \
-- "fi;\0" \
-- "spiboot=echo Booting from spi ...; " \
-- "run spiargs; " \
-- "sf probe ${spibusno}:0; " \
-- "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
-- "bootz ${loadaddr}\0" \
-- "netboot=echo Booting from network ...; " \
-- "setenv autoload no; " \
-- "dhcp; " \
-- "tftp ${loadaddr} ${bootfile}; " \
-- "tftp ${fdtaddr} ${fdtfile}; " \
-- "run netargs; " \
-- "bootz ${loadaddr} - ${fdtaddr}\0" \
-- "ramboot=echo Booting from ramdisk ...; " \
-- "run ramargs; " \
-- "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
-+ "done;" \
-+ "done;\0" \
- "findfdt="\
- "if test $board_name = A335BONE; then " \
-- "setenv fdtfile am335x-bone.dtb; fi; " \
-+ "setenv fdtfile am335x-bone.dtb; setenv fdtbase am335x-bone; fi; " \
- "if test $board_name = A335BNLT; then " \
-- "setenv fdtfile am335x-boneblack.dtb; fi; " \
-+ "setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; setenv umsmedia 1; fi; " \
- "if test $board_name = A33515BB; then " \
- "setenv fdtfile am335x-evm.dtb; fi; " \
- "if test $board_name = A335X_SK; then " \
-@@ -185,12 +158,11 @@
- #endif
-
- #define CONFIG_BOOTCOMMAND \
-- "run findfdt; " \
-- "run mmcboot;" \
-- "setenv mmcdev 1; " \
-- "setenv bootpart 1:2; " \
-+ "gpio set 53;" \
-+ "run findfdt;" \
- "run mmcboot;" \
-- "run nandboot;"
-+ "gpio clear 54; gpio clear 55;" \
-+ "gpio set 56"
-
- /* NS16550 Configuration */
- #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
-@@ -329,9 +301,8 @@
- #endif
-
- #ifdef CONFIG_MUSB_GADGET
--#define CONFIG_USB_ETHER
--#define CONFIG_USB_ETH_RNDIS
--#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
-+#define CONFIG_CMD_USB_MASS_STORAGE
-+#define CONFIG_USB_GADGET_MASS_STORAGE
-
- /* USB TI's IDs */
- #define CONFIG_G_DNL_VENDOR_NUM 0x0451
--
-2.4.2
+2.14.1
diff --git a/libre/uboot-am335x_bone/PKGBUILD b/libre/uboot-am335x_bone/PKGBUILD
index 721af622f..89e07b1f0 100644
--- a/libre/uboot-am335x_bone/PKGBUILD
+++ b/libre/uboot-am335x_bone/PKGBUILD
@@ -1,46 +1,51 @@
-# U-Boot: BeagleBone and BeagleBone Black
-# Maintainer: André Silva <emulatorman@hyperbola.info>
+# U-Boot: Beaglebone and Beaglebone Black
+# Maintainer (ArchArm): Kevin Mihelich <kevin@archlinuxarm.org>
+# Maintainer: Andreas Grapentin <oaken-source@parabola.nu>
+# Contributor: André Silva <emulatorman@hyperbola.info>
buildarch=4
pkgname=uboot-am335x_bone
-pkgver=2015.04
+pkgver=2017.07
pkgrel=1
-pkgdesc="U-Boot for BeagleBone and BeagleBone Black"
+pkgdesc="U-Boot for Beaglebone and Beaglebone Black"
arch=('armv7h')
url="http://git.denx.de/u-boot.git/"
-makedepends=('git' 'bc')
-depends=('linux-libre')
-replaces=('uboot-beaglebone-linux-libre' 'uboot-beaglebone-linux-libre-lts'
- 'uboot-beaglebone-linux-libre-grsec' 'uboot-beaglebone-linux-libre-pck'
- 'uboot-beaglebone')
-conflicts=('uboot4extlinux-am335x_bone' 'uboot4grub-am335x_bone')
+makedepends=('bc' 'git')
+conflicts=(uboot4{extlinux,grub}-am335x_bone)
license=('GPL')
install=${pkgname}.install
+backup=('boot/boot.txt' 'boot/boot.scr')
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
'0001-parabola-arm-modifications.patch'
- 'uEnv.txt')
-md5sums=('570bdc2c47270c2a98ca60ff6c5c74cd'
- '0196a4e91c2e7b4c0183a19cdf651c07'
- 'ccb79775b81654e16fca18825c7f2506')
+ 'boot.txt'
+ 'mkscr')
+md5sums=('b74741e7a9ad1cf9a5bfa87302b80f2b'
+ '89c046a7858da6ea55404c3b8314c41d'
+ 'e35840bf487af832b84b41b931e16aa1'
+ '021623a04afd29ac3f368977140cfbfd')
prepare() {
- cd u-boot-${pkgver}
- patch -Np1 -i ../0001-parabola-arm-modifications.patch
+ cd u-boot-${pkgver/rc/-rc}
+ git apply ../0001-parabola-arm-modifications.patch
}
build() {
- cd u-boot-${pkgver}
+ cd u-boot-${pkgver/rc/-rc}
unset CFLAGS CXXFLAGS LDFLAGS
- make distclean
- make am335x_evm_config
- make
+ make distclean
+ make am335x_boneblack_defconfig
+ echo 'CONFIG_IDENT_STRING=" Parabola GNU/Linux-libre"' >> .config
+ make EXTRAVERSION=-${pkgrel}
}
package() {
- cd u-boot-${pkgver}
+ cd u-boot-${pkgver/rc/-rc}
mkdir -p "${pkgdir}"/boot
- cp MLO u-boot.img "${srcdir}"/uEnv.txt "${pkgdir}"/boot
+ cp MLO 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/libre/uboot-am335x_bone/boot.txt b/libre/uboot-am335x_bone/boot.txt
new file mode 100644
index 000000000..76155ac5a
--- /dev/null
+++ b/libre/uboot-am335x_bone/boot.txt
@@ -0,0 +1,21 @@
+# 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=tty0 console=${console} root=PARTUUID=${uuid} rw rootwait"
+
+if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/vmlinuz-linux-libre; then
+ gpio set 54
+ echo fdt: ${fdtfile}
+ if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/linux-libre/${fdtfile}; then
+ gpio set 55
+ if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux-libre.img; then
+ gpio set 56
+ bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
+ else
+ gpio set 56
+ bootz ${kernel_addr_r} - ${fdt_addr_r};
+ fi;
+ fi;
+fi
diff --git a/libre/uboot-am335x_bone/mkscr b/libre/uboot-am335x_bone/mkscr
new file mode 100755
index 000000000..272b6a7a5
--- /dev/null
+++ b/libre/uboot-am335x_bone/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/libre/uboot-am335x_bone/uEnv.txt b/libre/uboot-am335x_bone/uEnv.txt
deleted file mode 100644
index f432efc6b..000000000
--- a/libre/uboot-am335x_bone/uEnv.txt
+++ /dev/null
@@ -1 +0,0 @@
-optargs=coherent_pool=1M
diff --git a/libre/uboot-am335x_bone/uboot-am335x_bone.install b/libre/uboot-am335x_bone/uboot-am335x_bone.install
index 24ccc1acb..3a1a9daed 100644
--- a/libre/uboot-am335x_bone/uboot-am335x_bone.install
+++ b/libre/uboot-am335x_bone/uboot-am335x_bone.install
@@ -29,4 +29,8 @@ post_install() {
post_upgrade() {
flash_uboot
+ if (( $(vercmp $2 2017.07-1) < 0 )); then
+ echo ' >>> Note: uEnv.txt is no longer sourced. Make any customizations within /boot/boot.txt'
+ echo ' and run ./mkscr within /boot to convert it to the boot.scr file.'
+ fi
}