diff --git a/alarm/uboot-beaglebone/PKGBUILD b/alarm/uboot-beaglebone/PKGBUILD index d21681f00..54aa785c9 100644 --- a/alarm/uboot-beaglebone/PKGBUILD +++ b/alarm/uboot-beaglebone/PKGBUILD @@ -4,28 +4,27 @@ buildarch=4 pkgname=uboot-beaglebone -pkgver=2013.07 +pkgver=2014.07 pkgrel=1 pkgdesc="U-Boot for Beaglebone and Beaglebone Black" arch=('armv7h') url="http://git.denx.de/u-boot.git/" license=('GPL') -makedepends=('git') -source=("git://git.denx.de/u-boot.git#tag=v${pkgver}" - 'https://raw.github.com/eewiki/u-boot-patches/master/v2013.07/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch' +makedepends=('bc') +source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2" + 'alarm.patch' 'uEnv.txt') -md5sums=('SKIP' - 'dbc20ae3e48ae69fc2bbd35b96a6663e' - 'd811e78f6df4bda2cc916be699f1c750') +md5sums=('36d4bad687edcafa396fee607e505d4e' + '0d63da3d66218452d3e3d7c69d078ad8' + 'ccb79775b81654e16fca18825c7f2506') prepare() { - cd u-boot - patch -p1 -i "${srcdir}"/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch - rm -rf .git + cd u-boot-${pkgver} + patch -p1 -i ../alarm.patch } build() { - cd u-boot + cd u-boot-${pkgver} unset CFLAGS unset CXXFLAGS @@ -36,7 +35,7 @@ build() { } package() { - cd u-boot + cd u-boot-${pkgver} mkdir -p "${pkgdir}"/boot cp MLO u-boot.img "${srcdir}"/uEnv.txt "${pkgdir}"/boot } diff --git a/alarm/uboot-beaglebone/alarm.patch b/alarm/uboot-beaglebone/alarm.patch new file mode 100644 index 000000000..f686fb192 --- /dev/null +++ b/alarm/uboot-beaglebone/alarm.patch @@ -0,0 +1,161 @@ +diff -urN a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +--- a/include/configs/am335x_evm.h 2014-07-14 11:16:45.000000000 -0600 ++++ b/include/configs/am335x_evm.h 2014-08-10 12:31:08.383560239 -0600 +@@ -17,6 +17,7 @@ + #define __CONFIG_AM335X_EVM_H + + #include ++#define CONFIG_SUPPORT_RAW_INITRD + + #ifndef CONFIG_SPL_BUILD + # define CONFIG_FIT +@@ -74,6 +75,8 @@ + + #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + ++#define CONFIG_IDENT_STRING " Arch Linux ARM" ++ + #ifndef CONFIG_SPL_BUILD + #define CONFIG_EXTRA_ENV_SETTINGS \ + DEFAULT_LINUX_BOOT_ENV \ +@@ -81,15 +84,17 @@ + "bootpart=0:2\0" \ + "bootdir=/boot\0" \ + "bootfile=zImage\0" \ ++ "fdtdir=/boot/dtbs\0" \ + "fdtfile=undefined\0" \ ++ "rdfile=initramfs-linux.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" \ ++ "mmcroot=/dev/mmcblk0p2\0" \ ++ "mmcrootextra=rw fixrtc rootwait\0" \ + "rootpath=/export/rootfs\0" \ + "nfsopts=nolock\0" \ + "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \ +@@ -98,8 +103,7 @@ + "ramrootfstype=ext2\0" \ + "mmcargs=setenv bootargs console=${console} " \ + "${optargs} " \ +- "root=${mmcroot} " \ +- "rootfstype=${mmcrootfstype}\0" \ ++ "root=${mmcroot} ${mmcrootextra}\0" \ + "spiroot=/dev/mtdblock4 rw\0" \ + "spirootfstype=jffs2\0" \ + "spisrcaddr=0xe0000\0" \ +@@ -122,37 +126,43 @@ + "${optargs} " \ + "root=${ramroot} " \ + "rootfstype=${ramrootfstype}\0" \ +- "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ ++ "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}\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" \ ++ "loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ + "mmcboot=mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ ++ "gpio set 54;" \ + "echo SD/MMC found on device ${mmcdev};" \ + "if run loadbootenv; then " \ ++ "gpio set 55;" \ + "echo Loaded environment from ${bootenv};" \ + "run importbootenv;" \ + "fi;" \ ++ "if test -n $cape; then " \ ++ "if test -e mmc ${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 " \ ++ "gpio set 56; " \ + "echo Running uenvcmd ...;" \ + "run uenvcmd;" \ + "fi;" \ + "if run loadimage; then " \ +- "run mmcloados;" \ ++ "if run loadfdt; then " \ ++ "run mmcargs;" \ ++ "if run loadramdisk; then " \ ++ "bootz ${loadaddr} ${rdaddr} ${fdtaddr};" \ ++ "else " \ ++ "bootz ${loadaddr} - ${fdtaddr};" \ ++ "fi;" \ ++ "else " \ ++ "echo Kernel found, but no device tree found;" \ ++ "fi;" \ + "fi;" \ ++ "echo No kernel found;"\ + "fi;\0" \ + "spiboot=echo Booting from spi ...; " \ + "run spiargs; " \ +@@ -169,28 +179,44 @@ + "ramboot=echo Booting from ramdisk ...; " \ + "run ramargs; " \ + "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ +- "findfdt="\ ++ "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; fi; " \ + "if test $board_name = A33515BB; then " \ + "setenv fdtfile am335x-evm.dtb; fi; " \ + "if test $board_name = A335X_SK; then " \ + "setenv fdtfile am335x-evmsk.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" \ ++ "findmmc=" \ ++ "if test $board_name = A335BNLT; then " \ ++ "setenv mmc1 1;" \ ++ "mmc dev 0;" \ ++ "if mmc rescan; then " \ ++ "setenv mmc0 1;" \ ++ "else " \ ++ "setenv mmc0 0;" \ ++ "fi;" \ ++ "fi;\0" \ + NANDARGS \ + DFUARGS + #endif + + #define CONFIG_BOOTCOMMAND \ ++ "gpio set 53; " \ ++ "i2c mw 0x24 1 0x3e; " \ ++ "run findmmc; " \ + "run findfdt; " \ + "run mmcboot;" \ ++ "gpio clear 56; " \ ++ "gpio clear 55; " \ ++ "gpio clear 54; " \ + "setenv mmcdev 1; " \ + "setenv bootpart 1:2; " \ +- "run mmcboot;" \ +- "run nandboot;" ++ "if test $mmc0 = 1; then setenv mmcroot /dev/mmcblk1p2; fi; " \ ++ "run mmcboot;" + + /* NS16550 Configuration */ + #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ diff --git a/alarm/uboot-beaglebone/uEnv.txt b/alarm/uboot-beaglebone/uEnv.txt index beec02111..f432efc6b 100644 --- a/alarm/uboot-beaglebone/uEnv.txt +++ b/alarm/uboot-beaglebone/uEnv.txt @@ -1,7 +1 @@ -uenvcmd=run findmmc1; run findmmc0; if run loaduimage; then run loadfdt; run mmcboot; fi; -findmmc1=if test $board_name = A335BNLT; then setenv mmc1 1; else setenv mmc1 0; fi -findmmc0=setenv mmcdev 0; mmc dev ${mmcdev}; if mmc rescan; then setenv mmc0 1; else setenv mmc0 0; fi -mmcroot=/dev/mmcblk0p2 rw -loadfdt=ext4load mmc ${mmcdev}:2 ${fdtaddr} /boot/dtbs/${fdtfile} -loaduimage=if ext4load mmc 0:2 ${loadaddr} /boot/zImage; then setenv mmcdev 0; else setenv mmcdev 1; if test $mmc0 = 1; then setenv mmcroot /dev/mmcblk1p2 rw; fi; ext4load mmc 1:2 ${loadaddr} /boot/zImage; fi optargs=coherent_pool=1M