alarm/uboot-olinuxino to 2015.04-1

This commit is contained in:
Kevin Mihelich 2015-06-09 02:05:46 +00:00
parent 8e6476ebd9
commit c9c8a45a83
4 changed files with 184 additions and 157 deletions

View file

@ -0,0 +1,177 @@
From 303685d289f55de059290a7b2a60416523bcbe58 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Mon, 8 Jun 2015 19:18:43 -0600
Subject: [PATCH] arch linux arm modifications
Signed-off-by: Kevin Mihelich <kevin@archlinuxarm.org>
---
include/configs/mx23_olinuxino.h | 134 ++++++++++++++++++---------------------
1 file changed, 60 insertions(+), 74 deletions(-)
diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
index e377fea..16ae29a 100644
--- a/include/configs/mx23_olinuxino.h
+++ b/include/configs/mx23_olinuxino.h
@@ -26,6 +26,17 @@
#define CONFIG_CMD_NET
#define CONFIG_CMD_USB
+/* Arch Linux ARM extras */
+#define CONFIG_IDENT_STRING " Arch Linux ARM"
+#define CONFIG_CMD_SETEXPR
+#define CONFIG_CMD_PART
+#define CONFIG_PARTITION_UUIDS
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FS_GENERIC
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
+
/* Memory configuration */
#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
#define PHYS_SDRAM_1 0x40000000 /* Base address */
@@ -66,92 +77,67 @@
#endif
/* Booting Linux */
-#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTDELAY 1
#define CONFIG_BOOTFILE "uImage"
#define CONFIG_LOADADDR 0x42000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
/* Extra Environment */
#define CONFIG_EXTRA_ENV_SETTINGS \
- "update_sd_firmware_filename=u-boot.sd\0" \
- "update_sd_firmware=" /* Update the SD firmware partition */ \
- "if mmc rescan ; then " \
- "if tftp ${update_sd_firmware_filename} ; then " \
- "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
- "setexpr fw_sz ${fw_sz} + 1 ; " \
- "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
- "fi ; " \
- "fi\0" \
- "script=boot.scr\0" \
- "uimage=uImage\0" \
"console=ttyAMA0\0" \
- "fdt_file=imx23-olinuxino.dtb\0" \
- "fdt_addr=0x41000000\0" \
- "boot_fdt=try\0" \
- "ip_dyn=yes\0" \
- "mmcdev=0\0" \
- "mmcpart=2\0" \
- "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
+ "fdtfile=imx23-olinuxino.dtb\0" \
+ "fdtaddr=0x41000000\0" \
+ "rdfile=initramfs-linux.img\0" \
+ "rdaddr=0x42A00000\0" \
+ "bootdir=/boot\0" \
+ "fdtdir=/boot/dtbs\0" \
+ "bootfile=zImage\0" \
+ "optargs=\0" \
+ "cmdline=\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=${mmcroot}\0" \
- "loadbootscript=" \
- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
- "bootscript=echo Running bootscript from mmc ...; " \
- "source\0" \
- "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
- "mmcboot=echo Booting from mmc ...; " \
- "run mmcargs; " \
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if run loadfdt; then " \
- "bootm ${loadaddr} - ${fdt_addr}; " \
- "else " \
- "if test ${boot_fdt} = try; then " \
- "bootm; " \
- "else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi; " \
- "else " \
- "bootm; " \
- "fi;\0" \
- "netargs=setenv bootargs console=${console},${baudrate} " \
- "root=/dev/nfs " \
- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
- "netboot=echo Booting from net ...; " \
- "usb start; " \
- "run netargs; " \
- "if test ${ip_dyn} = yes; then " \
- "setenv get_cmd dhcp; " \
- "else " \
- "setenv get_cmd tftp; " \
- "fi; " \
- "${get_cmd} ${uimage}; " \
- "if test ${boot_fdt} = yes; then " \
- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
- "bootm ${loadaddr} - ${fdt_addr}; " \
- "else " \
- "if test ${boot_fdt} = try; then " \
- "bootm; " \
+ "${optargs} " \
+ "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 " \
+ "setenv devnum 0;" \
+ "while ${devtype} dev ${devnum}; do " \
+ "echo ${devtype} found on device ${devnum};" \
+ "if test ${devtype} = mmc; then setenv bootpart ${devnum}:2; else setenv bootpart ${devnum}:1; fi;" \
+ "part uuid ${devtype} ${bootpart} uuid;" \
+ "setenv root PARTUUID=${uuid} rw rootwait fixrtc;" \
+ "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 WARN: Cannot load the DT; " \
+ "echo No kernel found;" \
"fi;" \
- "fi; " \
- "else " \
- "bootm; " \
- "fi;\0"
+ "setexpr devnum ${devnum} + 1;" \
+ "done;" \
+ "done;\0"
#define CONFIG_BOOTCOMMAND \
- "mmc dev ${mmcdev}; if mmc rescan; then " \
- "if run loadbootscript; then " \
- "run bootscript; " \
- "else " \
- "if run loaduimage; then " \
- "run mmcboot; " \
- "else run netboot; " \
- "fi; " \
- "fi; " \
- "else run netboot; fi"
+ "run mmcboot;"
/* The rest of the configuration is shared */
#include <configs/mxs.h>
--
2.4.2

View file

