[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A10-OLinuXino-LIME board



On Mon, 2014-09-08 at 08:25 +0200, Karsten Merker wrote:
> On Sun, Sep 07, 2014 at 05:56:10PM -0500, Vagrant Cascadian wrote:
> > On 2014-09-07 13:48:30 -0500, Karsten Merker wrote:
> > > Vagrant, if possible it would be nice if you could enable the
> > > following targets in your next build of u-boot 2014.10 for armhf:
> > >
> > > A10-OLinuXino-Lime
> > > A10s-OLinuXino-M
> > > A13-OLinuXino
> > > A13-OLinuXinoM
> > > A20-OLinuXino_MICRO
> > > Cubieboard2
> > > Cubieboard2_FEL
> > >
> > > These are all systems that are otherwise supported in Debian
> > > (i.e. kernel/devicetree and flash-kernel support is available).
> > 
> > If you or others would be willing to be listed as a tester for all these
> > boards, I'd be happy to enable them.
> 
> I unfortunately don't have any of these systems at the moment,
> but I'll receive a Cubieboard2 within the next weeks. As soon as
> it is here, I am happy to do the testing for the Cubieboard2 and
> Cubieboard2_FEL targets.

FWIW I've got a Cubieboard2 as well.

Ideally we would build FEL variants for all sunxi boards, but we don't
have _FEL defconfigs for everything upstream. Hans (my co-custodian)
rightly doesn't want to duplicate every defconfig twice.

At the weekend I was playing with the two attached patches which build a
FEL variant for every sunxi board.

I think Vagrant is correct that we should also be looking to split the
sunxi stuff (which has a bazzilion variants it seems) into a different
package. The required debian/rules changes for that might also provide a
better hook for enabling FEL variations than what I've done above. I'm
thinking along the lines of an extra column in debian/targets which is
either "-" or a package name suffix ("sunxi").

Ian.
From 529d60263c8cfbf21d4c7cc01429f84aaa5da437 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ijc@hellion.org.uk>
Date: Sat, 6 Sep 2014 11:54:54 +0100
Subject: [PATCH 1/2] Refactor per-platform build rules into a macro

---
 debian/rules | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/debian/rules b/debian/rules
index 84e13df..fff1d4e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,6 +42,29 @@ has_mtd_user := $(call check_include, mtd/mtd-user.h)
 
 build-indep:
 
+# $(1) := platform
+# $(2) := targets
+define BUILD_ONE
+        builddir=`pwd`/debian/build/$(1); \
+        installdir=debian/$(package)/usr/lib/$(package)/$(1); \
+        mkdir -p $$builddir; \
+	for target in $(2) ; do \
+	        $(MAKE) O=$$builddir $(1)_defconfig; \
+		$(MAKE) O=$$builddir $$target; \
+	        $(INSTALL_DIR) $$installdir; \
+	        $(INSTALL_FILE) $$builddir/$$target $$installdir; \
+	done ; \
+        $(INSTALL_FILE) $$builddir/u-boot $$installdir/uboot.elf; \
+        $(CROSS_COMPILE)strip --remove-section=.comment \
+            $$installdir/uboot.elf; \
+	$(MAKE) O=$$builddir HOSTCC=$(CROSS_COMPILE)gcc HOSTSTRIP=$(CROSS_COMPILE)strip env ; \
+	$(CROSS_COMPILE)strip --remove-section=.comment $$builddir/tools/env/fw_printenv ; \
+	installdir_tools=debian/$(tools_package)/usr/lib/$(package)/$(1); \
+	$(INSTALL_DIR) $$installdir_tools; \
+	$(INSTALL_PROGRAM) $$builddir/tools/env/fw_printenv $$installdir_tools ; \
+	ln -sf fw_printenv $$installdir_tools/fw_setenv ;
+endef
+
 build: build-arch build-indep
 build-arch:
 	$(checkdir)
@@ -49,24 +72,7 @@ build-arch:
 ifeq (true,$(u_boot_package))
 	set -e; sed -n 's/^$(DEB_HOST_ARCH)[[:space:]]\+//p' debian/targets \
 	    | while read platform targets; do \
-	        builddir=`pwd`/debian/build/$$platform; \
-	        installdir=debian/$(package)/usr/lib/$(package)/$$platform; \
-	        mkdir -p $$builddir; \
-		for target in $$targets ; do \
-	        $(MAKE) O=$$builddir $${platform}_defconfig; \
-		$(MAKE) O=$$builddir $$target; \
-	        $(INSTALL_DIR) $$installdir; \
-	        $(INSTALL_FILE) $$builddir/$$target $$installdir; \
-		done ; \
-	        $(INSTALL_FILE) $$builddir/u-boot $$installdir/uboot.elf; \
-	        $(CROSS_COMPILE)strip --remove-section=.comment \
-	            $$installdir/uboot.elf; \
-		$(MAKE) O=$$builddir HOSTCC=$(CROSS_COMPILE)gcc HOSTSTRIP=$(CROSS_COMPILE)strip env ; \
-		$(CROSS_COMPILE)strip --remove-section=.comment $$builddir/tools/env/fw_printenv ; \
-		installdir_tools=debian/$(tools_package)/usr/lib/$(package)/$$platform; \
-		$(INSTALL_DIR) $$installdir_tools; \
-		$(INSTALL_PROGRAM) $$builddir/tools/env/fw_printenv $$installdir_tools ; \
-		ln -sf fw_printenv $$installdir_tools/fw_setenv ; \
+		$(call BUILD_ONE,$${platform},$${targets}) \
 	done
 endif
 
-- 
2.1.0

From 43148f8c31f733fd5e8b224a7b31c22bc3bb7d19 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ijc@hellion.org.uk>
Date: Mon, 8 Sep 2014 10:22:14 +0100
Subject: [PATCH 2/2] Add support for specifying additional variants to build
 in debian/targets

Variants are given as $platform+$variant, initial implemented is +FEL which is
used for sunxi platforms to also build a FEL variant for all boards.

I'm worried that there may be too much makefile voodoo here...
---
 arch/mips/config.mk               |  4 ----
 arch/powerpc/config.mk            |  4 ----
 arch/x86/cpu/config.mk            |  2 +-
 board/Marvell/openrd/openrd.c     | 11 +++++++++
 debian/rules                      | 27 +++++++++++++++++----
 debian/targets                    |  7 +++---
 examples/standalone/mips.lds      |  4 ----
 include/compiler.h                |  4 ++--
 include/configs/am335x_evm.h      | 22 +++++++++++++++++-
 include/configs/guruplug.h        | 14 +++++++++++
 include/configs/mx53loco.h        |  3 +++
 include/configs/nokia_rx51.h      |  3 +++
 include/configs/sheevaplug.h      | 12 ++++++++++
 include/configs/ti_armv7_common.h |  1 +
 include/configs/udoo.h            | 49 ++++++++++++++++++++++++++++-----------
 include/configs/wandboard.h       | 49 ++++++++++++++++++++++++++++-----------
 tools/env/fw_env.c                |  1 +
 17 files changed, 167 insertions(+), 50 deletions(-)

diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index a2d07af..a1d2133 100644
--- a/arch/mips/config.mk
+++ b/arch/mips/config.mk
@@ -5,10 +5,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifeq ($(CROSS_COMPILE),)
-CROSS_COMPILE := mips_4KC-
-endif
-
 # Handle special prefix in ELDK 4.0 toolchain
 ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
 ENDIANNESS := -EL
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index 6329b6c..4c8b2ef 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -5,10 +5,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifeq ($(CROSS_COMPILE),)
-CROSS_COMPILE := ppc_8xx-
-endif
-
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections \
diff --git a/arch/x86/cpu/config.mk b/arch/x86/cpu/config.mk
index f7b01d3..83d7c50 100644
--- a/arch/x86/cpu/config.mk
+++ b/arch/x86/cpu/config.mk
@@ -7,7 +7,7 @@
 
 CROSS_COMPILE ?= i386-linux-
 
-PLATFORM_CPPFLAGS += -D__I386__ -Werror
+PLATFORM_CPPFLAGS += -D__I386__ -Werror -Wno-error=unused-but-set-variable
 
 # DO NOT MODIFY THE FOLLOWING UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!
 LDPPFLAGS += -DRESET_SEG_START=0xffff0000
diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c
index a005a2f..07a65d7 100644
--- a/board/Marvell/openrd/openrd.c
+++ b/board/Marvell/openrd/openrd.c
@@ -17,6 +17,9 @@
 #include <asm/arch/kirkwood.h>
 #include <asm/arch/mpp.h>
 #include "openrd.h"
+#ifdef CONFIG_MRVL_MMC
+#include <mrvl_mmc.h>
+#endif /* CONFIG_MRVL_MMC */
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -159,3 +162,11 @@ void reset_phy(void)
 #endif
 }
 #endif /* CONFIG_RESET_PHY_R */
