summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Gilmore <dennis@ausil.us>2014-02-06 09:26:14 -0600
committerDennis Gilmore <dennis@ausil.us>2014-02-06 09:26:14 -0600
commite55ef91f9d1655fce9ac0cb7b5417d258843c09c (patch)
tree90da2a1ef699b0ce312324d3310f176406b09e8c
parent3025850075fa6e4b0b09f25fbc6bc63495825401 (diff)
downloaduboot-tools-e55ef91f9d1655fce9ac0cb7b5417d258843c09c.tar.gz
uboot-tools-e55ef91f9d1655fce9ac0cb7b5417d258843c09c.tar.xz
uboot-tools-e55ef91f9d1655fce9ac0cb7b5417d258843c09c.zip
fix ftbfs for wandboard
- use _smp_mflags
-rw-r--r--0001-add-distro-default-commands-and-config-options.patch70
-rw-r--r--0001-pxe-support-devicetree-tag.patch32
-rw-r--r--0002-add-option-to-include-generic-distro-config.patch28
-rw-r--r--0002-pxe-implement-fdtdir-extlinux.conf-tag.patch176
-rw-r--r--0003-cmd_pxe.c-add-any-option-for-filesystem-with-sysboot.patch66
-rw-r--r--0003-set-omap4-boards-to-use-the-generic-distro-support.patch41
-rw-r--r--0004-config-add-config_distro_defaults.h.patch79
-rw-r--r--0004-set-wandboard-to-use-generic-commands-and-set-needed.patch38
-rw-r--r--0005-fs-fix-generic-save-command-implementation.patch90
-rw-r--r--0005-set-the-default-wandboard-boot-commands.patch48
-rw-r--r--0006-ARM-tegra-convert-tegra-to-use-distro-defaults.patch81
-rw-r--r--0006-set-omap4-to-use-extlinux.conf-by-default.patch63
-rw-r--r--0007-fs-implement-infra-structure-for-an-exists-function.patch182
-rw-r--r--0007-remove-CONFIG_MENU_SHOW-from-distro-config.patch24
-rw-r--r--0008-ARM-tegra-rework-boot-scripts.patch77
-rw-r--r--0008-disable-FIT-image-support-since-it-fails-to-build.patch24
-rw-r--r--0009-add-defualt-DHCP-config-options.patch30
-rw-r--r--0009-sandbox-implement-fs_exists-and-sb-exists-shell-func.patch90
-rw-r--r--0010-ARM-tegra-implement-bootcmd_pxe.patch129
-rw-r--r--0010-remove-USB-from-distro-default-not-all-systems-suppo.patch32
-rw-r--r--0011-Setup-beagleboard-to-used-generic-distro-configs.patch57
-rw-r--r--0011-ext4-implement-exists-for-ext4fs.patch63
-rw-r--r--0012-fat-implement-exists-for-FAT-fs.patch97
-rw-r--r--0012-setup-beagleboard-to-load-extlinux.conf.patch47
-rw-r--r--0013-Modify-wandboard-to-include-the-distro-defaults-head.patch287
-rw-r--r--0013-setup-distro-common-variables-on-beaglebones.patch74
-rw-r--r--0014-Use-SPDX-header-in-distro-config.patch27
-rw-r--r--0015-WANDBOARD-adjust-addrs-to-work-with-calculated-value.patch47
-rw-r--r--0016-WANDBOARD-use-ext2load-to-load-dtbs.patch65
-rw-r--r--sources2
-rw-r--r--uboot-tools.spec77
31 files changed, 1505 insertions, 738 deletions
diff --git a/0001-add-distro-default-commands-and-config-options.patch b/0001-add-distro-default-commands-and-config-options.patch
deleted file mode 100644
index 2dc8605..0000000
--- a/0001-add-distro-default-commands-and-config-options.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 9172c5926e6875a59a8d1cc82d30b2118ab7308b Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Wed, 7 Aug 2013 23:00:42 -0500
-Subject: [PATCH 01/16] add distro default commands and config options
-
----
- include/config_distro_default.h | 51 +++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 51 insertions(+)
- create mode 100644 include/config_distro_default.h
-
-diff --git a/include/config_distro_default.h b/include/config_distro_default.h
-new file mode 100644
-index 0000000..b892868
---- /dev/null
-+++ b/include/config_distro_default.h
-@@ -0,0 +1,51 @@
-+/*
-+ * Copyright 2013 Red Hat, Inc.
-+ *
-+ * This file is licensed under the terms of the GNU General Public
-+ * License Version 2. This file is licensed "as is" without any
-+ * warranty of any kind, whether express or implied.
-+ */
-+
-+#ifndef _CONFIG_CMD_DISTRO_DEFAULT_H
-+#define _CONFIG_CMD_DISTRO_DEFAULT_H
-+
-+/*
-+ * List of all commands and options that when defined enables support for features
-+ * required by distros to support boards in a standardised and consitant manner.
-+ */
-+
-+
-+#define CONFIG_BOOTP_PXE
-+
-+#if defined(__arm__)
-+#define CONFIG_BOOTP_PXE_CLIENTARCH 0x100
-+#define CONFIG_BOOTP_VCI_STRING "U-boot.armv7"
-+#endif
-+
-+#define CONFIG_OF_LIBFDT
-+
-+#define CONFIG_CMD_BOOTZ
-+#define CONFIG_CMD_DHCP
-+#define CONFIG_CMD_ELF
-+#define CONFIG_CMD_EXT2
-+#define CONFIG_CMD_FAT
-+#define CONFIG_CMD_MII
-+#define CONFIG_CMD_NET
-+#define CONFIG_CMD_PING
-+#define CONFIG_CMD_PXE
-+#define CONFIG_CMD_USB
-+
-+#define CONFIG_CMDLINE_EDITING
-+#define CONFIG_AUTO_COMPLETE
-+#define CONFIG_BOOTDELAY 2
-+#define CONFIG_SYS_LONGHELP
-+#define CONFIG_FIT
-+#define CONFIG_MENU
-+#define CONFIG_MENU_SHOW
-+#define CONFIG_DOS_PARTITION
-+#define CONFIG_EFI_PARTITION
-+#define CONFIG_SUPPORT_RAW_INITRD
-+#define CONFIG_SYS_HUSH_PARSER
-+#define CONFIG_USB_STORAGE
-+
-+#endif /* _CONFIG_CMD_DISTRO_DEFAULT_H */
---
-1.8.3.1
-
diff --git a/0001-pxe-support-devicetree-tag.patch b/0001-pxe-support-devicetree-tag.patch
new file mode 100644
index 0000000..e97f7c1
--- /dev/null
+++ b/0001-pxe-support-devicetree-tag.patch
@@ -0,0 +1,32 @@
+From 81df03e590a2fbf79d363910ae4edc581e09104e Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Tue, 28 Jan 2014 21:50:09 -0700
+Subject: [PATCH 01/13] pxe: support "devicetree" tag
+
+pxe: support "devicetree" tag
+
+The specification for extlinux.conf[1] states that "fdt" is an alias for
+"devicetree". To date, U-Boot only implements "fdt". Rectify that.
+
+[1] http://freedesktop.org/wiki/Specifications/BootLoaderSpec/
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+---
+ common/cmd_pxe.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
+index c27ec35..4f00b1a 100644
+--- a/common/cmd_pxe.c
++++ b/common/cmd_pxe.c
+@@ -745,6 +745,7 @@ static const struct token keywords[] = {
+ {"append", T_APPEND},
+ {"initrd", T_INITRD},
+ {"include", T_INCLUDE},
++ {"devicetree", T_FDT},
+ {"fdt", T_FDT},
+ {"ontimeout", T_ONTIMEOUT,},
+ {"ipappend", T_IPAPPEND,},
+--
+1.8.5.3
+
diff --git a/0002-add-option-to-include-generic-distro-config.patch b/0002-add-option-to-include-generic-distro-config.patch
deleted file mode 100644
index 62388f7..0000000
--- a/0002-add-option-to-include-generic-distro-config.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3c3c10fad1f61f8ad01414c868080e0e1bb5fc91 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Sun, 1 Sep 2013 21:42:48 -0500
-Subject: [PATCH 02/16] add option to include generic distro config
-
----
- include/common.h | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/include/common.h b/include/common.h
-index 409515f..b97a52d 100644
---- a/include/common.h
-+++ b/include/common.h
-@@ -99,6 +99,11 @@ typedef volatile unsigned char vu_char;
- #include <flash.h>
- #include <image.h>
-
-+/* use generic distro config */
-+#ifdef DISTRO_DEFAULTS
-+#include <config_distro_default.h>
-+#endif
-+
- #ifdef DEBUG
- #define _DEBUG 1
- #else
---
-1.8.3.1
-
diff --git a/0002-pxe-implement-fdtdir-extlinux.conf-tag.patch b/0002-pxe-implement-fdtdir-extlinux.conf-tag.patch
new file mode 100644
index 0000000..c81446f
--- /dev/null
+++ b/0002-pxe-implement-fdtdir-extlinux.conf-tag.patch
@@ -0,0 +1,176 @@
+From 13b5a55b02e80735288d90f3d098b08fe8f10a10 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Tue, 28 Jan 2014 21:50:10 -0700
+Subject: [PATCH 02/13] pxe: implement fdtdir extlinux.conf tag
+
+pxe: implement fdtdir extlinux.conf tag
+
+People who write (or scripts that auto-generate) extlinux.conf don't
+want to know about HW-specific information such as FDT filenames. Create
+a new extlinux.conf tag "fdtdir" that specifies only the directory where
+FDT files are located, and defer all knowledge of the filename to U-Boot.
+The algorithm implemented is:
+
+==========
+if $fdt_addr_r is set:
+ if "fdt" tag was specified in extlinux.conf:
+ load the FDT from the filename in the tag
+ else if "fdtdir" tag was specified in extlinux.conf:
+ if "fdtfile" is set in the environment:
+ load the FDT from filename in "$fdtfile"
+ else:
+ load the FDT from some automatically generated filename
+
+if no FDT file was loaded, and $fdtaddr is set:
+ # This indicates an FDT packaged with firmware
+ use the FDT at $fdtaddr
+==========
+
+A small part of an example /boot/extlinux.conf might be:
+
+==========
+LABEL primary
+ LINUX zImage
+ FDTDIR ./
+
+LABEL failsafe
+ LINUX bkp/zImage
+ FDTDIR bkp/
+==========
+
+... with /boot/tegra20-seaboard.dtb or /boot/bkp/tegra20-seaboard.dtb
+being loaded by the sysboot/pxe code.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+---
+ common/cmd_pxe.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 72 insertions(+), 6 deletions(-)
+
+diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
+index 4f00b1a..2bd572d 100644
+--- a/common/cmd_pxe.c
++++ b/common/cmd_pxe.c
+@@ -445,6 +445,7 @@ struct pxe_label {
+ char *append;
+ char *initrd;
+ char *fdt;
++ char *fdtdir;
+ int ipappend;
+ int attempted;
+ int localboot;
+@@ -517,6 +518,9 @@ static void label_destroy(struct pxe_label *label)
+ if (label->fdt)
+ free(label->fdt);
+
++ if (label->fdtdir)
++ free(label->fdtdir);
++
+ free(label);
+ }
+
+@@ -675,13 +679,67 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
+ bootm_argv[3] = getenv("fdt_addr_r");
+
+ /* if fdt label is defined then get fdt from server */
+- if (bootm_argv[3] && label->fdt) {
+- if (get_relfile_envaddr(cmdtp, label->fdt, "fdt_addr_r") < 0) {
+- printf("Skipping %s for failure retrieving fdt\n",
+- label->name);
+- return 1;
++ if (bootm_argv[3]) {
++ char *fdtfile = NULL;
++ char *fdtfilefree = NULL;
++
++ if (label->fdt) {
++ fdtfile = label->fdt;
++ } else if (label->fdtdir) {
++ fdtfile = getenv("fdtfile");
++ /*
++ * For complex cases, it might be worth calling a
++ * board- or SoC-provided function here to provide a
++ * better default:
++ *
++ * if (!fdtfile)
++ * fdtfile = gen_fdtfile();
++ *
++ * If this is added, be sure to keep the default below,
++ * or move it to the default weak implementation of
++ * gen_fdtfile().
++ */
++ if (!fdtfile) {
++ char *soc = getenv("soc");
++ char *board = getenv("board");
++ char *slash;
++
++ len = strlen(label->fdtdir);
++ if (!len)
++ slash = "./";
++ else if (label->fdtdir[len - 1] != '/')
++ slash = "/";
++ else
++ slash = "";
++
++ len = strlen(label->fdtdir) + strlen(slash) +
++ strlen(soc) + 1 + strlen(board) + 5;
++ fdtfilefree = malloc(len);
++ if (!fdtfilefree) {
++ printf("malloc fail (FDT filename)\n");
++ return 1;
++ }
++
++ snprintf(fdtfilefree, len, "%s%s%s-%s.dtb",
++ label->fdtdir, slash, soc, board);
++ fdtfile = fdtfilefree;
++ }
+ }
+- } else
++
++ if (fdtfile) {
++ int err = get_relfile_envaddr(cmdtp, fdtfile, "fdt_addr_r");
++ free(fdtfilefree);
++ if (err < 0) {
++ printf("Skipping %s for failure retrieving fdt\n",
++ label->name);
++ return 1;
++ }
++ } else {
++ bootm_argv[3] = NULL;
++ }
++ }
++
++ if (!bootm_argv[3])
+ bootm_argv[3] = getenv("fdt_addr");
+
+ if (bootm_argv[3])
+@@ -716,6 +774,7 @@ enum token_type {
+ T_PROMPT,
+ T_INCLUDE,
+ T_FDT,
++ T_FDTDIR,
+ T_ONTIMEOUT,
+ T_IPAPPEND,
+ T_INVALID
+@@ -747,6 +806,8 @@ static const struct token keywords[] = {
+ {"include", T_INCLUDE},
+ {"devicetree", T_FDT},
+ {"fdt", T_FDT},
++ {"devicetreedir", T_FDTDIR},
++ {"fdtdir", T_FDTDIR},
+ {"ontimeout", T_ONTIMEOUT,},
+ {"ipappend", T_IPAPPEND,},
+ {NULL, T_INVALID}
+@@ -1135,6 +1196,11 @@ static int parse_label(char **c, struct pxe_menu *cfg)
+ err = parse_sliteral(c, &label->fdt);
+ break;
+
++ case T_FDTDIR:
++ if (!label->fdtdir)
++ err = parse_sliteral(c, &label->fdtdir);
++ break;
++
+ case T_LOCALBOOT:
+ label->localboot = 1;
+ err = parse_integer(c, &label->localboot_val);
+--
+1.8.5.3
+
diff --git a/0003-cmd_pxe.c-add-any-option-for-filesystem-with-sysboot.patch b/0003-cmd_pxe.c-add-any-option-for-filesystem-with-sysboot.patch
new file mode 100644
index 0000000..7c461b8
--- /dev/null
+++ b/0003-cmd_pxe.c-add-any-option-for-filesystem-with-sysboot.patch
@@ -0,0 +1,66 @@
+From 75a1606b62bce11e2dc981357da4d7f7a6402971 Mon Sep 17 00:00:00 2001
+From: Dennis Gilmore <dennis@ausil.us>
+Date: Tue, 4 Feb 2014 05:25:46 -0600
+Subject: [PATCH 03/13] cmd_pxe.c add any option for filesystem with sysboot
+ uses generic load
+
+Signed-off-by: Dennis Gilmore <dennis@ausil.us>
+---
+ common/cmd_pxe.c | 22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
+index 2bd572d..29e48db 100644
+--- a/common/cmd_pxe.c
++++ b/common/cmd_pxe.c
+@@ -11,6 +11,7 @@
+ #include <linux/ctype.h>
+ #include <errno.h>
+ #include <linux/list.h>
++#include <fs.h>
+
+ #include "menu.h"
+
+@@ -160,6 +161,19 @@ static int do_get_fat(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+ return -ENOENT;
+ }
+
++static int do_get_any(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
++{
++#ifdef CONFIG_CMD_FS_GENERIC
++ fs_argv[0] = "load";
++ fs_argv[3] = file_addr;
++ fs_argv[4] = (void *)file_path;
++
++ if (!do_load(cmdtp, 0, 5, fs_argv, FS_TYPE_ANY))
++ return 1;
++#endif
++ return -ENOENT;
++}
++
+ /*
+ * As in pxelinux, paths to files referenced from files we retrieve are
+ * relative to the location of bootfile. get_relfile takes such a path and
+@@ -1606,6 +1620,8 @@ int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+ do_getfile = do_get_ext2;
+ else if (strstr(argv[3], "fat"))
+ do_getfile = do_get_fat;
++ else if (strstr(argv[3], "any"))
++ do_getfile = do_get_any;
+ else {
+ printf("Invalid filesystem: %s\n", argv[3]);
+ return 1;
+@@ -1643,7 +1659,7 @@ int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+ U_BOOT_CMD(
+ sysboot, 7, 1, do_sysboot,
+ "command to get and boot from syslinux files",
+- "[-p] <interface> <dev[:part]> <ext2|fat> [addr] [filename]\n"
+- " - load and parse syslinux menu file 'filename' from ext2 or fat\n"
+- " filesystem on 'dev' on 'interface' to address 'addr'"
++ "[-p] <interface> <dev[:part]> <ext2|fat|any> [addr] [filename]\n"
++ " - load and parse syslinux menu file 'filename' from ext2, fat\n"
++ " or any filesystem on 'dev' on 'interface' to address 'addr'"
+ );
+--
+1.8.5.3
+
diff --git a/0003-set-omap4-boards-to-use-the-generic-distro-support.patch b/0003-set-omap4-boards-to-use-the-generic-distro-support.patch
deleted file mode 100644
index ea03238..0000000
--- a/0003-set-omap4-boards-to-use-the-generic-distro-support.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From f12653a82d5417114fb422ae3e3883b96ec31ea5 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 11:26:39 -0500
-Subject: [PATCH 03/16] set omap4 boards to use the generic distro support
-
----
- include/configs/omap4_common.h | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
-index e9f2383..634668a 100644
---- a/include/configs/omap4_common.h
-+++ b/include/configs/omap4_common.h
-@@ -106,6 +106,9 @@
- /* commands to include */
- #include <config_cmd_default.h>
-
-+/* enable generic distro config */
-+#define DISTRO_DEFAULTS 1
-+
- /* Enabled commands */
- #define CONFIG_CMD_EXT2 /* EXT2 Support */
- #define CONFIG_CMD_FAT /* FAT support */
-@@ -132,9 +135,13 @@
-
- #define CONFIG_EXTRA_ENV_SETTINGS \
- "loadaddr=0x82000000\0" \
-+ "pxefile_addr_r=0x82000000\0" \
-+ "kernel_addr_r=0x84000000\0" \
-+ "ramdisk_addr_r=0x90000000\0" \
-+ "fdt_addr_r=0x83000000\0" \
- "console=ttyO2,115200n8\0" \
- "fdt_high=0xffffffff\0" \
-- "fdtaddr=0x80f80000\0" \
-+ "fdt_addr=0x80f80000\0" \
- "fdtfile=undefined\0" \
- "bootpart=0:2\0" \
- "bootdir=/boot\0" \
---
-1.8.3.1
-
diff --git a/0004-config-add-config_distro_defaults.h.patch b/0004-config-add-config_distro_defaults.h.patch
new file mode 100644
index 0000000..aba92bc
--- /dev/null
+++ b/0004-config-add-config_distro_defaults.h.patch
@@ -0,0 +1,79 @@
+From c333caf386b3f253402ca9471f93db0171f13fb9 Mon Sep 17 00:00:00 2001
+From: Dennis Gilmore <dennis@ausil.us>
+Date: Tue, 4 Feb 2014 05:25:47 -0600
+Subject: [PATCH 04/13] config: add config_distro_defaults.h
+
+describe a set of default features that distros can rely on being available.
+having this common definition means that distros can easily support systems
+implementing them.
+
+Signed-off-by: Dennis Gilmore <dennis@ausil.us>
+---
+ include/config_distro_defaults.h | 55 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 include/config_distro_defaults.h
+
+diff --git a/include/config_distro_defaults.h b/include/config_distro_defaults.h
+new file mode 100644
+index 0000000..11b5b79
+--- /dev/null
++++ b/include/config_distro_defaults.h
+@@ -0,0 +1,55 @@
++/*
++ * Copyright 2013-2014 Red Hat, Inc.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _CONFIG_CMD_DISTRO_DEFAULTS_H
++#define _CONFIG_CMD_DISTRO_DEFAULTS_H
++
++/*
++ * List of all commands and options that when defined enables support for features
++ * required by distros to support boards in a standardised and consitant manner.
++ */
++
++#define CONFIG_BOOTP_BOOTPATH
++#define CONFIG_BOOTP_DNS
++#define CONFIG_BOOTP_GATEWAY
++#define CONFIG_BOOTP_HOSTNAME
++#define CONFIG_BOOTP_PXE
++#define CONFIG_BOOTP_SUBNETMASK
++
++#if defined(__arm__)
++#define CONFIG_BOOTP_PXE_CLIENTARCH 0x100
++#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
++#define CONFIG_BOOTP_VCI_STRING "U-boot.armv7"
++#else
++#define CONFIG_BOOTP_VCI_STRING "U-boot.arm"
++#endif
++#endif
++
++#define CONFIG_OF_LIBFDT
++
++#define CONFIG_CMD_BOOTZ
++#define CONFIG_CMD_DHCP
++#define CONFIG_CMD_ELF
++#define CONFIG_CMD_EXT2
++#define CONFIG_CMD_EXT4
++#define CONFIG_CMD_FAT
++#define CONFIG_CMD_FS_GENERIC
++#define CONFIG_CMD_MII
++#define CONFIG_CMD_NET
++#define CONFIG_CMD_PING
++#define CONFIG_CMD_PXE
++
++#define CONFIG_CMDLINE_EDITING
++#define CONFIG_AUTO_COMPLETE
++#define CONFIG_BOOTDELAY 2
++#define CONFIG_SYS_LONGHELP
++#define CONFIG_MENU
++#define CONFIG_DOS_PARTITION
++#define CONFIG_EFI_PARTITION
++#define CONFIG_SUPPORT_RAW_INITRD
++#define CONFIG_SYS_HUSH_PARSER
++
++#endif /* _CONFIG_CMD_DISTRO_DEFAULTS_H */
+--
+1.8.5.3
+
diff --git a/0004-set-wandboard-to-use-generic-commands-and-set-needed.patch b/0004-set-wandboard-to-use-generic-commands-and-set-needed.patch
deleted file mode 100644
index 3feaa48..0000000
--- a/0004-set-wandboard-to-use-generic-commands-and-set-needed.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 4fe19544ffda98c8ab9eea55d29f8c9179716e88 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 11:33:46 -0500
-Subject: [PATCH 04/16] set wandboard to use generic commands and set needed
- variables
-
----
- include/configs/wandboard.h | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
-index 442a984..423d94e 100644
---- a/include/configs/wandboard.h
-+++ b/include/configs/wandboard.h
-@@ -40,6 +40,9 @@
- #define CONFIG_CONS_INDEX 1
- #define CONFIG_BAUDRATE 115200
-
-+/* enable generic distro config */
-+#define DISTRO_DEFAULTS 1
-+
- /* Command definition */
- #include <config_cmd_default.h>
-
-@@ -114,6 +117,10 @@
- "initrd_high=0xffffffff\0" \
- "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
- "fdt_addr=0x11000000\0" \
-+ "pxefile_addr_r=0x13000000\0" \
-+ "kernel_addr_r=0x14000000\0" \
-+ "ramdisk_addr_r=0x32000000\0" \
-+ "fdt_addr_r=0x12000000\0" \
- "boot_fdt=try\0" \
- "ip_dyn=yes\0" \
- "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
---
-1.8.3.1
-
diff --git a/0005-fs-fix-generic-save-command-implementation.patch b/0005-fs-fix-generic-save-command-implementation.patch
new file mode 100644
index 0000000..a145969
--- /dev/null
+++ b/0005-fs-fix-generic-save-command-implementation.patch
@@ -0,0 +1,90 @@
+From df7441a7de1a5702c4deed9195c24c8803b7508c Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 12:56:56 -0700
+Subject: [PATCH 05/13] fs: fix generic save command implementation
+
+Fix a few issues with the generic "save" shell command, and fs_write()
+function.
+
+1) fstypes[].write wasn't filled in for some file-systems, and isn't
+ checked when used, which could cause crashes/... if executing save
+ on e.g. fat/ext filesystems.
+
+2) fs_write() requires the length argument to be non-zero, since it needs
+ to know exactly how many bytes to write. Adjust the comments and code
+ according to this.
+
+3) fs_write() wasn't prototyped in <fs.h> like other generic functions;
+ other code should be able to call this directly rather than invoking
+ the "save" shell command.
+
+Cc: Simon Glass <sjg@chromium.org>
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+Acked-by: Simon Glass <sjg@chromium.org>
+---
+ fs/fs.c | 9 +++------
+ include/fs.h | 10 ++++++++++
+ 2 files changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/fs/fs.c b/fs/fs.c
+index be1855d..9c2ef6b 100644
+--- a/fs/fs.c
++++ b/fs/fs.c
+@@ -75,6 +75,7 @@ static struct fstype_info fstypes[] = {
+ .close = fat_close,
+ .ls = file_fat_ls,
+ .read = fat_read_file,
++ .write = fs_write_unsupported,
+ },
+ #endif
+ #ifdef CONFIG_FS_EXT4
+@@ -84,6 +85,7 @@ static struct fstype_info fstypes[] = {
+ .close = ext4fs_close,
+ .ls = ext4fs_ls,
+ .read = ext4_read_file,
++ .write = fs_write_unsupported,
+ },
+ #endif
+ #ifdef CONFIG_SANDBOX
+@@ -212,16 +214,11 @@ int fs_write(const char *filename, ulong addr, int offset, int len)
+ void *buf;
+ int ret;
+
+- /*
+- * We don't actually know how many bytes are being read, since len==0
+- * means read the whole file.
+- */
+ buf = map_sysmem(addr, len);
+ ret = info->write(filename, buf, offset, len);
+ unmap_sysmem(buf);
+
+- /* If we requested a specific number of bytes, check we got it */
+- if (ret >= 0 && len && ret != len) {
++ if (ret >= 0 && ret != len) {
+ printf("** Unable to write file %s **\n", filename);
+ ret = -1;
+ }
+diff --git a/include/fs.h b/include/fs.h
+index 7d9403e..97b0094 100644
+--- a/include/fs.h
++++ b/include/fs.h
+@@ -55,6 +55,16 @@ int fs_ls(const char *dirname);
+ int fs_read(const char *filename, ulong addr, int offset, int len);
+
+ /*
++ * Write file "filename" to the partition previously set by fs_set_blk_dev(),
++ * from address "addr", starting at byte offset "offset", and writing "len"
++ * bytes. "offset" may be 0 to write to the start of the file. Note that not
++ * all filesystem types support offset!=0.
++ *
++ * Returns number of bytes read on success. Returns <= 0 on error.
++ */
++int fs_write(const char *filename, ulong addr, int offset, int len);
++
++/*
+ * Common implementation for various filesystem commands, optionally limited
+ * to a specific filesystem type via the fstype parameter.
+ */
+--
+1.8.5.3
+
diff --git a/0005-set-the-default-wandboard-boot-commands.patch b/0005-set-the-default-wandboard-boot-commands.patch
deleted file mode 100644
index 5b2e9d8..0000000
--- a/0005-set-the-default-wandboard-boot-commands.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From e213040f9253ebf299a1dd491443419e9d37d7b8 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 11:44:40 -0500
-Subject: [PATCH 05/16] set the default wandboard boot commands
-
----
- include/configs/wandboard.h | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
-diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
-index 423d94e..ae16694 100644
---- a/include/configs/wandboard.h
-+++ b/include/configs/wandboard.h
-@@ -122,6 +122,23 @@
- "ramdisk_addr_r=0x32000000\0" \
- "fdt_addr_r=0x12000000\0" \
- "boot_fdt=try\0" \
-+ "bootcmd_setup=mmc rescan\0" \
-+ "bootcmd_pxe=setenv bootfile \"\" ;dhcp; pxe get; pxe boot\0" \
-+ "bootcmd_disk_scr=ext2load ${boot_ifc} ${bootdevice} ${scr_addr_r} boot.scr && source ${scr_addr_r}\0" \
-+ "bootcmd_disk_sysboot1=setenv bootfile /boot/extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
-+ "bootcmd_disk_sysboot2=setenv bootfile /extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
-+ "bootcmd_disk_uenv=ext2load ${boot_ifc} ${bootdevice} ${uenv_addr_r} uEnv.txt; env import -t ${uenv_addr_r} ${filesize}; run bootcmd_uenv\0" \
-+ "bootcmd_disk_kernel=ext2load ${boot_ifc} ${bootdevice} ${kernel_addr_r} vmlinuz && ext2load ${boot_ifc} ${bootdevice} ${ramdisk_addr_r} initrd.img && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}\0" \
-+ "bootcmd_disk=run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
-+ "bootcmd_sata=setenv boot_ifc scsi; scsi scan && run bootcmd_disk\0" \
-+ "bootcmd_mmc=setenv boot_ifc mmc; mmc rescan && run bootcmd_disk\0" \
-+ "bootcmd_default=run bootcmd_mmc; run bootcmd_sata; run bootcmd_pxe\0" \
-+ "localcmd=run bootcmd_mmc\0" \
-+ "bootdevice=0\0" \
-+ "bootargs=console=ttymxc0 root=LABEL=rootfs\0" \
-+ "bootdelay=2\0" \
-+ "bootretry=90\0" \
-+ "netretry=once\0" \
- "ip_dyn=yes\0" \
- "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
- "mmcpart=1\0" \
-@@ -190,6 +207,7 @@
-
- #define CONFIG_BOOTCOMMAND \
- "mmc dev ${mmcdev}; if mmc rescan; then " \
-+ "run bootcmd_default; " \
- "if run loadbootscript; then " \
- "run bootscript; " \
- "else " \
---
-1.8.3.1
-
diff --git a/0006-ARM-tegra-convert-tegra-to-use-distro-defaults.patch b/0006-ARM-tegra-convert-tegra-to-use-distro-defaults.patch
new file mode 100644
index 0000000..b6b0f07
--- /dev/null
+++ b/0006-ARM-tegra-convert-tegra-to-use-distro-defaults.patch
@@ -0,0 +1,81 @@
+From d7827a3fd19d7bee575e639ed9b9cbed57eabffe Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 13:17:02 -0700
+Subject: [PATCH 06/13] ARM: tegra: convert tegra to use distro defaults
+
+Modify all Tegra boards to include the "distro defaults" header, so that
+all the config options distros expect are enabled. Remove any #defines
+that enable the same options from the Tegra files.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+---
+ include/configs/tegra-common.h | 20 ++++----------------
+ 1 file changed, 4 insertions(+), 16 deletions(-)
+
+diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
+index 522cd41..bbe417a 100644
+--- a/include/configs/tegra-common.h
++++ b/include/configs/tegra-common.h
+@@ -29,7 +29,6 @@
+ #define CONFIG_DISPLAY_BOARDINFO
+
+ #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
+-#define CONFIG_OF_LIBFDT /* enable passing of devicetree */
+
+ /* Environment */
+ #define CONFIG_ENV_VARS_UBOOT_CONFIG
+@@ -69,33 +68,20 @@
+ #undef CONFIG_CMD_NET /* network support */
+
+ /* turn on command-line edit/hist/auto */
+-#define CONFIG_CMDLINE_EDITING
+ #define CONFIG_COMMAND_HISTORY
+-#define CONFIG_AUTO_COMPLETE
+
+ /* turn on commonly used storage-related commands */
+-
+-#define CONFIG_DOS_PARTITION
+-#define CONFIG_EFI_PARTITION
+ #define CONFIG_PARTITION_UUIDS
+-#define CONFIG_FS_EXT4
+-#define CONFIG_FS_FAT
+-#define CONFIG_CMD_EXT2
+-#define CONFIG_CMD_FAT
+-#define CONFIG_CMD_FS_GENERIC
+ #define CONFIG_CMD_PART
+
+ #define CONFIG_SYS_NO_FLASH
+
+ #define CONFIG_CONSOLE_MUX
+ #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+-#define CONFIG_BOOTDELAY 2 /* -1 to disable auto boot */
+
+ /*
+ * Miscellaneous configurable options
+ */
+-#define CONFIG_SYS_LONGHELP /* undef to save memory */
+-#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
+ #define CONFIG_SYS_PROMPT V_PROMPT
+ /*
+ * Increasing the size of the IO buffer as default nfsargs size is more
+@@ -133,8 +119,6 @@
+ #define CONFIG_TEGRA_GPIO
+ #define CONFIG_CMD_GPIO
+ #define CONFIG_CMD_ENTERRCM
+-#define CONFIG_CMD_BOOTZ
+-#define CONFIG_SUPPORT_RAW_INITRD
+
+ /* Defines for SPL */
+ #define CONFIG_SPL
+@@ -157,4 +141,8 @@
+ #define CONFIG_BOUNCE_BUFFER
+ #define CONFIG_CRC32_VERIFY
+
++#ifndef CONFIG_SPL_BUILD
++#include <config_distro_defaults.h>
++#endif
++
+ #endif /* _TEGRA_COMMON_H_ */
+--
+1.8.5.3
+
diff --git a/0006-set-omap4-to-use-extlinux.conf-by-default.patch b/0006-set-omap4-to-use-extlinux.conf-by-default.patch
deleted file mode 100644
index 8c2f6fa..0000000
--- a/0006-set-omap4-to-use-extlinux.conf-by-default.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 534d6c5a71f1b853d83b0e07ea9c1f272884998b Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 12:35:16 -0500
-Subject: [PATCH 06/16] set omap4 to use extlinux.conf by default
-
----
- include/configs/omap4_common.h | 21 +++++++++++++++++++--
- 1 file changed, 19 insertions(+), 2 deletions(-)
-
-diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
-index 634668a..7e22321 100644
---- a/include/configs/omap4_common.h
-+++ b/include/configs/omap4_common.h
-@@ -155,6 +155,22 @@
- "vram=${vram} " \
- "root=${mmcroot} " \
- "rootfstype=${mmcrootfstype}\0" \
-+ "bootcmd_setup=mmc rescan\0" \
-+ "bootcmd_pxe=setenv bootfile \"\" ;dhcp; pxe get; pxe boot\0" \
-+ "bootcmd_disk_scr=ext2load ${boot_ifc} ${bootdevice} ${scr_addr_r} boot.scr && source ${scr_addr_r}\0" \
-+ "bootcmd_disk_sysboot1=setenv bootfile /boot/extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
-+ "bootcmd_disk_sysboot2=setenv bootfile /extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
-+ "bootcmd_disk_uenv=ext2load ${boot_ifc} ${bootdevice} ${uenv_addr_r} uEnv.txt; env import -t ${uenv_addr_r} ${filesize}; run bootcmd_uenv\0" \
-+ "bootcmd_disk_kernel=ext2load ${boot_ifc} ${bootdevice} ${kernel_addr_r} vmlinuz && ext2load ${boot_ifc} ${bootdevice} ${ramdisk_addr_r} initrd.img && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}\0" \
-+ "bootcmd_disk=run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
-+ "bootcmd_mmc=setenv boot_ifc mmc; mmc rescan && run bootcmd_disk\0" \
-+ "bootcmd_default=run bootcmd_mmc; run bootcmd_pxe\0" \
-+ "localcmd=run bootcmd_mmc\0" \
-+ "bootdevice=0\0" \
-+ "bootargs=console=${console} root=LABEL=rootfs\0" \
-+ "bootdelay=2\0" \
-+ "bootretry=90\0" \
-+ "netretry=once\0" \
- "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
- "source ${loadaddr}\0" \
-@@ -164,7 +180,7 @@
- "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
- "mmcboot=echo Booting from mmc${mmcdev} ...; " \
- "run mmcargs; " \
-- "bootz ${loadaddr} - ${fdtaddr}\0" \
-+ "bootz ${loadaddr} - ${fdt_addr}\0" \
- "findfdt="\
- "if test $board_name = sdp4430; then " \
- "setenv fdtfile omap4-sdp.dtb; fi; " \
-@@ -176,12 +192,13 @@
- "setenv fdtfile omap4-panda-es.dtb; fi;" \
- "if test $fdtfile = undefined; then " \
- "echo WARNING: Could not determine device tree to use; fi; \0" \
-- "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-+ "loadfdt=load mmc ${bootpart} ${fdt_addr} ${bootdir}/${fdtfile}\0" \
-
- #define CONFIG_BOOTCOMMAND \
- "run findfdt; " \
- "mmc dev ${mmcdev}; if mmc rescan; then " \
- "echo SD/MMC found on device ${mmcdev};" \
-+ "run bootcmd_default; " \
- "if run loadbootscript; then " \
- "run bootscript; " \
- "else " \
---
-1.8.3.1
-
diff --git a/0007-fs-implement-infra-structure-for-an-exists-function.patch b/0007-fs-implement-infra-structure-for-an-exists-function.patch
new file mode 100644
index 0000000..3c01a66
--- /dev/null
+++ b/0007-fs-implement-infra-structure-for-an-exists-function.patch
@@ -0,0 +1,182 @@
+From 507d9019944b07ec9d54a7ebb3e6553aaf987de6 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 12:56:57 -0700
+Subject: [PATCH 07/13] fs: implement infra-structure for an 'exists' function
+
+This could be used in scripts such as:
+
+if exists mmc 0:1 /boot/boot.scr; then
+ load mmc 0:1 ${scriptaddr} /boot/boot.scr
+ source ${scriptaddr}
+fi
+
+rather than:
+
+if load mmc 0:1 ${scriptaddr} /boot/boot.scr; then
+ source ${scriptaddr}
+fi
+
+This prevents errors being printed by attempts to load non-existent
+files, which can be important when checking for a large set of files,
+such as /boot/boot.scr.uimg, /boot/boot.scr, /boot/extlinux.conf,
+/boot.scr.uimg, /boot.scr, /extlinux.conf.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+Acked-by: Simon Glass <sjg@chromium.org>
+---
+ common/cmd_fs.c | 14 ++++++++++++++
+ fs/fs.c | 38 ++++++++++++++++++++++++++++++++++++++
+ include/fs.h | 10 ++++++++++
+ 3 files changed, 62 insertions(+)
+
+diff --git a/common/cmd_fs.c b/common/cmd_fs.c
+index 91a205a..44b00cd 100644
+--- a/common/cmd_fs.c
++++ b/common/cmd_fs.c
+@@ -49,3 +49,17 @@ U_BOOT_CMD(
+ " - List files in directory 'directory' of partition 'part' on\n"
+ " device type 'interface' instance 'dev'."
+ );
++
++int do_exists_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
++{
++ return do_exists(cmdtp, flag, argc, argv, FS_TYPE_ANY);
++}
++
++U_BOOT_CMD(
++ exists, 4, 0, do_exists_wrapper,
++ "determine whether a file exists",
++ "<interface> <dev[:part]> filename\n"
++ " - Determine whether 'filename' exists in partition 'part' on\n"
++ " device type 'interface' instance 'dev', and set the command.\n"
++ " exit status so that 'if exists ...; then' works.\n"
++);
+diff --git a/fs/fs.c b/fs/fs.c
+index 9c2ef6b..f3d9a1c 100644
+--- a/fs/fs.c
++++ b/fs/fs.c
+@@ -41,6 +41,11 @@ static inline int fs_ls_unsupported(const char *dirname)
+ return -1;
+ }
+
++static inline int fs_exists_unsupported(const char *filename)
++{
++ return -1;
++}
++
+ static inline int fs_read_unsupported(const char *filename, void *buf,
+ int offset, int len)
+ {
+@@ -62,6 +67,7 @@ struct fstype_info {
+ int (*probe)(block_dev_desc_t *fs_dev_desc,
+ disk_partition_t *fs_partition);
+ int (*ls)(const char *dirname);
++ int (*exists)(const char *filename);
+ int (*read)(const char *filename, void *buf, int offset, int len);
+ int (*write)(const char *filename, void *buf, int offset, int len);
+ void (*close)(void);
+@@ -74,6 +80,7 @@ static struct fstype_info fstypes[] = {
+ .probe = fat_set_blk_dev,
+ .close = fat_close,
+ .ls = file_fat_ls,
++ .exists = fs_exists_unsupported,
+ .read = fat_read_file,
+ .write = fs_write_unsupported,
+ },
+@@ -84,6 +91,7 @@ static struct fstype_info fstypes[] = {
+ .probe = ext4fs_probe,
+ .close = ext4fs_close,
+ .ls = ext4fs_ls,
++ .exists = fs_exists_unsupported,
+ .read = ext4_read_file,
+ .write = fs_write_unsupported,
+ },
+@@ -94,6 +102,7 @@ static struct fstype_info fstypes[] = {
+ .probe = sandbox_fs_set_blk_dev,
+ .close = sandbox_fs_close,
+ .ls = sandbox_fs_ls,
++ .exists = fs_exists_unsupported,
+ .read = fs_read_sandbox,
+ .write = fs_write_sandbox,
+ },
+@@ -103,6 +112,7 @@ static struct fstype_info fstypes[] = {
+ .probe = fs_probe_unsupported,
+ .close = fs_close_unsupported,
+ .ls = fs_ls_unsupported,
++ .exists = fs_exists_unsupported,
+ .read = fs_read_unsupported,
+ .write = fs_write_unsupported,
+ },
+@@ -184,6 +194,19 @@ int fs_ls(const char *dirname)
+ return ret;
+ }
+
++int fs_exists(const char *filename)
++{
++ int ret;
++
++ struct fstype_info *info = fs_get_info(fs_type);
++
++ ret = info->exists(filename);
++
++ fs_close();
++
++ return ret;
++}
++
+ int fs_read(const char *filename, ulong addr, int offset, int len)
+ {
+ struct fstype_info *info = fs_get_info(fs_type);
+@@ -309,6 +332,21 @@ int do_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ return 0;
+ }
+
++int do_exists(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
++ int fstype)
++{
++ if (argc != 4)
++ return CMD_RET_USAGE;
++
++ if (fs_set_blk_dev(argv[1], argv[2], fstype))
++ return 1;
++
++ if (fs_exists(argv[3]))
++ return 1;
++
++ return 0;
++}
++
+ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ int fstype)
+ {
+diff --git a/include/fs.h b/include/fs.h
+index 97b0094..b8b7706 100644
+--- a/include/fs.h
++++ b/include/fs.h
+@@ -44,6 +44,14 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype);
+ int fs_ls(const char *dirname);
+
+ /*
++ * Determine whether a file exists
++ *
++ * Returns 0 if the file exists, non-zero if it doesn't exist.
++ * This encoding was picked to help shell command implementation.
++ */
++int fs_exists(const char *filename);
++
++/*
+ * Read file "filename" from the partition previously set by fs_set_blk_dev(),
+ * to address "addr", starting at byte offset "offset", and reading "len"
+ * bytes. "offset" may be 0 to read from the start of the file. "len" may be
+@@ -72,6 +80,8 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ int fstype);
+ int do_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ int fstype);
++int do_exists(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
++ int fstype);
+ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ int fstype);
+
+--
+1.8.5.3
+
diff --git a/0007-remove-CONFIG_MENU_SHOW-from-distro-config.patch b/0007-remove-CONFIG_MENU_SHOW-from-distro-config.patch
deleted file mode 100644
index d1bbfab..0000000
--- a/0007-remove-CONFIG_MENU_SHOW-from-distro-config.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From d1b689f0beec17c0531189fb15b076082f0f282e Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Thu, 17 Oct 2013 17:54:26 -0500
-Subject: [PATCH 07/16] remove CONFIG_MENU_SHOW from distro config
-
----
- include/config_distro_default.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/include/config_distro_default.h b/include/config_distro_default.h
-index b892868..aa7500e 100644
---- a/include/config_distro_default.h
-+++ b/include/config_distro_default.h
-@@ -41,7 +41,6 @@
- #define CONFIG_SYS_LONGHELP
- #define CONFIG_FIT
- #define CONFIG_MENU
--#define CONFIG_MENU_SHOW
- #define CONFIG_DOS_PARTITION
- #define CONFIG_EFI_PARTITION
- #define CONFIG_SUPPORT_RAW_INITRD
---
-1.8.3.1
-
diff --git a/0008-ARM-tegra-rework-boot-scripts.patch b/0008-ARM-tegra-rework-boot-scripts.patch
new file mode 100644
index 0000000..7ad7774
--- /dev/null
+++ b/0008-ARM-tegra-rework-boot-scripts.patch
@@ -0,0 +1,77 @@
+From 4955e853853d6056363b9ed71bacedc214f96884 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 13:17:03 -0700
+Subject: [PATCH 08/13] ARM: tegra: rework boot scripts
+
+Update the common Tegra boot scripts in the default environment to
+
+a) Make use of the new "exists" shell command to avoid some error
+ messges.
+
+b) Allow booting using the sysboot command and extlinux.conf. This
+ allows easy creation of boot menus, and provides a simple interface
+ for distros to parameterize/configure the boot process.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+---
+ include/configs/tegra-common-post.h | 39 ++++++++++++++++++++++++++++---------
+ 1 file changed, 30 insertions(+), 9 deletions(-)
+
+diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
+index a3242fe..493f6df 100644
+--- a/include/configs/tegra-common-post.h
++++ b/include/configs/tegra-common-post.h
+@@ -69,20 +69,41 @@
+ #define BOOTCMDS_COMMON \
+ "rootpart=1\0" \
+ \
++ "do_script_boot=" \
++ "load ${devtype} ${devnum}:${rootpart} " \
++ "${scriptaddr} ${prefix}${script}; " \
++ "source ${scriptaddr}\0" \
++ \
+ "script_boot=" \
+- "if load ${devtype} ${devnum}:${rootpart} " \
+- "${scriptaddr} ${prefix}${script}; then " \
+- "echo ${script} found! Executing ...;" \
+- "source ${scriptaddr};" \
+- "fi;\0" \
++ "for script in ${boot_scripts}; do " \
++ "if exists ${devtype} ${devnum}:${rootpart} " \
++ "${prefix}${script}; then " \
++ "echo Found U-Boot script " \
++ "${prefix}${script}; " \
++ "run do_script_boot;" \
++ "echo SCRIPT FAILED; continuing...; " \
++ "fi; " \
++ "done\0" \
++ \
++ "do_sysboot_boot=" \
++ "sysboot ${devtype} ${devnum}:${rootpart} any " \
++ "${scriptaddr} ${prefix}extlinux.conf\0" \
++ \
++ "sysboot_boot=" \
++ "if exists ${devtype} ${devnum}:${rootpart} " \
++ "${prefix}extlinux.conf; then " \
++ "echo Found extlinux config " \
++ "${prefix}extlinux.conf; " \
++ "run do_sysboot_boot;" \
++ "echo SCRIPT FAILED; continuing...; " \
++ "fi\0" \
+ \
+ "scan_boot=" \
+ "echo Scanning ${devtype} ${devnum}...; " \
+ "for prefix in ${boot_prefixes}; do " \
+- "for script in ${boot_scripts}; do " \
+- "run script_boot; " \
+- "done; " \
+- "done;\0" \
++ "run script_boot; " \
++ "run sysboot_boot; " \
++ "done\0" \
+ \
+ "boot_targets=" \
+ BOOT_TARGETS_MMC " " \
+--
+1.8.5.3
+
diff --git a/0008-disable-FIT-image-support-since-it-fails-to-build.patch b/0008-disable-FIT-image-support-since-it-fails-to-build.patch
deleted file mode 100644
index 584a270..0000000
--- a/0008-disable-FIT-image-support-since-it-fails-to-build.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 2394d596e963d5532f3ff00e097ebcf5c8338610 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Thu, 17 Oct 2013 17:55:53 -0500
-Subject: [PATCH 08/16] disable FIT image support since it fails to build
-
----
- include/config_distro_default.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/include/config_distro_default.h b/include/config_distro_default.h
-index aa7500e..56a5557 100644
---- a/include/config_distro_default.h
-+++ b/include/config_distro_default.h
-@@ -39,7 +39,6 @@
- #define CONFIG_AUTO_COMPLETE
- #define CONFIG_BOOTDELAY 2
- #define CONFIG_SYS_LONGHELP
--#define CONFIG_FIT
- #define CONFIG_MENU
- #define CONFIG_DOS_PARTITION
- #define CONFIG_EFI_PARTITION
---
-1.8.3.1
-
diff --git a/0009-add-defualt-DHCP-config-options.patch b/0009-add-defualt-DHCP-config-options.patch
deleted file mode 100644
index 72512a0..0000000
--- a/0009-add-defualt-DHCP-config-options.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From c50183e7caa3a26d90cc41b43fd705a9a6a7afdd Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 18:26:17 -0500
-Subject: [PATCH 09/16] add defualt DHCP config options
-
----
- include/config_distro_default.h | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/include/config_distro_default.h b/include/config_distro_default.h
-index 56a5557..7f4c310 100644
---- a/include/config_distro_default.h
-+++ b/include/config_distro_default.h
-@@ -14,8 +14,12 @@
- * required by distros to support boards in a standardised and consitant manner.
- */
-
--
-+#define CONFIG_BOOTP_BOOTPATH
-+#define CONFIG_BOOTP_DNS
-+#define CONFIG_BOOTP_GATEWAY
-+#define CONFIG_BOOTP_HOSTNAME
- #define CONFIG_BOOTP_PXE
-+#define CONFIG_BOOTP_SUBNETMASK
-
- #if defined(__arm__)
- #define CONFIG_BOOTP_PXE_CLIENTARCH 0x100
---
-1.8.3.1
-
diff --git a/0009-sandbox-implement-fs_exists-and-sb-exists-shell-func.patch b/0009-sandbox-implement-fs_exists-and-sb-exists-shell-func.patch
new file mode 100644
index 0000000..63b2d3c
--- /dev/null
+++ b/0009-sandbox-implement-fs_exists-and-sb-exists-shell-func.patch
@@ -0,0 +1,90 @@
+From f52cf070507513fa86debe8cce61f71ca2771b44 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 12:56:58 -0700
+Subject: [PATCH 09/13] sandbox: implement fs_exists() and 'sb exists' shell
+ function
+
+This hooks into the generic "file exists" support added in the previous
+patch, and provides an implementation for the sandbox test environment.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+Acked-by: Simon Glass <sjg@chromium.org>
+---
+ common/cmd_sandbox.c | 7 +++++++
+ fs/fs.c | 2 +-
+ fs/sandbox/sandboxfs.c | 8 ++++++++
+ include/sandboxfs.h | 1 +
+ 4 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/common/cmd_sandbox.c b/common/cmd_sandbox.c
+index 00982b1..c8d36b7 100644
+--- a/common/cmd_sandbox.c
++++ b/common/cmd_sandbox.c
+@@ -22,6 +22,12 @@ static int do_sandbox_ls(cmd_tbl_t *cmdtp, int flag, int argc,
+ return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
+ }
+
++static int do_sandbox_exists(cmd_tbl_t *cmdtp, int flag, int argc,
++ char * const argv[])
++{
++ return do_exists(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
++}
++
+ static int do_sandbox_save(cmd_tbl_t *cmdtp, int flag, int argc,
+ char * const argv[])
+ {
+@@ -88,6 +94,7 @@ static int do_sandbox_info(cmd_tbl_t *cmdtp, int flag, int argc,
+ static cmd_tbl_t cmd_sandbox_sub[] = {
+ U_BOOT_CMD_MKENT(load, 7, 0, do_sandbox_load, "", ""),
+ U_BOOT_CMD_MKENT(ls, 3, 0, do_sandbox_ls, "", ""),
++ U_BOOT_CMD_MKENT(exists, 3, 0, do_sandbox_exists, "", ""),
+ U_BOOT_CMD_MKENT(save, 6, 0, do_sandbox_save, "", ""),
+ U_BOOT_CMD_MKENT(bind, 3, 0, do_sandbox_bind, "", ""),
+ U_BOOT_CMD_MKENT(info, 3, 0, do_sandbox_info, "", ""),
+diff --git a/fs/fs.c b/fs/fs.c
+index f3d9a1c..4f344c6 100644
+--- a/fs/fs.c
++++ b/fs/fs.c
+@@ -102,7 +102,7 @@ static struct fstype_info fstypes[] = {
+ .probe = sandbox_fs_set_blk_dev,
+ .close = sandbox_fs_close,
+ .ls = sandbox_fs_ls,
+- .exists = fs_exists_unsupported,
++ .exists = sandbox_fs_exists,
+ .read = fs_read_sandbox,
+ .write = fs_write_sandbox,
+ },
+diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c
+index dd028da..7940c93 100644
+--- a/fs/sandbox/sandboxfs.c
++++ b/fs/sandbox/sandboxfs.c
+@@ -72,6 +72,14 @@ int sandbox_fs_ls(const char *dirname)
+ return 0;
+ }
+
++int sandbox_fs_exists(const char *filename)
++{
++ ssize_t sz;
++
++ sz = os_get_filesize(filename);
++ return (sz >= 0) ? 0 : -1;
++}
++
+ void sandbox_fs_close(void)
+ {
+ }
+diff --git a/include/sandboxfs.h b/include/sandboxfs.h
+index 8ea8cb7..a51ad13 100644
+--- a/include/sandboxfs.h
++++ b/include/sandboxfs.h
+@@ -25,6 +25,7 @@ long sandbox_fs_read_at(const char *filename, unsigned long pos,
+
+ void sandbox_fs_close(void);
+ int sandbox_fs_ls(const char *dirname);
++int sandbox_fs_exists(const char *filename);
+ int fs_read_sandbox(const char *filename, void *buf, int offset, int len);
+ int fs_write_sandbox(const char *filename, void *buf, int offset, int len);
+
+--
+1.8.5.3
+
diff --git a/0010-ARM-tegra-implement-bootcmd_pxe.patch b/0010-ARM-tegra-implement-bootcmd_pxe.patch
new file mode 100644
index 0000000..362f661
--- /dev/null
+++ b/0010-ARM-tegra-implement-bootcmd_pxe.patch
@@ -0,0 +1,129 @@
+From be95b3d9ea5e9478a52d8fca66b62ed85b39dc08 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 13:17:04 -0700
+Subject: [PATCH 10/13] ARM: tegra: implement bootcmd_pxe
+
+This retrieves a PXE config file over the network, and executes it. This
+allows an extlinux config file to be retrieved over the network and
+executed, whereas the existing bootcmd_dhcp retrieves a U-Boot script.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+---
+ include/configs/tegra-common-post.h | 18 +++++++++++++++++-
+ include/configs/tegra114-common.h | 4 ++++
+ include/configs/tegra20-common.h | 4 ++++
+ include/configs/tegra30-common.h | 4 ++++
+ 4 files changed, 29 insertions(+), 1 deletion(-)
+
+diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
+index 493f6df..a3eb875 100644
+--- a/include/configs/tegra-common-post.h
++++ b/include/configs/tegra-common-post.h
+@@ -66,6 +66,20 @@
+ #define BOOT_TARGETS_DHCP ""
+ #endif
+
++#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
++#define BOOTCMDS_PXE \
++ "bootcmd_pxe=" \
++ BOOTCMD_INIT_USB \
++ "dhcp; " \
++ "if pxe get; then " \
++ "pxe boot; " \
++ "fi\0"
++#define BOOT_TARGETS_PXE "pxe"
++#else
++#define BOOTCMDS_PXE ""
++#define BOOT_TARGETS_PXE ""
++#endif
++
+ #define BOOTCMDS_COMMON \
+ "rootpart=1\0" \
+ \
+@@ -108,6 +122,7 @@
+ "boot_targets=" \
+ BOOT_TARGETS_MMC " " \
+ BOOT_TARGETS_USB " " \
++ BOOT_TARGETS_PXE " " \
+ BOOT_TARGETS_DHCP " " \
+ "\0" \
+ \
+@@ -117,7 +132,8 @@
+ \
+ BOOTCMDS_MMC \
+ BOOTCMDS_USB \
+- BOOTCMDS_DHCP
++ BOOTCMDS_DHCP \
++ BOOTCMDS_PXE
+
+ #define CONFIG_BOOTCOMMAND \
+ "for target in ${boot_targets}; do run bootcmd_${target}; done"
+diff --git a/include/configs/tegra114-common.h b/include/configs/tegra114-common.h
+index a4e8a5f..e7d4373 100644
+--- a/include/configs/tegra114-common.h
++++ b/include/configs/tegra114-common.h
+@@ -51,6 +51,9 @@
+ * scriptaddr can be pretty much anywhere that doesn't conflict with something
+ * else. Put it above BOOTMAPSZ to eliminate conflicts.
+ *
++ * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
++ * something else. Put it above BOOTMAPSZ to eliminate conflicts.
++ *
+ * kernel_addr_r must be within the first 128M of RAM in order for the
+ * kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
+ * decompress itself to 0x8000 after the start of RAM, kernel_addr_r
+@@ -68,6 +71,7 @@
+ */
+ #define MEM_LAYOUT_ENV_SETTINGS \
+ "scriptaddr=0x90000000\0" \
++ "pxefile_addr_r=0x90100000\0" \
+ "kernel_addr_r=0x81000000\0" \
+ "fdt_addr_r=0x82000000\0" \
+ "ramdisk_addr_r=0x82100000\0"
+diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
+index b009a31..ca39722 100644
+--- a/include/configs/tegra20-common.h
++++ b/include/configs/tegra20-common.h
+@@ -49,6 +49,9 @@
+ * scriptaddr can be pretty much anywhere that doesn't conflict with something
+ * else. Put it above BOOTMAPSZ to eliminate conflicts.
+ *
++ * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
++ * something else. Put it above BOOTMAPSZ to eliminate conflicts.
++ *
+ * kernel_addr_r must be within the first 128M of RAM in order for the
+ * kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
+ * decompress itself to 0x8000 after the start of RAM, kernel_addr_r
+@@ -66,6 +69,7 @@
+ */
+ #define MEM_LAYOUT_ENV_SETTINGS \
+ "scriptaddr=0x10000000\0" \
++ "pxefile_addr_r=0x10100000\0" \
+ "kernel_addr_r=0x01000000\0" \
+ "fdt_addr_r=0x02000000\0" \
+ "ramdisk_addr_r=0x02100000\0"
+diff --git a/include/configs/tegra30-common.h b/include/configs/tegra30-common.h
+index b5550d7..95d1547 100644
+--- a/include/configs/tegra30-common.h
++++ b/include/configs/tegra30-common.h
+@@ -48,6 +48,9 @@
+ * scriptaddr can be pretty much anywhere that doesn't conflict with something
+ * else. Put it above BOOTMAPSZ to eliminate conflicts.
+ *
++ * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
++ * something else. Put it above BOOTMAPSZ to eliminate conflicts.
++ *
+ * kernel_addr_r must be within the first 128M of RAM in order for the
+ * kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
+ * decompress itself to 0x8000 after the start of RAM, kernel_addr_r
+@@ -65,6 +68,7 @@
+ */
+ #define MEM_LAYOUT_ENV_SETTINGS \
+ "scriptaddr=0x90000000\0" \
++ "pxefile_addr_r=0x90100000\0" \
+ "kernel_addr_r=0x81000000\0" \
+ "fdt_addr_r=0x82000000\0" \
+ "ramdisk_addr_r=0x82100000\0"
+--
+1.8.5.3
+
diff --git a/0010-remove-USB-from-distro-default-not-all-systems-suppo.patch b/0010-remove-USB-from-distro-default-not-all-systems-suppo.patch
deleted file mode 100644
index 80ce8d0..0000000
--- a/0010-remove-USB-from-distro-default-not-all-systems-suppo.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From a86c59b6fa841a1c59ecd6849367021c7283b49b Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 18:26:55 -0500
-Subject: [PATCH 10/16] remove USB from distro default, not all systems support
- USB
-
----
- include/config_distro_default.h | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/include/config_distro_default.h b/include/config_distro_default.h
-index 7f4c310..132da4f 100644
---- a/include/config_distro_default.h
-+++ b/include/config_distro_default.h
-@@ -37,7 +37,6 @@
- #define CONFIG_CMD_NET
- #define CONFIG_CMD_PING
- #define CONFIG_CMD_PXE
--#define CONFIG_CMD_USB
-
- #define CONFIG_CMDLINE_EDITING
- #define CONFIG_AUTO_COMPLETE
-@@ -48,6 +47,5 @@
- #define CONFIG_EFI_PARTITION
- #define CONFIG_SUPPORT_RAW_INITRD
- #define CONFIG_SYS_HUSH_PARSER
--#define CONFIG_USB_STORAGE
-
- #endif /* _CONFIG_CMD_DISTRO_DEFAULT_H */
---
-1.8.3.1
-
diff --git a/0011-Setup-beagleboard-to-used-generic-distro-configs.patch b/0011-Setup-beagleboard-to-used-generic-distro-configs.patch
deleted file mode 100644
index 33e0b85..0000000
--- a/0011-Setup-beagleboard-to-used-generic-distro-configs.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 0893da22f56bda219e6437057a1145932a8311ac Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 21:47:40 -0500
-Subject: [PATCH 11/16] Setup beagleboard to used generic distro configs
-
----
- include/configs/omap3_beagle.h | 13 ++++++++++---
- 1 file changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
-index 9fcd50b..2dbb5d9 100644
---- a/include/configs/omap3_beagle.h
-+++ b/include/configs/omap3_beagle.h
-@@ -130,6 +130,9 @@
- /* commands to include */
- #include <config_cmd_default.h>
-
-+/* enable generic distro config */
-+#define DISTRO_DEFAULTS 1
-+
- #define CONFIG_CMD_ASKENV
-
- #define CONFIG_CMD_CACHE
-@@ -194,9 +197,13 @@
-
- #define CONFIG_EXTRA_ENV_SETTINGS \
- "loadaddr=0x80200000\0" \
-+ "pxefile_addr_r=0x82000000\0" \
-+ "kernel_addr_r=0x84000000\0" \
-+ "ramdisk_addr_r=0x90000000\0" \
-+ "fdt_addr_r=0x83000000\0" \
- "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
-- "fdtaddr=0x80f80000\0" \
-+ "fdt_addr=0x80f80000\0" \
- "usbtty=cdc_acm\0" \
- "bootfile=uImage\0" \
- "ramdisk=ramdisk.gz\0" \
-@@ -263,13 +270,13 @@
- "rootfstype=${ramrootfstype}\0" \
- "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
- "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-- "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-+ "loadfdt=load mmc ${bootpart} ${fdt_addr} ${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" \
-+ "bootz ${loadaddr} - ${fdt_addr}\0" \
- "nandboot=echo Booting from nand ...; " \
- "run nandargs; " \
- "nand read ${loadaddr} 280000 400000; " \
---
-1.8.3.1
-
diff --git a/0011-ext4-implement-exists-for-ext4fs.patch b/0011-ext4-implement-exists-for-ext4fs.patch
new file mode 100644
index 0000000..34efb79
--- /dev/null
+++ b/0011-ext4-implement-exists-for-ext4fs.patch
@@ -0,0 +1,63 @@
+From 53799c2c610f43e9be3aeefcee00977aed7d736b Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 12:56:59 -0700
+Subject: [PATCH 11/13] ext4: implement exists() for ext4fs
+
+This hooks into the generic "file exists" support added in an earlier
+patch, and provides an implementation for the ext4 filesystem.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+Acked-by: Simon Glass <sjg@chromium.org>
+---
+ fs/ext4/ext4fs.c | 8 ++++++++
+ fs/fs.c | 2 +-
+ include/ext4fs.h | 1 +
+ 3 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
+index 735b256..71ecdd8 100644
+--- a/fs/ext4/ext4fs.c
++++ b/fs/ext4/ext4fs.c
+@@ -174,6 +174,14 @@ int ext4fs_ls(const char *dirname)
+ return 0;
+ }
+
++int ext4fs_exists(const char *filename)
++{
++ int file_len;
++
++ file_len = ext4fs_open(filename);
++ return (file_len >= 0) ? 0 : 1;
++}
++
+ int ext4fs_read(char *buf, unsigned len)
+ {
+ if (ext4fs_root == NULL || ext4fs_file == NULL)
+diff --git a/fs/fs.c b/fs/fs.c
+index 4f344c6..3f14d01 100644
+--- a/fs/fs.c
++++ b/fs/fs.c
+@@ -91,7 +91,7 @@ static struct fstype_info fstypes[] = {
+ .probe = ext4fs_probe,
+ .close = ext4fs_close,
+ .ls = ext4fs_ls,
+- .exists = fs_exists_unsupported,
++ .exists = ext4fs_exists,
+ .read = ext4_read_file,
+ .write = fs_write_unsupported,
+ },
+diff --git a/include/ext4fs.h b/include/ext4fs.h
+index 2429380..aacb147 100644
+--- a/include/ext4fs.h
++++ b/include/ext4fs.h
+@@ -134,6 +134,7 @@ int ext4fs_read(char *buf, unsigned len);
+ int ext4fs_mount(unsigned part_length);
+ void ext4fs_close(void);
+ int ext4fs_ls(const char *dirname);
++int ext4fs_exists(const char *filename);
+ void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot);
+ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf);
+ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+--
+1.8.5.3
+
diff --git a/0012-fat-implement-exists-for-FAT-fs.patch b/0012-fat-implement-exists-for-FAT-fs.patch
new file mode 100644
index 0000000..055a7e9
--- /dev/null
+++ b/0012-fat-implement-exists-for-FAT-fs.patch
@@ -0,0 +1,97 @@
+From 7a9929813cf912b424da18b8faa1320751baec2d Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 12:57:00 -0700
+Subject: [PATCH 12/13] fat: implement exists() for FAT fs
+
+This hooks into the generic "file exists" support added in an earlier
+patch, and provides an implementation for the ext4 filesystem.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+---
+ fs/fat/fat.c | 18 ++++++++++++++----
+ fs/fs.c | 2 +-
+ include/fat.h | 1 +
+ 3 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/fs/fat/fat.c b/fs/fat/fat.c
+index b41d62e..bc06c0a 100644
+--- a/fs/fat/fat.c
++++ b/fs/fat/fat.c
+@@ -808,7 +808,7 @@ __u8 do_fat_read_at_block[MAX_CLUSTSIZE]
+
+ long
+ do_fat_read_at(const char *filename, unsigned long pos, void *buffer,
+- unsigned long maxsize, int dols)
++ unsigned long maxsize, int dols, int dogetsize)
+ {
+ char fnamecopy[2048];
+ boot_sector bs;
+@@ -1152,7 +1152,10 @@ rootdir_done:
+ subname = nextname;
+ }
+
+- ret = get_contents(mydata, dentptr, pos, buffer, maxsize);
++ if (dogetsize)
++ ret = FAT2CPU32(dentptr->size);
++ else
++ ret = get_contents(mydata, dentptr, pos, buffer, maxsize);
+ debug("Size: %d, got: %ld\n", FAT2CPU32(dentptr->size), ret);
+
+ exit:
+@@ -1163,7 +1166,7 @@ exit:
+ long
+ do_fat_read(const char *filename, void *buffer, unsigned long maxsize, int dols)
+ {
+- return do_fat_read_at(filename, 0, buffer, maxsize, dols);
++ return do_fat_read_at(filename, 0, buffer, maxsize, dols, 0);
+ }
+
+ int file_fat_detectfs(void)
+@@ -1233,11 +1236,18 @@ int file_fat_ls(const char *dir)
+ return do_fat_read(dir, NULL, 0, LS_YES);
+ }
+
++int fat_exists(const char *filename)
++{
++ int sz;
++ sz = do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1);
++ return (sz >= 0) ? 0 : 1;
++}
++
+ long file_fat_read_at(const char *filename, unsigned long pos, void *buffer,
+ unsigned long maxsize)
+ {
+ printf("reading %s\n", filename);
+- return do_fat_read_at(filename, pos, buffer, maxsize, LS_NO);
++ return do_fat_read_at(filename, pos, buffer, maxsize, LS_NO, 0);
+ }
+
+ long file_fat_read(const char *filename, void *buffer, unsigned long maxsize)
+diff --git a/fs/fs.c b/fs/fs.c
+index 3f14d01..d2bc8d0 100644
+--- a/fs/fs.c
++++ b/fs/fs.c
+@@ -80,7 +80,7 @@ static struct fstype_info fstypes[] = {
+ .probe = fat_set_blk_dev,
+ .close = fat_close,
+ .ls = file_fat_ls,
+- .exists = fs_exists_unsupported,
++ .exists = fat_exists,
+ .read = fat_read_file,
+ .write = fs_write_unsupported,
+ },
+diff --git a/include/fat.h b/include/fat.h
+index 2c951e7..c8eb7cc 100644
+--- a/include/fat.h
++++ b/include/fat.h
+@@ -188,6 +188,7 @@ file_read_func file_fat_read;
+ int file_cd(const char *path);
+ int file_fat_detectfs(void);
+ int file_fat_ls(const char *dir);
++int fat_exists(const char *filename);
+ long file_fat_read_at(const char *filename, unsigned long pos, void *buffer,
+ unsigned long maxsize);
+ long file_fat_read(const char *filename, void *buffer, unsigned long maxsize);
+--
+1.8.5.3
+
diff --git a/0012-setup-beagleboard-to-load-extlinux.conf.patch b/0012-setup-beagleboard-to-load-extlinux.conf.patch
deleted file mode 100644
index ca4d531..0000000
--- a/0012-setup-beagleboard-to-load-extlinux.conf.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From b76a0828e3c62e74f59eda1d128dc9518c44f4ab Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Mon, 2 Sep 2013 21:55:37 -0500
-Subject: [PATCH 12/16] setup beagleboard to load extlinux.conf
-
----
- include/configs/omap3_beagle.h | 17 +++++++++++++++++
- 1 file changed, 17 insertions(+)
-
-diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
-index 2dbb5d9..f97c244 100644
---- a/include/configs/omap3_beagle.h
-+++ b/include/configs/omap3_beagle.h
-@@ -255,6 +255,22 @@
- "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
- "if test $fdtfile = undefined; then " \
- "echo WARNING: Could not determine device tree to use; fi; \0" \
-+ "bootcmd_setup=mmc rescan\0" \
-+ "bootcmd_pxe=setenv bootfile \"\" ;dhcp; pxe get; pxe boot\0" \
-+ "bootcmd_disk_scr=ext2load ${boot_ifc} ${bootdevice} ${scr_addr_r} boot.scr && source ${scr_addr_r}\0" \
-+ "bootcmd_disk_sysboot1=setenv bootfile /boot/extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
-+ "bootcmd_disk_sysboot2=setenv bootfile /extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
-+ "bootcmd_disk_uenv=ext2load ${boot_ifc} ${bootdevice} ${uenv_addr_r} uEnv.txt; env import -t ${uenv_addr_r} ${filesize}; run bootcmd_uenv\0" \
-+ "bootcmd_disk_kernel=ext2load ${boot_ifc} ${bootdevice} ${kernel_addr_r} vmlinuz && ext2load ${boot_ifc} ${bootdevice} ${ramdisk_addr_r} initrd.img && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}\0" \
-+ "bootcmd_disk=run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
-+ "bootcmd_mmc=setenv boot_ifc mmc; mmc rescan && run bootcmd_disk\0" \
-+ "bootcmd_default=run bootcmd_mmc; run bootcmd_pxe\0" \
-+ "localcmd=run bootcmd_mmc\0" \
-+ "bootdevice=0\0" \
-+ "bootargs=console=${console} root=LABEL=rootfs\0" \
-+ "bootdelay=2\0" \
-+ "bootretry=90\0" \
-+ "netretry=once\0" \
- "bootenv=uEnv.txt\0" \
- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
- "importbootenv=echo Importing environment from mmc ...; " \
-@@ -292,6 +308,7 @@
- #define CONFIG_BOOTCOMMAND \
- "run findfdt; " \
- "mmc dev ${mmcdev}; if mmc rescan; then " \
-+ "run bootcmd_default; " \
- "if run userbutton; then " \
- "setenv bootenv uEnv.txt;" \
- "else " \
---
-1.8.3.1
-
diff --git a/0013-Modify-wandboard-to-include-the-distro-defaults-head.patch b/0013-Modify-wandboard-to-include-the-distro-defaults-head.patch
new file mode 100644
index 0000000..d18406f
--- /dev/null
+++ b/0013-Modify-wandboard-to-include-the-distro-defaults-head.patch
@@ -0,0 +1,287 @@
+From 380f5bf541c6a32dd06fb9a058b3b19c3eae591c Mon Sep 17 00:00:00 2001
+From: Dennis Gilmore <dennis@ausil.us>
+Date: Thu, 6 Feb 2014 07:02:45 -0600
+Subject: [PATCH 13/13] Modify wandboard to include the "distro defaults"
+ header, so that all the config options distros expect are enabled. Remove any
+ #defines that enable the same options from the wandboard files.
+
+Update the wandboard boot scripts in the default environment to
+
+a) Make use of the new "exists" shell command to avoid some error
+ messges.
+
+b) Allow booting using the sysboot command and extlinux.conf. This
+ allows easy creation of boot menus, and provides a simple interface
+ for distros to parameterize/configure the boot process.
+---
+ include/configs/wandboard.h | 205 ++++++++++++++++++++++++++++----------------
+ 1 file changed, 131 insertions(+), 74 deletions(-)
+
+diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
+index 3488472..3abe7e6 100644
+--- a/include/configs/wandboard.h
++++ b/include/configs/wandboard.h
+@@ -41,6 +41,10 @@
+ #define CONFIG_CONS_INDEX 1
+ #define CONFIG_BAUDRATE 115200
+
++#ifndef CONFIG_SPL_BUILD
++#include <config_distro_defaults.h>
++#endif
++
+ /* Command definition */
+ #include <config_cmd_default.h>
+
+@@ -49,8 +53,6 @@
+ #define CONFIG_CMD_BMODE
+ #define CONFIG_CMD_SETEXPR
+
+-#define CONFIG_BOOTDELAY 5
+-
+ #define CONFIG_SYS_MEMTEST_START 0x10000000
+ #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
+ #define CONFIG_LOADADDR 0x12000000
+@@ -66,15 +68,8 @@
+ #define CONFIG_CMD_MMC
+ #define CONFIG_GENERIC_MMC
+ #define CONFIG_BOUNCE_BUFFER
+-#define CONFIG_CMD_EXT2
+-#define CONFIG_CMD_FAT
+-#define CONFIG_DOS_PARTITION
+
+ /* Ethernet Configuration */
+-#define CONFIG_CMD_PING
+-#define CONFIG_CMD_DHCP
+-#define CONFIG_CMD_MII
+-#define CONFIG_CMD_NET
+ #define CONFIG_FEC_MXC
+ #define CONFIG_MII
+ #define IMX_FEC_BASE ENET_BASE_ADDR
+@@ -116,6 +111,11 @@
+ "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+ "fdt_addr=0x18000000\0" \
+ "boot_fdt=try\0" \
++ "fdt_addr_r=0x18100000\0" \
++ "pxefile_addr_r=0x18200000\0" \
++ "scr_addr_r=0x18300000\0" \
++ "kernel_addr_r=0x18400000\0" \
++ "ramdisk_addr_r=0x18500000\0" \
+ "ip_dyn=yes\0" \
+ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
+ "mmcpart=1\0" \
+@@ -133,71 +133,133 @@
+ "setexpr fw_sz ${fw_sz} + 1; " \
+ "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+ "fi; " \
++ "fi\0"
++
++#ifdef CONFIG_CMD_MMC
++#define BOOTCMDS_MMC \
++ "mmc_boot=" \
++ "setenv devtype mmc; " \
++ "if mmc dev ${devnum}; then " \
++ "run scan_boot; " \
+ "fi\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" \
+- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\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 " \
+- "bootz ${loadaddr} - ${fdt_addr}; " \
+- "else " \
+- "if test ${boot_fdt} = try; then " \
+- "bootz; " \
+- "else " \
+- "echo WARN: Cannot load the DT; " \
+- "fi; " \
+- "fi; " \
+- "else " \
+- "bootz; " \
+- "fi;\0" \
+- "netargs=setenv bootargs console=${console},${baudrate} " \
+- "root=/dev/nfs " \
+- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+- "netboot=echo Booting from net ...; " \
+- "run netargs; " \
+- "if test ${ip_dyn} = yes; then " \
+- "setenv get_cmd dhcp; " \
+- "else " \
+- "setenv get_cmd tftp; " \
+- "fi; " \
+- "${get_cmd} ${image}; " \
+- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+- "bootz ${loadaddr} - ${fdt_addr}; " \
+- "else " \
+- "if test ${boot_fdt} = try; then " \
+- "bootz; " \
+- "else " \
+- "echo WARN: Cannot load the DT; " \
+- "fi; " \
+- "fi; " \
+- "else " \
+- "bootz; " \
+- "fi;\0"
++ "bootcmd_mmc0=setenv devnum 0; run mmc_boot;\0" \
++ "bootcmd_mmc1=setenv devnum 1; run mmc_boot;\0"
++#define BOOT_TARGETS_MMC "mmc1 mmc0"
++#else
++#define BOOTCMDS_MMC ""
++#define BOOT_TARGETS_MMC ""
++#endif
++
++#ifdef CONFIG_CMD_USB
++#define BOOTCMD_INIT_USB "run usb_init; "
++#define BOOTCMDS_USB \
++ "usb_init=" \
++ "if ${usb_need_init}; then " \
++ "set usb_need_init false; " \
++ "usb start 0; " \
++ "fi\0" \
++ \
++ "usb_boot=" \
++ "setenv devtype usb; " \
++ BOOTCMD_INIT_USB \
++ "if usb dev ${devnum}; then " \
++ "run scan_boot; " \
++ "fi\0" \
++ \
++ "bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
++#define BOOT_TARGETS_USB "usb0"
++#else
++#define BOOTCMD_INIT_USB ""
++#define BOOTCMDS_USB ""
++#define BOOT_TARGETS_USB ""
++#endif
++
++#ifdef CONFIG_CMD_DHCP
++#define BOOTCMDS_DHCP \
++ "bootcmd_dhcp=" \
++ BOOTCMD_INIT_USB \
++ "if dhcp ${scriptaddr} boot.scr.uimg; then "\
++ "source ${scriptaddr}; " \
++ "fi\0"
++#define BOOT_TARGETS_DHCP "dhcp"
++#else
++#define BOOTCMDS_DHCP ""
++#define BOOT_TARGETS_DHCP ""
++#endif
++
++#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
++#define BOOTCMDS_PXE \
++ "bootcmd_pxe=" \
++ BOOTCMD_INIT_USB \
++ "dhcp; " \
++ "if pxe get; then " \
++ "pxe boot; " \
++ "fi\0"
++#define BOOT_TARGETS_PXE "pxe"
++#else
++#define BOOTCMDS_PXE ""
++#define BOOT_TARGETS_PXE ""
++#endif
++
++#define BOOTCMDS_COMMON \
++ "rootpart=1\0" \
++ \
++ "do_script_boot=" \
++ "load ${devtype} ${devnum}:${rootpart} " \
++ "${scriptaddr} ${prefix}${script}; " \
++ "source ${scriptaddr}\0" \
++ \
++ "script_boot=" \
++ "for script in ${boot_scripts}; do " \
++ "if exists ${devtype} ${devnum}:${rootpart} " \
++ "${prefix}${script}; then " \
++ "echo Found U-Boot script " \
++ "${prefix}${script}; " \
++ "run do_script_boot;" \
++ "echo SCRIPT FAILED; continuing...; " \
++ "fi; " \
++ "done\0" \
++ \
++ "do_sysboot_boot=" \
++ "sysboot ${devtype} ${devnum}:${rootpart} any " \
++ "${scriptaddr} ${prefix}extlinux.conf\0" \
++ \
++ "sysboot_boot=" \
++ "if exists ${devtype} ${devnum}:${rootpart} " \
++ "${prefix}extlinux.conf; then " \
++ "echo Found extlinux config " \
++ "${prefix}extlinux.conf; " \
++ "run do_sysboot_boot;" \
++ "echo SCRIPT FAILED; continuing...; " \
++ "fi\0" \
++ \
++ "scan_boot=" \
++ "echo Scanning ${devtype} ${devnum}...; " \
++ "for prefix in ${boot_prefixes}; do " \
++ "run script_boot; " \
++ "run sysboot_boot; " \
++ "done\0" \
++ \
++ "boot_targets=" \
++ BOOT_TARGETS_MMC " " \
++ BOOT_TARGETS_USB " " \
++ BOOT_TARGETS_PXE " " \
++ BOOT_TARGETS_DHCP " " \
++ "\0" \
++ \
++ "boot_prefixes=/ /boot/\0" \
++ \
++ "boot_scripts=boot.scr.uimg boot.scr\0" \
++ \
++ BOOTCMDS_MMC \
++ BOOTCMDS_USB \
++ BOOTCMDS_DHCP \
++ BOOTCMDS_PXE
+
+ #define CONFIG_BOOTCOMMAND \
+- "mmc dev ${mmcdev}; if mmc rescan; then " \
+- "if run loadbootscript; then " \
+- "run bootscript; " \
+- "else " \
+- "if run loadimage; then " \
+- "run mmcboot; " \
+- "else run netboot; " \
+- "fi; " \
+- "fi; " \
+- "else run netboot; fi"
++ "for target in ${boot_targets}; do run bootcmd_${target}; done"
+
+ /* Miscellaneous configurable options */
+-#define CONFIG_SYS_LONGHELP
+-#define CONFIG_SYS_HUSH_PARSER
+-#define CONFIG_AUTO_COMPLETE
+ #define CONFIG_SYS_CBSIZE 256
+
+ /* Print Buffer Size */
+@@ -207,8 +269,6 @@
+
+ #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+
+-#define CONFIG_CMDLINE_EDITING
+-
+ /* Physical Memory Map */
+ #define CONFIG_NR_DRAM_BANKS 1
+ #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
+@@ -231,9 +291,6 @@
+ #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
+ #define CONFIG_SYS_MMC_ENV_DEV 0
+
+-#define CONFIG_OF_LIBFDT
+-#define CONFIG_CMD_BOOTZ
+-
+ #ifndef CONFIG_SYS_DCACHE_OFF
+ #define CONFIG_CMD_CACHE
+ #endif
+--
+1.8.5.3
+
diff --git a/0013-setup-distro-common-variables-on-beaglebones.patch b/0013-setup-distro-common-variables-on-beaglebones.patch
deleted file mode 100644
index 3c79f33..0000000
--- a/0013-setup-distro-common-variables-on-beaglebones.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From c1ce44384122a284dad8efb084fe6f1c047633ea Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Thu, 17 Oct 2013 18:21:54 -0500
-Subject: [PATCH 13/16] setup distro common variables on beaglebones
-
----
- include/configs/am335x_evm.h | 21 ++++++++++++---------
- 1 file changed, 12 insertions(+), 9 deletions(-)
-
-diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
-index c2ba7e3..25f5893 100644
---- a/include/configs/am335x_evm.h
-+++ b/include/configs/am335x_evm.h
-@@ -57,10 +57,13 @@
- #ifndef CONFIG_SPL_BUILD
- #define CONFIG_EXTRA_ENV_SETTINGS \
- "loadaddr=0x80200000\0" \
-- "fdtaddr=0x80F80000\0" \
-+ "pxefile_addr_r=0x80500000\0" \
-+ "kernel_addr_r=0x80600000\0" \
-+ "ramdisk_addr_r=0x82600000\0" \
-+ "fdt_addr_r=0x80300000\0" \
-+ "fdt_addr=0x80400000\0" \
- "fdt_high=0xffffffff\0" \
- "boot_fdt=try\0" \
-- "rdaddr=0x81000000\0" \
- "bootpart=0:2\0" \
- "bootdir=/boot\0" \
- "bootfile=zImage\0" \
-@@ -76,7 +79,7 @@
- "nfsopts=nolock\0" \
- "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
- "::off\0" \
-- "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \
-+ "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${ramdisk_addr_r},64M\0" \
- "ramrootfstype=ext2\0" \
- "mmcargs=setenv bootargs console=${console} " \
- "${optargs} " \
-@@ -105,13 +108,13 @@
- "${optargs} " \
- "root=${ramroot} " \
- "rootfstype=${ramrootfstype}\0" \
-- "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
-+ "loadramdisk=load mmc ${mmcdev} ${ramdisk_addr_r} ramdisk.gz\0" \
- "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-- "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-+ "loadfdt=load mmc ${bootpart} ${fdt_addr_r} ${bootdir}/${fdtfile}\0" \
- "mmcloados=run mmcargs; " \
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if run loadfdt; then " \
-- "bootz ${loadaddr} - ${fdtaddr}; " \
-+ "bootz ${loadaddr} - ${fdt_addr_r}; " \
- "else " \
- "if test ${boot_fdt} = try; then " \
- "bootz; " \
-@@ -146,12 +149,12 @@
- "setenv autoload no; " \
- "dhcp; " \
- "tftp ${loadaddr} ${bootfile}; " \
-- "tftp ${fdtaddr} ${fdtfile}; " \
-+ "tftp ${fdt_addr_r} ${fdtfile}; " \
- "run netargs; " \
-- "bootz ${loadaddr} - ${fdtaddr}\0" \
-+ "bootz ${loadaddr} - ${fdt_addr_r}\0" \
- "ramboot=echo Booting from ramdisk ...; " \
- "run ramargs; " \
-- "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
-+ "bootz ${loadaddr} ${ramdisk_addr_r} ${fdt_addr_r}\0" \
- "findfdt="\
- "if test $board_name = A335BONE; then " \
- "setenv fdtfile am335x-bone.dtb; fi; " \
---
-1.8.3.1
-
diff --git a/0014-Use-SPDX-header-in-distro-config.patch b/0014-Use-SPDX-header-in-distro-config.patch
deleted file mode 100644
index ddf31ec..0000000
--- a/0014-Use-SPDX-header-in-distro-config.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From f5c7ad35415218c20b904edf1981a33a47bcdf92 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Thu, 17 Oct 2013 18:55:25 -0500
-Subject: [PATCH 14/16] Use SPDX header in distro config
-
----
- include/config_distro_default.h | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/include/config_distro_default.h b/include/config_distro_default.h
-index 132da4f..bd9b4a0 100644
---- a/include/config_distro_default.h
-+++ b/include/config_distro_default.h
-@@ -1,9 +1,7 @@
- /*
- * Copyright 2013 Red Hat, Inc.
- *
-- * This file is licensed under the terms of the GNU General Public
-- * License Version 2. This file is licensed "as is" without any
-- * warranty of any kind, whether express or implied.
-+ * SPDX-License-Identifier: GPL-2.0+
- */
-
- #ifndef _CONFIG_CMD_DISTRO_DEFAULT_H
---
-1.8.3.1
-
diff --git a/0015-WANDBOARD-adjust-addrs-to-work-with-calculated-value.patch b/0015-WANDBOARD-adjust-addrs-to-work-with-calculated-value.patch
deleted file mode 100644
index 369b82e..0000000
--- a/0015-WANDBOARD-adjust-addrs-to-work-with-calculated-value.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From db994bffd3db0a6d02fa049eca0ff83720e22e73 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Thu, 17 Oct 2013 19:12:52 -0500
-Subject: [PATCH 15/16] WANDBOARD: adjust addrs to work with calculated values.
- add scr_addr_r so the fall back to boot.scr has somewhere to be loaded have
- pxe boot load a fdt have sysboot load a fdt
-
----
- include/configs/wandboard.h | 15 ++++++++-------
- 1 file changed, 8 insertions(+), 7 deletions(-)
-
-diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
-index ae16694..135835f 100644
---- a/include/configs/wandboard.h
-+++ b/include/configs/wandboard.h
-@@ -116,20 +116,21 @@
- "fdt_high=0xffffffff\0" \
- "initrd_high=0xffffffff\0" \
- "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
-- "fdt_addr=0x11000000\0" \
-- "pxefile_addr_r=0x13000000\0" \
-- "kernel_addr_r=0x14000000\0" \
-- "ramdisk_addr_r=0x32000000\0" \
-- "fdt_addr_r=0x12000000\0" \
-+ "fdt_addr=0x11100000\0" \
-+ "fdt_addr_r=0x11200000\0" \
-+ "pxefile_addr_r=0x11300000\0" \
-+ "scr_addr_r=0x11400000\0" \
-+ "kernel_addr_r=0x11500000\0" \
-+ "ramdisk_addr_r=0x13500000\0" \
- "boot_fdt=try\0" \
- "bootcmd_setup=mmc rescan\0" \
-- "bootcmd_pxe=setenv bootfile \"\" ;dhcp; pxe get; pxe boot\0" \
-+ "bootcmd_pxe=setenv bootfile \"\" ;dhcp; tftp ${fdt_addr} /dtb/${fdt_file}; pxe get; pxe boot\0" \
- "bootcmd_disk_scr=ext2load ${boot_ifc} ${bootdevice} ${scr_addr_r} boot.scr && source ${scr_addr_r}\0" \
- "bootcmd_disk_sysboot1=setenv bootfile /boot/extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
- "bootcmd_disk_sysboot2=setenv bootfile /extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
- "bootcmd_disk_uenv=ext2load ${boot_ifc} ${bootdevice} ${uenv_addr_r} uEnv.txt; env import -t ${uenv_addr_r} ${filesize}; run bootcmd_uenv\0" \
- "bootcmd_disk_kernel=ext2load ${boot_ifc} ${bootdevice} ${kernel_addr_r} vmlinuz && ext2load ${boot_ifc} ${bootdevice} ${ramdisk_addr_r} initrd.img && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}\0" \
-- "bootcmd_disk=run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
-+ "bootcmd_disk=load ${boot_ifc} ${bootdevice} ${fdt_addr} /boot/dtb/${fdt_file}; load ${boot_ifc} ${bootdevice} ${fdt_addr} /dtb/${fdt_file};run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
- "bootcmd_sata=setenv boot_ifc scsi; scsi scan && run bootcmd_disk\0" \
- "bootcmd_mmc=setenv boot_ifc mmc; mmc rescan && run bootcmd_disk\0" \
- "bootcmd_default=run bootcmd_mmc; run bootcmd_sata; run bootcmd_pxe\0" \
---
-1.8.3.1
-
diff --git a/0016-WANDBOARD-use-ext2load-to-load-dtbs.patch b/0016-WANDBOARD-use-ext2load-to-load-dtbs.patch
deleted file mode 100644
index 0933e83..0000000
--- a/0016-WANDBOARD-use-ext2load-to-load-dtbs.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 8141d31d3abbddc1463dad6a22e431510c4ce629 Mon Sep 17 00:00:00 2001
-From: Dennis Gilmore <dennis@ausil.us>
-Date: Sat, 19 Oct 2013 06:47:29 -0500
-Subject: [PATCH 16/16] WANDBOARD: use ext2load to load dtbs
-
----
- include/configs/wandboard.h | 14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
-index 135835f..ae09f43 100644
---- a/include/configs/wandboard.h
-+++ b/include/configs/wandboard.h
-@@ -51,7 +51,6 @@
- #define CONFIG_CMD_BMODE
- #define CONFIG_CMD_SETEXPR
-
--#define CONFIG_BOOTDELAY 5
-
- #define CONFIG_SYS_MEMTEST_START 0x10000000
- #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
-@@ -68,6 +67,9 @@
- #define CONFIG_CMD_MMC
- #define CONFIG_GENERIC_MMC
- #define CONFIG_BOUNCE_BUFFER
-+
-+#define CONFIG_BOOTDELAY 5
-+
- #define CONFIG_CMD_EXT2
- #define CONFIG_CMD_FAT
- #define CONFIG_DOS_PARTITION
-@@ -77,6 +79,11 @@
- #define CONFIG_CMD_DHCP
- #define CONFIG_CMD_MII
- #define CONFIG_CMD_NET
-+
-+#define CONFIG_OF_LIBFDT
-+#define CONFIG_CMD_BOOTZ
-+
-+/* Ethernet Configuration */
- #define CONFIG_FEC_MXC
- #define CONFIG_MII
- #define IMX_FEC_BASE ENET_BASE_ADDR
-@@ -130,7 +137,7 @@
- "bootcmd_disk_sysboot2=setenv bootfile /extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
- "bootcmd_disk_uenv=ext2load ${boot_ifc} ${bootdevice} ${uenv_addr_r} uEnv.txt; env import -t ${uenv_addr_r} ${filesize}; run bootcmd_uenv\0" \
- "bootcmd_disk_kernel=ext2load ${boot_ifc} ${bootdevice} ${kernel_addr_r} vmlinuz && ext2load ${boot_ifc} ${bootdevice} ${ramdisk_addr_r} initrd.img && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}\0" \
-- "bootcmd_disk=load ${boot_ifc} ${bootdevice} ${fdt_addr} /boot/dtb/${fdt_file}; load ${boot_ifc} ${bootdevice} ${fdt_addr} /dtb/${fdt_file};run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
-+ "bootcmd_disk=ext2load ${boot_ifc} ${bootdevice} ${fdt_addr} /boot/dtb/${fdt_file}; ext2load ${boot_ifc} ${bootdevice} ${fdt_addr} /dtb/${fdt_file};run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
- "bootcmd_sata=setenv boot_ifc scsi; scsi scan && run bootcmd_disk\0" \
- "bootcmd_mmc=setenv boot_ifc mmc; mmc rescan && run bootcmd_disk\0" \
- "bootcmd_default=run bootcmd_mmc; run bootcmd_sata; run bootcmd_pxe\0" \
-@@ -258,9 +265,6 @@
- #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
- #define CONFIG_SYS_MMC_ENV_DEV 0
-
--#define CONFIG_OF_LIBFDT
--#define CONFIG_CMD_BOOTZ
--
- #ifndef CONFIG_SYS_DCACHE_OFF
- #define CONFIG_CMD_CACHE
- #endif
---
-1.8.3.1
-
diff --git a/sources b/sources
index a19d0c8..6a4b369 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-a076a044b64371edc52f7e562b13f6b2 u-boot-2013.10.tar.bz2
+e531307578f6d32a7ccb1d04f1e08cbc u-boot-2014.01.tar.bz2
diff --git a/uboot-tools.spec b/uboot-tools.spec
index ac2fb9d..e23d84f 100644
--- a/uboot-tools.spec
+++ b/uboot-tools.spec
@@ -1,8 +1,8 @@
#global candidate
Name: uboot-tools
-Version: 2013.10
-Release: 3%{?candidate:.%{candidate}}%{?dist}
+Version: 2014.01
+Release: 1%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
Group: Development/Tools
@@ -14,27 +14,25 @@ Patch1: u-boot-fat.patch
Patch3: mlo-ext.patch
Patch4: exynos-ext.patch
-Patch10: 0001-add-distro-default-commands-and-config-options.patch
-Patch11: 0002-add-option-to-include-generic-distro-config.patch
-Patch12: 0003-set-omap4-boards-to-use-the-generic-distro-support.patch
-Patch13: 0004-set-wandboard-to-use-generic-commands-and-set-needed.patch
-Patch14: 0005-set-the-default-wandboard-boot-commands.patch
-Patch15: 0006-set-omap4-to-use-extlinux.conf-by-default.patch
-Patch16: 0007-remove-CONFIG_MENU_SHOW-from-distro-config.patch
-Patch17: 0008-disable-FIT-image-support-since-it-fails-to-build.patch
-Patch18: 0009-add-defualt-DHCP-config-options.patch
-Patch19: 0010-remove-USB-from-distro-default-not-all-systems-suppo.patch
-Patch20: 0011-Setup-beagleboard-to-used-generic-distro-configs.patch
-Patch21: 0012-setup-beagleboard-to-load-extlinux.conf.patch
-Patch22: 0013-setup-distro-common-variables-on-beaglebones.patch
-Patch23: 0014-Use-SPDX-header-in-distro-config.patch
-Patch24: 0015-WANDBOARD-adjust-addrs-to-work-with-calculated-value.patch
-Patch25: 0016-WANDBOARD-use-ext2load-to-load-dtbs.patch
+Patch10: 0001-pxe-support-devicetree-tag.patch
+Patch11: 0002-pxe-implement-fdtdir-extlinux.conf-tag.patch
+Patch12: 0003-cmd_pxe.c-add-any-option-for-filesystem-with-sysboot.patch
+Patch13: 0004-config-add-config_distro_defaults.h.patch
+Patch14: 0005-fs-fix-generic-save-command-implementation.patch
+Patch15: 0006-ARM-tegra-convert-tegra-to-use-distro-defaults.patch
+Patch16: 0007-fs-implement-infra-structure-for-an-exists-function.patch
+Patch17: 0008-ARM-tegra-rework-boot-scripts.patch
+Patch18: 0009-sandbox-implement-fs_exists-and-sb-exists-shell-func.patch
+Patch19: 0010-ARM-tegra-implement-bootcmd_pxe.patch
+Patch20: 0011-ext4-implement-exists-for-ext4fs.patch
+Patch21: 0012-fat-implement-exists-for-FAT-fs.patch
+Patch22: 0013-Modify-wandboard-to-include-the-distro-defaults-head.patch
# Panda ES memory timing issue
#Patch50: omap4-panda-memtiming.patch
BuildRequires: dtc
+BuildRequires: fedora-logos, netpbm-progs
Requires: dtc
# build the tool for manipulation with environment only on arm
@@ -46,6 +44,15 @@ Requires: dtc
This package contains a few U-Boot utilities - mkimage for creating boot images
and fw_printenv/fw_setenv for manipulating the boot environment variables.
+%ifarch aarch64
+%package -n uboot-vexpress_aemv8a
+Summary: u-boot bootloader binaries for the aarch64 vexpress_aemv8a
+Requires: uboot-tools
+
+%description -n uboot-vexpress_aemv8a
+u-boot bootloader binaries for the aarch64 vexpress_aemv8a
+%endif
+
%ifarch %{arm}
%package -n uboot-arndale
Summary: u-boot bootloader binaries for arndale board
@@ -174,14 +181,27 @@ u-boot bootloader binaries for Wandboard i.MX6 Solo
%patch20 -p1
%patch21 -p1
%patch22 -p1
-%patch23 -p1
-%patch24 -p1
-%patch25 -p1
-#%patch50 -p1 -b .panda
+
mkdir builds
+# convert fedora logo to bmp for use in u-boot
+pngtopnm /usr/share/pixmaps/fedora-logo.png | ppmquant 256 | ppmtobmp -bpp 8 >fedora.bmp
+
+#replace the logos with fedora's
+for bmp in tools/logos/*bmp
+do
+cp fedora.bmp $bmp
+done
%build
+%ifarch aarch64
+make CROSS_COMPILE="" vexpress_aemv8a_config
+make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" %{?_smp_mflags}
+cp -p u-boot.bin builds/u-boot.bin.vexpress_aemv8a
+make distclean
+
+%endif
+
%ifarch %{arm}
make CROSS_COMPILE="" am335x_evm_config
make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" %{?_smp_mflags}
@@ -285,6 +305,12 @@ mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
+%ifarch aarch64
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/vexpress_aemv8a/
+
+install -p -m 0644 builds/u-boot.bin.vexpress_aemv8a $RPM_BUILD_ROOT%{_datadir}/uboot/vexpress_aemv8a/u-boot.bin
+%endif
+
%ifarch %{arm}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/
install -p -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/uboot/uEnv.txt
@@ -365,6 +391,13 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/fw_setenv
%config(noreplace) %{_sysconfdir}/fw_env.config
%endif
+
+%ifarch aarch64
+%files -n uboot-vexpress_aemv8a
+%defattr(-,root,root,-)
+%{_datadir}/uboot/vexpress_aemv8a/
+%endif
+
%ifarch %{arm}
%files -n uboot-arndale
%defattr(-,root,root,-)