@ -6,23 +6,23 @@ buildarch=2
pkgname=uboot-olinuxino
pkgdesc="U-Boot for i.MX233-OLinuXino"
pkgver=2014.07
pkgver=2015.04
pkgrel=1
arch=('arm')
license=('GPL')
#makedepends=('elftosb')
makedepends=('git' 'bc')
install=$pkgname.install
options=('!strip')
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
'alarm.patch'
'0001-arch-linux-arm-modifications.patch'
'uEnv.txt')
md5sums=('36d4bad687edcafa396fee607e505d4e'
'a6a377a08f24dd21156e38e034f6f714'
'239b6223bbfe21e0cad629723a3abc2d')
md5sums=('570bdc2c47270c2a98ca60ff6c5c74cd'
'b68e3fdda72067a403edd7a9c9e9421f'
'd41d8cd98f00b204e9800998ecf8427e')
prepare() {
cd "$srcdir/u-boot-${pkgver}"
patch -Np1 -i ../alarm.patch
git apply ../0001-arch-linux-arm-modifications.patch
}
build() {

View file

@ -1,144 +0,0 @@
diff -urN a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
--- a/include/configs/mx23_olinuxino.h 2014-07-14 11:16:45.000000000 -0600
+++ b/include/configs/mx23_olinuxino.h 2014-08-17 13:06:15.551391904 -0600
@@ -26,6 +26,14 @@
#define CONFIG_CMD_NET
#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FS_GENERIC
+
+/* bootz: zImage/initrd.img support */
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
+
/* Memory configuration */
#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
#define PHYS_SDRAM_1 0x40000000 /* Base address */
@@ -66,54 +74,72 @@
#endif
/* Booting Linux */
-#define CONFIG_BOOTDELAY 3
-#define CONFIG_BOOTFILE "uImage"
+#define CONFIG_BOOTDELAY 1
#define CONFIG_LOADADDR 0x42000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_IDENT_STRING " Arch Linux ARM"
+
/* Extra Environment */
#define CONFIG_EXTRA_ENV_SETTINGS \
- "update_sd_firmware_filename=u-boot.sd\0" \
- "update_sd_firmware=" /* Update the SD firmware partition */ \
- "if mmc rescan ; then " \
- "if tftp ${update_sd_firmware_filename} ; then " \
- "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
- "setexpr fw_sz ${fw_sz} + 1 ; " \
- "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
- "fi ; " \
- "fi\0" \
- "script=boot.scr\0" \
- "uimage=uImage\0" \
"console=ttyAMA0\0" \
"fdt_file=imx23-olinuxino.dtb\0" \
"fdt_addr=0x41000000\0" \
- "boot_fdt=try\0" \
+ "fdtdir=/boot/dtbs\0" \
+ "bootfile=zImage\0" \
+ "bootdir=/boot\0" \
+ "rdaddr=0x42800000\0" \
+ "rdfile=initramfs-linux.img\0" \
"ip_dyn=yes\0" \
+ "optargs=\0" \
+ "video=\0" \
"mmcdev=0\0" \
- "mmcpart=2\0" \
- "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
+ "mmcroot=/dev/mmcblk0p2 rw ext4 rootwait fixrtc\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=${mmcroot}\0" \
- "loadbootscript=" \
- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
- "bootscript=echo Running bootscript from mmc ...; " \
- "source\0" \
- "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
- "mmcboot=echo Booting from mmc ...; " \
- "run mmcargs; " \
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if run loadfdt; then " \
- "bootm ${loadaddr} - ${fdt_addr}; " \
+ "${optargs} " \
+ "root=${mmcroot} " \
+ "video=${video}\0" \
+ "loadbootenv=load mmc ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt\0" \
+ "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
+ "env import -t ${loadaddr} ${filesize}\0" \
+ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+ "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}\0" \
+ "loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/uImage\0" \
+ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \
+ "mmcboot=mmc dev ${mmcdev}; " \
+ "if mmc rescan; then " \
+ "echo SD/MMC found on device ${mmcdev};" \
+ "setenv bootpart ${mmcdev}:2; " \
+ "echo Checking for: ${bootdir}/uEnv.txt ...;" \
+ "if test -e mmc ${bootpart} ${bootdir}/uEnv.txt; then " \
+ "load mmc ${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 " \
+ "if run loadfdt; then " \
+ "run mmcargs;" \
+ "if run loadrd; then " \
+ "bootz ${loadaddr} ${rdaddr}:${filesize} ${fdt_addr};" \
+ "else " \
+ "bootz ${loadaddr} - ${fdt_addr};" \
+ "fi;" \
+ "else " \
+ "echo Kernel found, but no device tree found;" \
+ "fi;" \
"else " \
- "if test ${boot_fdt} = try; then " \
- "bootm; " \
+ "if run loaduimage; then " \
+ "run mmcargs;" \
+ "bootm;" \
"else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi; " \
- "else " \
- "bootm; " \
+ "echo No kernel found;" \
+ "fi;" \
+ "fi;" \
"fi;\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs " \
@@ -142,16 +168,7 @@
"fi;\0"
#define CONFIG_BOOTCOMMAND \
- "mmc dev ${mmcdev}; if mmc rescan; then " \
- "if run loadbootscript; then " \
- "run bootscript; " \
- "else " \
- "if run loaduimage; then " \
- "run mmcboot; " \
- "else run netboot; " \
- "fi; " \
- "fi; " \
- "else run netboot; fi"
+ "run mmcboot;"
/* The rest of the configuration is shared */
#include <configs/mxs.h>

View file

@ -1,6 +0,0 @@
#These are the default settings for some useful u-boot variables:
#fdt_file=imx23-olinuxino.dtb
#optargs=
#video=
#mmcroot=/dev/mmcblk0p2 rw rootwait fixrtc