summaryrefslogtreecommitdiff
path: root/libre
diff options
context:
space:
mode:
authorIsaac David <isacdaavid@isacdaavid.info>2015-10-09 13:41:54 -0500
committerIsaac David <isacdaavid@isacdaavid.info>2015-10-09 13:41:54 -0500
commit661b250a8a6fa8a7dbb4ece0125f0de6e3ea529c (patch)
treeb43e2747e186c3c2dfadeb9eac658e32b26b12cc /libre
parent490283446495f51256787e45d2393551e2bcf443 (diff)
add packages uboot-beagle{bone,board}-linux-libre-pck to libre
Diffstat (limited to 'libre')
-rw-r--r--libre/uboot-beagleboard-linux-libre-pck/0001-parabola-arm-modifications.patch308
-rw-r--r--libre/uboot-beagleboard-linux-libre-pck/PKGBUILD44
-rw-r--r--libre/uboot-beagleboard-linux-libre-pck/uEnv.txt0
-rw-r--r--libre/uboot-beaglebone-linux-libre-pck/0001-parabola-arm-modifications.patch238
-rw-r--r--libre/uboot-beaglebone-linux-libre-pck/PKGBUILD45
-rw-r--r--libre/uboot-beaglebone-linux-libre-pck/uEnv.txt1
-rw-r--r--libre/uboot-beaglebone-linux-libre-pck/uboot-beaglebone-linux-libre-pck.install32
7 files changed, 668 insertions, 0 deletions
diff --git a/libre/uboot-beagleboard-linux-libre-pck/0001-parabola-arm-modifications.patch b/libre/uboot-beagleboard-linux-libre-pck/0001-parabola-arm-modifications.patch
new file mode 100644
index 000000000..699a167f0
--- /dev/null
+++ b/libre/uboot-beagleboard-linux-libre-pck/0001-parabola-arm-modifications.patch
@@ -0,0 +1,308 @@
+diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
+index 7b37fbe..ff986ff 100644
+--- a/board/ti/beagle/beagle.c
++++ b/board/ti/beagle/beagle.c
+@@ -56,6 +56,7 @@
+ #define BBTOYS_WIFI 0x01000B00
+ #define BBTOYS_VGA 0x02000B00
+ #define BBTOYS_LCD 0x03000B00
++#define BBTOYS_ULCD 0x04000B00
+ #define BCT_BRETTL3 0x01000F00
+ #define BCT_BRETTL4 0x02000F00
+ #define LSR_COM6L_ADPT 0x01001300
+@@ -211,25 +212,25 @@ void get_board_mem_timings(struct board_sdrc_timings *timings)
+ * bus 1 for the availability of an AT24C01B serial EEPROM.
+ * returns the device_vendor field from the EEPROM
+ */
+-static unsigned int get_expansion_id(void)
++static unsigned int get_expansion_id(int eeprom_address)
+ {
+ i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
+
+ /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
+- if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
++ if (i2c_probe(eeprom_address) == 1) {
+ i2c_set_bus_num(TWL4030_I2C_BUS);
+ return BEAGLE_NO_EEPROM;
+ }
+
+ /* read configuration data */
+- i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
++ i2c_read(eeprom_address, 0, 1, (u8 *)&expansion_config,
+ sizeof(expansion_config));
+
+ /* retry reading configuration data with 16bit addressing */
+ if ((expansion_config.device_vendor == 0xFFFFFF00) ||
+ (expansion_config.device_vendor == 0xFFFFFFFF)) {
+ printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n");
+- i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config,
++ i2c_read(eeprom_address, 0, 2, (u8 *)&expansion_config,
+ sizeof(expansion_config));
+ }
+
+@@ -341,15 +342,18 @@ int misc_init_r(void)
+ case REVISION_AXBX:
+ printf("Beagle Rev Ax/Bx\n");
+ setenv("beaglerev", "AxBx");
++ setenv("musb", "musb_hdrc.fifo_mode=5");
+ break;
+ case REVISION_CX:
+ printf("Beagle Rev C1/C2/C3\n");
+ setenv("beaglerev", "Cx");
++ setenv("musb", "musb_hdrc.fifo_mode=5");
+ MUX_BEAGLE_C();
+ break;
+ case REVISION_C4:
+ printf("Beagle Rev C4\n");
+ setenv("beaglerev", "C4");
++ setenv("musb", "musb_hdrc.fifo_mode=5");
+ MUX_BEAGLE_C();
+ /* Set VAUX2 to 1.8V for EHCI PHY */
+ twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
+@@ -390,7 +394,7 @@ int misc_init_r(void)
+ generate_fake_mac = true;
+ }
+
+- switch (get_expansion_id()) {
++ switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS)) {
+ case TINCANTOOLS_ZIPPY:
+ printf("Recognized Tincantools Zippy board (rev %d %s)\n",
+ expansion_config.revision,
+@@ -473,6 +477,30 @@ int misc_init_r(void)
+ if (expansion_config.content == 1)
+ setenv(expansion_config.env_var, expansion_config.env_setting);
+
++ /* Scan 0x51 as well for loop-thru boards */
++ switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS + 1)) {
++ case BBTOYS_ULCD:
++ printf("Recognized BeagleBoardToys uLCD-lite board\n");
++ setenv("buddy2", "bbtoys-ulcd");
++ setenv("defaultdisplay", "dvi");
++ setenv("dvimode", "800x480MR-16@60");
++ setenv("lcd1", "i2c mw 40 00 00; i2c mw 40 04 80; i2c mw 40 0d 05");
++ setenv("lcdcmd", "i2c dev 1 ; run lcd1; i2c dev 0");
++ setenv("kmsmode", "video=DVI-D-1:800x480");
++ break;
++ case BEAGLE_NO_EEPROM:
++ printf("No EEPROM on expansion board\n");
++ setenv("buddy2", "none");
++ break;
++ default:
++ printf("Unrecognized expansion board: %x\n",
++ expansion_config.device_vendor);
++ setenv("buddy2", "unknown");
++ }
++
++ if (expansion_config.content == 1)
++ setenv(expansion_config.env_var, expansion_config.env_setting);
++
+ twl4030_power_init();
+ switch (get_board_revision()) {
+ case REVISION_XM_AB:
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index f25a940..9f15cf1 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -90,6 +90,12 @@
+ #define CONFIG_USB_ETHER_MCS7830
+ #define CONFIG_USB_ETHER_SMSC95XX
+
++/* Parabola GNU/Linux-libre extras */
++#define CONFIG_IDENT_STRING " Parabola GNU/Linux-libre"
++#define CONFIG_SUPPORT_RAW_INITRD
++#define CONFIG_CMD_PART
++#define CONFIG_PARTITION_UUIDS
++
+ /* GPIO banks */
+ #define CONFIG_OMAP3_GPIO_5 /* GPIO128..159 is in GPIO bank 5 */
+ #define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */
+@@ -129,50 +135,62 @@
+ /* devices */
+
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+- "loadaddr=0x80200000\0" \
+- "rdaddr=0x81000000\0" \
++ "loadaddr=0x82000000\0" \
++ "rdaddr=0x88080000\0" \
+ "fdt_high=0xffffffff\0" \
+- "fdtaddr=0x80f80000\0" \
+- "usbtty=cdc_acm\0" \
+- "bootfile=uImage\0" \
+- "ramdisk=ramdisk.gz\0" \
+- "bootdir=/boot\0" \
+- "bootpart=0:2\0" \
++ "fdtaddr=0x88000000\0" \
+ "console=ttyO2,115200n8\0" \
+- "mpurate=auto\0" \
+- "buddy=none\0" \
+- "optargs=\0" \
+- "camera=none\0" \
+- "vram=12M\0" \
+- "dvimode=640x480MR-16@60\0" \
+- "defaultdisplay=dvi\0" \
++ "fdtfile=undefined\0" \
++ "bootpart=0:1\0" \
++ "bootdir=/\0" \
++ "fdtdir=/dtbs/linux-libre-pck\0" \
++ "bootfile=vmlinuz-linux-libre-pck\0" \
++ "rdfile=initramfs-linux-libre-pck.img\0" \
+ "mmcdev=0\0" \
+- "mmcroot=/dev/mmcblk0p2 rw\0" \
+- "mmcrootfstype=ext3 rootwait\0" \
+- "nandroot=ubi0:rootfs ubi.mtd=4\0" \
+- "nandrootfstype=ubifs\0" \
+- "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=0x81000000,64M\0" \
+- "ramrootfstype=ext2\0" \
++ "optargs=\0" \
+ "mmcargs=setenv bootargs console=${console} " \
+ "${optargs} " \
+- "mpurate=${mpurate} " \
+- "buddy=${buddy} "\
+- "camera=${camera} "\
+- "vram=${vram} " \
+- "omapfb.mode=dvi:${dvimode} " \
+- "omapdss.def_disp=${defaultdisplay} " \
+- "root=${mmcroot} " \
+- "rootfstype=${mmcrootfstype}\0" \
+- "nandargs=setenv bootargs console=${console} " \
+- "${optargs} " \
+- "mpurate=${mpurate} " \
+- "buddy=${buddy} "\
+- "camera=${camera} "\
+- "vram=${vram} " \
+- "omapfb.mode=dvi:${dvimode} " \
+- "omapdss.def_disp=${defaultdisplay} " \
+- "root=${nandroot} " \
+- "rootfstype=${nandrootfstype}\0" \
++ "root=${root} " \
++ "${musb} " \
++ "${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 " \
++ "setenv devnum 0;" \
++ "while ${devtype} dev ${devnum}; do " \
++ "echo ${devtype} found on device ${devnum};" \
++ "setenv bootpart ${devnum}:1;" \
++ "if test ${devtype} = mmc; then part uuid mmc ${devnum}:2 uuid; else part uuid ${devtype} ${devnum}:1 uuid; fi;" \
++ "part uuid ${devtype} ${rootpart} uuid;" \
++ "setenv root PARTUUID=${uuid} rw rootwait;" \
++ "echo Checking for: ${bootdir}/uEnv.txt ...;" \
++ "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;" \
++ "echo Checking if uenvcmd is set ...;" \
++ "if test -n ${uenvcmd}; then " \
++ "echo Running uenvcmd ...;" \
++ "run uenvcmd;" \
++ "fi;" \
++ "fi;" \
++ "if run loadimage; then " \
++ "run mmcargs;" \
++ "if run loadfdt; then " \
++ "if run loadrd; then " \
++ "bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr};" \
++ "else " \
++ "bootz ${loadaddr} - ${fdtaddr};" \
++ "fi;" \
++ "fi;" \
++ "else " \
++ "echo No kernel found;" \
++ "fi;" \
++ "setexpr devnum ${devnum} + 1;" \
++ "done;" \
++ "done;\0" \
+ "findfdt=" \
+ "if test $beaglerev = AxBx; then " \
+ "setenv fdtfile omap3-beagle.dtb; fi; " \
+@@ -185,81 +203,11 @@
+ "if test $beaglerev = xMC; then " \
+ "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
+ "if test $fdtfile = undefined; then " \
+- "echo WARNING: Could not determine device tree to use; fi; \0" \
+- "validatefdt=" \
+- "if test $beaglerev = xMAB; then " \
+- "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
+- "setenv fdtfile omap3-beagle-xm.dtb; " \
+- "fi; " \
+- "fi; \0" \
+- "bootenv=uEnv.txt\0" \
+- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+- "importbootenv=echo Importing environment from mmc ...; " \
+- "env import -t -r $loadaddr $filesize\0" \
+- "ramargs=setenv bootargs console=${console} " \
+- "${optargs} " \
+- "mpurate=${mpurate} " \
+- "buddy=${buddy} "\
+- "vram=${vram} " \
+- "omapfb.mode=dvi:${dvimode} " \
+- "omapdss.def_disp=${defaultdisplay} " \
+- "root=${ramroot} " \
+- "rootfstype=${ramrootfstype}\0" \
+- "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
+- "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+- "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
+- "source ${loadaddr}\0" \
+- "loadfdt=run validatefdt; load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+- "mmcboot=echo Booting from mmc ...; " \
+- "run mmcargs; " \
+- "bootm ${loadaddr}\0" \
+- "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \
+- "run mmcargs; " \
+- "bootz ${loadaddr} - ${fdtaddr}\0" \
+- "nandboot=echo Booting from nand ...; " \
+- "run nandargs; " \
+- "nand read ${loadaddr} 280000 400000; " \
+- "bootm ${loadaddr}\0" \
+- "ramboot=echo Booting from ramdisk ...; " \
+- "run ramargs; " \
+- "bootm ${loadaddr}\0" \
+- "userbutton=if gpio input 173; then run userbutton_xm; " \
+- "else run userbutton_nonxm; fi;\0" \
+- "userbutton_xm=gpio input 4;\0" \
+- "userbutton_nonxm=gpio input 7;\0"
+-/* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */
++ "echo WARNING: Could not determine device tree to use; fi; \0"
++
+ #define CONFIG_BOOTCOMMAND \
+ "run findfdt; " \
+- "mmc dev ${mmcdev}; if mmc rescan; then " \
+- "if run userbutton; then " \
+- "setenv bootenv uEnv.txt;" \
+- "else " \
+- "setenv bootenv user.txt;" \
+- "fi;" \
+- "echo SD/MMC found on device ${mmcdev};" \
+- "if run loadbootenv; then " \
+- "echo Loaded environment from ${bootenv};" \
+- "run importbootenv;" \
+- "fi;" \
+- "if test -n $uenvcmd; then " \
+- "echo Running uenvcmd ...;" \
+- "run uenvcmd;" \
+- "fi;" \
+- "if run loadbootscript; then " \
+- "run bootscript; " \
+- "else " \
+- "if run loadimage; then " \
+- "run mmcboot;" \
+- "fi;" \
+- "fi; " \
+- "fi;" \
+- "run nandboot;" \
+- "setenv bootfile zImage;" \
+- "if run loadimage; then " \
+- "run loadfdt;" \
+- "run mmcbootz; " \
+- "fi; " \
++ "run mmcboot"
+
+ /*
+ * OMAP3 has 12 GP timers, they can be driven by the system clock
+--
+2.4.2
+
diff --git a/libre/uboot-beagleboard-linux-libre-pck/PKGBUILD b/libre/uboot-beagleboard-linux-libre-pck/PKGBUILD
new file mode 100644
index 000000000..d5bfa4a10
--- /dev/null
+++ b/libre/uboot-beagleboard-linux-libre-pck/PKGBUILD
@@ -0,0 +1,44 @@
+# U-Boot: BeagleBoard and BeagleBoard-xM
+# Maintainer (Arch): Kevin Mihelich <kevin@archlinuxarm.org>
+# Contributor: André Silva <emulatorman@parabola.nu>
+# Contributor: Isaac David <isacdaavid@isacdaavid.info>
+
+buildarch=4
+
+_pkgname=linux-libre-pck
+pkgname=uboot-beagleboard-${_pkgname}
+pkgver=2015.04
+pkgrel=1
+pkgdesc="U-Boot for BeagleBoard and BeagleBoard-xM (built for the linux-libre-pck kernel package)"
+arch=('armv7h')
+url="http://git.denx.de/u-boot.git/"
+license=('GPL')
+depends=('linux-libre-pck')
+makedepends=('bc')
+source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
+ '0001-parabola-arm-modifications.patch'
+ 'uEnv.txt')
+md5sums=('570bdc2c47270c2a98ca60ff6c5c74cd'
+ '4d4fd0e33ddd334a79e1e85c5b418b35'
+ 'd41d8cd98f00b204e9800998ecf8427e')
+
+prepare() {
+ cd u-boot-${pkgver}
+ patch -Np1 -i ../0001-parabola-arm-modifications.patch
+}
+
+build() {
+ cd u-boot-${pkgver}
+
+ unset LDFLAGS CFLAGS CXXFLAGS
+
+ make distclean
+ make omap3_beagle_config
+ make
+}
+
+package() {
+ cd u-boot-${pkgver}
+ mkdir -p "${pkgdir}/boot/${pkgname}"
+ cp MLO u-boot.img "${srcdir}"/uEnv.txt "${pkgdir}/boot/${pkgname}"
+}
diff --git a/libre/uboot-beagleboard-linux-libre-pck/uEnv.txt b/libre/uboot-beagleboard-linux-libre-pck/uEnv.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/libre/uboot-beagleboard-linux-libre-pck/uEnv.txt
diff --git a/libre/uboot-beaglebone-linux-libre-pck/0001-parabola-arm-modifications.patch b/libre/uboot-beaglebone-linux-libre-pck/0001-parabola-arm-modifications.patch
new file mode 100644
index 000000000..b4fb1f5cc
--- /dev/null
+++ b/libre/uboot-beaglebone-linux-libre-pck/0001-parabola-arm-modifications.patch
@@ -0,0 +1,238 @@
+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
+ 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
+diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
+index a87059c..e68e848 100644
+--- a/include/configs/am335x_evm.h
++++ b/include/configs/am335x_evm.h
+@@ -17,6 +17,7 @@
+ #define __CONFIG_AM335X_EVM_H
+
+ #include <configs/ti_am335x_common.h>
++#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
+
+ #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" \
+ "bootdir=/boot\0" \
+- "bootfile=zImage\0" \
++ "fdtdir=/boot/dtbs/linux-libre-pck\0" \
++ "bootfile=vmlinuz-linux-libre-pck\0" \
+ "fdtfile=undefined\0" \
++ "rdfile=initramfs-linux-libre-pck.img\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}/uboot-beaglebone-linux-libre-pck/uEnv.txt ...;" \
++ "gpio set 54;" \
++ "if test -e ${devtype} ${bootpart} ${bootdir}/uboot-beaglebone-linux-libre-pck/uEnv.txt; then " \
++ "load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uboot-beaglebone-linux-libre-pck/uEnv.txt;" \
++ "env import -t ${loadaddr} ${filesize};" \
++ "echo Loaded environment from ${bootdir}/uboot-beaglebone-linux-libre-pck/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
+
diff --git a/libre/uboot-beaglebone-linux-libre-pck/PKGBUILD b/libre/uboot-beaglebone-linux-libre-pck/PKGBUILD
new file mode 100644
index 000000000..e8c2c7e5d
--- /dev/null
+++ b/libre/uboot-beaglebone-linux-libre-pck/PKGBUILD
@@ -0,0 +1,45 @@
+# U-Boot: BeagleBone and BeagleBone Black
+# Maintainer (Arch): Kevin Mihelich <kevin@archlinuxarm.org>
+# Contributor: André Silva <emulatorman@parabola.nu>
+# Contributor: Isaac David <isacdaavid@isacdaavid.info>
+
+buildarch=4
+
+_pkgname=linux-libre-pck
+pkgname=uboot-beaglebone-${_pkgname}
+pkgver=2015.04
+pkgrel=1.2
+pkgdesc="U-Boot for BeagleBone and BeagleBone Black (built for the linux-libre-pck kernel package)"
+arch=('armv7h')
+url="http://git.denx.de/u-boot.git/"
+depends=('linux-libre-pck')
+makedepends=('bc')
+license=('GPL')
+install=${pkgname}.install
+source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
+ '0001-parabola-arm-modifications.patch'
+ 'uEnv.txt')
+md5sums=('570bdc2c47270c2a98ca60ff6c5c74cd'
+ '69e0f4a88119749a5c263cdedcece25f'
+ '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/${pkgname}"
+ cp MLO u-boot.img "${srcdir}"/uEnv.txt "${pkgdir}/boot/${pkgname}"
+}
diff --git a/libre/uboot-beaglebone-linux-libre-pck/uEnv.txt b/libre/uboot-beaglebone-linux-libre-pck/uEnv.txt
new file mode 100644
index 000000000..f432efc6b
--- /dev/null
+++ b/libre/uboot-beaglebone-linux-libre-pck/uEnv.txt
@@ -0,0 +1 @@
+optargs=coherent_pool=1M
diff --git a/libre/uboot-beaglebone-linux-libre-pck/uboot-beaglebone-linux-libre-pck.install b/libre/uboot-beaglebone-linux-libre-pck/uboot-beaglebone-linux-libre-pck.install
new file mode 100644
index 000000000..3ad25cc13
--- /dev/null
+++ b/libre/uboot-beaglebone-linux-libre-pck/uboot-beaglebone-linux-libre-pck.install
@@ -0,0 +1,32 @@
+flash_instructions() {
+ echo "# dd if=/boot/uboot-beaglebone-linux-libre-pck/MLO of=/dev/mmcblk0 count=1 seek=1 conv=notrunc bs=128k"
+ echo "# dd if=/boot/uboot-beaglebone-linux-libre-pck/u-boot.img of=/dev/mmcblk0 count=2 seek=1 conv=notrunc bs=384k"
+}
+
+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/uboot-beaglebone-linux-libre-pck/MLO of=$root count=1 seek=1 conv=notrunc bs=128k
+ dd if=/boot/uboot-beaglebone-linux-libre-pck/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
+}
+
+post_upgrade() {
+ flash_uboot
+}