+
+#ifdef CONFIG_MRVL_MMC
+int board_mmc_init(bd_t *bis)
+{
+       mrvl_mmc_init(bis);
+       return 0;
+}
+#endif /* CONFIG_MRVL_MMC */
diff --git a/debian/rules b/debian/rules
index fff1d4e..e37c9f7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -43,13 +43,16 @@ has_mtd_user := $(call check_include, mtd/mtd-user.h)
 build-indep:
 
 # $(1) := platform
-# $(2) := targets
+# $(2) := config name
+# $(2) := config tweak rune
+# $(3) := targets
 define BUILD_ONE
         builddir=`pwd`/debian/build/$(1); \
         installdir=debian/$(package)/usr/lib/$(package)/$(1); \
         mkdir -p $$builddir; \
-	for target in $(2) ; do \
-	        $(MAKE) O=$$builddir $(1)_defconfig; \
+        $(MAKE) O=$$builddir $(2)_defconfig; \
+	$(3); \
+	for target in $(4) ; do \
 		$(MAKE) O=$$builddir $$target; \
 	        $(INSTALL_DIR) $$installdir; \
 	        $(INSTALL_FILE) $$builddir/$$target $$installdir; \
@@ -65,6 +68,17 @@ define BUILD_ONE
 	ln -sf fw_printenv $$installdir_tools/fw_setenv ;
 endef
 
