2cbdff5
From 2080f6a04c624b414b8934c7717b40836ed4dbcd Mon Sep 17 00:00:00 2001
7a2a318
From: Peter Robinson <pbrobinson@gmail.com>
7a2a318
Date: Fri, 6 Mar 2015 10:38:05 +0000
2cbdff5
Subject: [PATCH 07/14] Switch omap4 boards to use config_distro_defaults and
425d5f0
 config_distro_bootcmd.
425d5f0
7a2a318
 Add pxefile_addr_r to DEFAULT_LINUX_BOOT_ENV, as pxefile_addr_r  is used
7a2a318
 to store the pxe boot configuation file in config_distro_defaults.
7a2a318
 adjust adress of scriptaddr to be unique
425d5f0
---
425d5f0
 include/configs/ti_armv7_common.h |  3 ++-
7a2a318
 include/configs/ti_omap4_common.h | 39 ++++++++++++++++-----------------------
7a2a318
 2 files changed, 18 insertions(+), 24 deletions(-)
425d5f0
425d5f0
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
2cbdff5
index b6e37b3..d1e259e 100644
425d5f0
--- a/include/configs/ti_armv7_common.h
425d5f0
+++ b/include/configs/ti_armv7_common.h
425d5f0
@@ -54,7 +54,8 @@
425d5f0
 #define DEFAULT_LINUX_BOOT_ENV \
425d5f0
 	"loadaddr=0x82000000\0" \
425d5f0
 	"kernel_addr_r=0x82000000\0" \
425d5f0
-	"scriptaddr=0x82000000\0" \
425d5f0
+	"pxefile_addr_r=0x87F00000\0" \
425d5f0
+	"scriptaddr=0x87E00000\0" \
425d5f0
 	"fdtaddr=0x88000000\0" \
425d5f0
 	"fdt_addr_r=0x88000000\0" \
425d5f0
 	"rdaddr=0x88080000\0" \
425d5f0
diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
7a2a318
index 1c93aab..5402793 100644
425d5f0
--- a/include/configs/ti_omap4_common.h
425d5f0
+++ b/include/configs/ti_omap4_common.h
7a2a318
@@ -82,6 +82,18 @@
425d5f0
 #undef CONFIG_CMD_NET
425d5f0
 #undef CONFIG_CMD_NFS
425d5f0
 
425d5f0
+#ifndef CONFIG_SPL_BUILD
425d5f0
+#include <config_distro_defaults.h>
425d5f0
+#include <config_distro_bootcmd.h>
425d5f0
+
425d5f0
+#define BOOTENV_INIT_COMMAND "run findfdt ;"
425d5f0
+
425d5f0
+#define BOOT_TARGET_DEVICES(func) \
425d5f0
+       func(MMC, mmc, 0) \
425d5f0
+       func(USB, usb, 0) \
425d5f0
+       func(PXE, pxe, na) \
425d5f0
+       func(DHCP, dhcp, na)
425d5f0
+
425d5f0
 /*
425d5f0
  * Environment setup
425d5f0
  */
7a2a318
@@ -129,30 +141,11 @@
425d5f0
 		"if test $fdtfile = undefined; then " \
425d5f0
 			"echo WARNING: Could not determine device tree to use; fi; \0" \
425d5f0
 	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
425d5f0
+	BOOTENV
425d5f0
 
425d5f0
-#define CONFIG_BOOTCOMMAND \
425d5f0
-	"run findfdt; " \
425d5f0
-	"mmc dev ${mmcdev}; if mmc rescan; then " \
425d5f0
-		"echo SD/MMC found on device ${mmcdev};" \
425d5f0
-		"if run loadbootscript; then " \
425d5f0
-			"run bootscript; " \
425d5f0
-		"else " \
425d5f0
-			"if run loadbootenv; then " \
425d5f0
-				"run importbootenv; " \
425d5f0
-			"fi;" \
425d5f0
-			"if test -n ${uenvcmd}; then " \
425d5f0
-				"echo Running uenvcmd ...;" \
425d5f0
-				"run uenvcmd;" \
425d5f0
-			"fi;" \
425d5f0
-		"fi;" \
425d5f0
-		"if run loadimage; then " \
425d5f0
-			"run loadfdt;" \
425d5f0
-			"run mmcboot; " \
425d5f0
-		"fi; " \
425d5f0
-		"if run loaduimage; then " \
425d5f0
-			"run uimageboot;" \
425d5f0
-		"fi; " \
425d5f0
-	"fi"
425d5f0
+#else
425d5f0
+#define BOOT_TARGET_DEVICES
425d5f0
+#endif
425d5f0
 
425d5f0
 /*
425d5f0
  * Defines for SPL
425d5f0
-- 
2cbdff5
2.3.2
425d5f0