+COMMA := ,
+
+# $(1) := platform
+# $(2) := targets
+define BUILD_DEFAULT
+	$(call BUILD_ONE,$(1),$(1),:,$(2))
+endef
+define BUILD_FEL
+	$(call BUILD_ONE,$(1)_FEL,$(1),sed -i -e 's/^CONFIG_SYS_EXTRA_OPTIONS="[^"]*/&$(COMMA)SPL_FEL/g' $$builddir/.config,u-boot.bin spl/u-boot-spl.bin)
+endef
+
 build: build-arch build-indep
 build-arch:
 	$(checkdir)
@@ -72,7 +86,12 @@ build-arch:
 ifeq (true,$(u_boot_package))
 	set -e; sed -n 's/^$(DEB_HOST_ARCH)[[:space:]]\+//p' debian/targets \
 	    | while read platform targets; do \
-		$(call BUILD_ONE,$${platform},$${targets}) \
+		$(call BUILD_DEFAULT,$${platform%+*},$${targets}) \
+		case $${platform#*+} in \
+		FEL) $(call BUILD_FEL,$${platform%+*},$${targets});\
+		$${platform}) ;; \
+		*) echo "Unknown variant $${platform#*+}">&2; exit 1;;\
+		esac; \
 	done
 endif
 
diff --git a/debian/targets b/debian/targets
index 4242d98..b65d718 100644
--- a/debian/targets
+++ b/debian/targets
@@ -6,10 +6,9 @@ armel			guruplug	u-boot.kwb
 armel			openrd_ultimate	u-boot.kwb
 armel			rpi_b		u-boot.bin
 armel			sheevaplug	u-boot.kwb
-armhf			Bananapi	u-boot-sunxi-with-spl.bin
-armhf			Cubieboard	u-boot-sunxi-with-spl.bin
-armhf			Cubietruck	u-boot-sunxi-with-spl.bin
-armhf			Cubietruck_FEL	u-boot.bin spl/u-boot-spl.bin
+armhf			Bananapi+FEL	u-boot-sunxi-with-spl.bin
+armhf			Cubieboard+FEL	u-boot-sunxi-with-spl.bin
+armhf			Cubietruck+FEL	u-boot-sunxi-with-spl.bin
 armhf			am335x_boneblack u-boot.img spl/u-boot-spl.bin MLO
 armhf			igep0020	u-boot.bin spl/u-boot-spl.bin MLO
 armhf			mx51_efikamx	u-boot.imx
diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds
index 849f0aa..94370c9 100644
--- a/examples/standalone/mips.lds
+++ b/examples/standalone/mips.lds
@@ -5,10 +5,6 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 SECTIONS
 {
diff --git a/include/compiler.h b/include/compiler.h
index 9afc11b..c769909 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -15,7 +15,7 @@
     defined(__sun__)	 || \
     defined(__APPLE__)
 # include <inttypes.h>
-#elif defined(__linux__) || defined(__WIN32__) || defined(__MINGW32__)
+#elif defined(__linux__) || defined(__WIN32__) || defined(__MINGW32__) || defined(__GLIBC__)
 # include <stdint.h>
 #endif
 
@@ -41,7 +41,7 @@
 #define O_BINARY	0
 #endif
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
 # include <endian.h>
 # include <byteswap.h>
 #elif defined(__MACH__) || defined(__FreeBSD__)
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index df1a6fc..9e97254 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -115,7 +115,7 @@
 		"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
 		"ip=dhcp\0" \
 	"bootenv=uEnv.txt\0" \
-	"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+	"loadbootenv=load mmc ${bootpart} ${loadaddr} ${bootenv}\0" \
 	"importbootenv=echo Importing environment from mmc ...; " \
 		"env import -t -r $loadaddr $filesize\0" \
 	"ramargs=setenv bootargs console=${console} " \
@@ -125,6 +125,12 @@
 	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
 	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
 	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+	"script=boot.scr\0" \
+	"scriptfile=${script}\0" \
+	"loadbootscript=" \
+		"load mmc ${bootpart} ${loadaddr} ${scriptfile};\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"source ${loadaddr}\0" \
 	"mmcloados=run mmcargs; " \
 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
 			"if run loadfdt; then " \
@@ -150,6 +156,16 @@
 				"echo Running uenvcmd ...;" \
 				"run uenvcmd;" \
 			"fi;" \
+			"setenv scriptfile ${script};" \
+			"if run loadbootscript; then " \
+				"echo Loaded script from ${scriptfile};" \
+				"run bootscript;" \
+			"fi;" \
+			"setenv scriptfile /boot/${script};" \
+			"if run loadbootscript; then " \
+				"echo Loaded script from ${scriptfile};" \
+				"run bootscript;" \
+			"fi;" \
 			"if run loadimage; then " \
 				"run mmcloados;" \
 			"fi;" \
@@ -187,9 +203,13 @@
 #define CONFIG_BOOTCOMMAND \
 	"run findfdt; " \
 	"run mmcboot;" \
+	"setenv bootpart 0:1; " \
+	"run mmcboot;" \
 	"setenv mmcdev 1; " \
 	"setenv bootpart 1:2; " \
 	"run mmcboot;" \
+	"setenv bootpart 1:1; " \
+	"run mmcboot;" \
 	"run nandboot;"
 
 /* NS16550 Configuration */
diff --git a/include/configs/guruplug.h b/include/configs/guruplug.h
index a56a4cb..23e00c2 100644
--- a/include/configs/guruplug.h
+++ b/include/configs/guruplug.h
@@ -26,6 +26,15 @@
  * Commands configuration
  */
 #define CONFIG_SYS_NO_FLASH		/* Declare no flash (NOR/SPI) */
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE               /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_LZO
+
 #include <config_cmd_default.h>
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ENV
@@ -91,4 +100,9 @@
 
 #define CONFIG_SYS_ALT_MEMTEST
 
+#ifdef CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_MV_SDIO
+#endif /* CONFIG_CMD_MMC */
+
 #endif /* _CONFIG_GURUPLUG_H */
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index a74508c..36498ea 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -45,6 +45,8 @@
 #define CONFIG_GENERIC_MMC
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_DOS_PARTITION
 
 /* Eth Configs */
@@ -94,6 +96,7 @@
 /* Command definition */
 #include <config_cmd_default.h>
 #define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
 
 #undef CONFIG_CMD_IMLS
 
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 982b689..8e1581e 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -135,6 +135,9 @@
 #define CONFIG_CMD_BOOTMENU		/* ANSI terminal Boot Menu */
 #define CONFIG_CMD_CLEAR		/* ANSI terminal clear screen command */
 
+#define CONFIG_CMD_BOOTZ       /* boot zImage                  */
+#define CONFIG_SUPPORT_RAW_INITRD
+
 #ifdef ONENAND_SUPPORT
 
 #define CONFIG_CMD_ONENAND		/* ONENAND support */
diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 4747adf..842053d 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -29,6 +29,7 @@
 #include <config_cmd_default.h>
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ENV
+#define CONFIG_CMD_IDE
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_MMC
 #define CONFIG_CMD_NAND
@@ -105,4 +106,15 @@
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_LZO
 
+/*
+ * SATA driver configuration
+ */
+#ifdef CONFIG_CMD_IDE
+#define __io
+#define CONFIG_IDE_PREINIT
+#define CONFIG_DOS_PARTITION
+#define CONFIG_MVSATA_IDE_USE_PORT0
+#define CONFIG_SYS_ATA_IDE0_OFFSET     MV_SATA_PORT0_OFFSET
+#endif /* CONFIG_CMD_IDE */
+
 #endif /* _CONFIG_SHEEVAPLUG_H */
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index 85171db..7d07bcd 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -174,6 +174,7 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_ECHO
 #define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
 
 /*
  * Common filesystems support.  When we have removable storage we
diff --git a/include/configs/udoo.h b/include/configs/udoo.h
index 700e9c1..36f98dd 100644
--- a/include/configs/udoo.h
+++ b/include/configs/udoo.h
@@ -95,6 +95,8 @@
 #define CONFIG_GENERIC_MMC
 #define CONFIG_BOUNCE_BUFFER
 #define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 
@@ -130,12 +132,16 @@
 		"fi\0" \
 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
 		"root=${mmcroot}\0" \
+	"loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt\0" \
+	"importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
+		"env import -t $loadaddr $filesize\0" \
 	"loadbootscript=" \
-		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+		"load 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" \
+	"loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+	"loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage\0" \
+	"loadfdt=load 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 " \
@@ -177,16 +183,32 @@
 		"fi;\0"
 
 #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"
+	"mmc dev ${mmcdev};" \
+	"if mmc rescan; then " \
+		"echo SD/MMC found on device ${mmcdev};" \
+		"if run loadbootenv; then " \
+			"run importbootenv;" \
+		"fi;" \
+		"echo Checking if uenvcmd is set ...;" \
+		"if test -n $uenvcmd; then " \
+			"echo Running uenvcmd ...;" \
+			"run uenvcmd;" \
+		"fi;" \
+		"if run loadbootscript; then " \
+			"echo Running boot script ${script} ...;" \
+			"run bootscript; " \
+		"fi;" \
+		"setenv script /boot/${script};" \
+		"if run loadbootscript; then " \
+			"echo Running boot script ${script} ...;" \
+			"run bootscript; " \
+		"fi;" \
+		"echo Running default loadzimage ...;" \
+		"if run loadzimage; then " \
+			"run loadfdt;" \
+			"run mmcboot;" \
+		"fi;" \
+	"fi;"
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP
@@ -228,6 +250,7 @@
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
 
 #ifndef CONFIG_SYS_DCACHE_OFF
 #define CONFIG_CMD_CACHE
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 7d96908..7e0ab94 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -76,6 +76,8 @@
 #define CONFIG_BOUNCE_BUFFER
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_DOS_PARTITION
 
 /* Ethernet Configuration */
@@ -172,12 +174,16 @@
 			"echo '- no FWBADAPT-7WVGA-LCD-F07A-0102 display';" \
 		"fi; " \
 		"setenv bootargs ${bootargs} ${fbmem}\0" \
+	"loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt\0" \
+	"importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
+		"env import -t $loadaddr $filesize\0" \
 	"loadbootscript=" \
-		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+		"load 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" \
+	"loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+	"loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage\0" \
+	"loadfdt=load 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 " \
@@ -219,16 +225,32 @@
 		"fi;\0"
 
 #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"
+	"mmc dev ${mmcdev};" \
+	"if mmc rescan; then " \
+		"echo SD/MMC found on device ${mmcdev};" \
+		"if run loadbootenv; then " \
+			"run importbootenv;" \
+		"fi;" \
+		"echo Checking if uenvcmd is set ...;" \
+		"if test -n $uenvcmd; then " \
+			"echo Running uenvcmd ...;" \
+			"run uenvcmd;" \
+		"fi;" \
+		"if run loadbootscript; then " \
+			"echo Running boot script ${script} ...;" \
+			"run bootscript; " \
+		"fi;" \
+		"setenv script /boot/${script};" \
+		"if run loadbootscript; then " \
+			"echo Running boot script ${script} ...;" \
+			"run bootscript; " \
+		"fi;" \
+		"echo Running default loadzimage ...;" \
+		"if run loadzimage; then " \
+			"run loadfdt;" \
+			"run mmcboot;" \
+		"fi;" \
+	"fi;"
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP
@@ -269,6 +291,7 @@
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
 
 #ifndef CONFIG_SYS_DCACHE_OFF
 #define CONFIG_CMD_CACHE
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 30d5b03..c54658f 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -20,6 +20,7 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <linux/kconfig.h>
 
 #ifdef MTD_OLD
 # include <stdint.h>
-- 
2.1.0


Reply to: