4bad927
From 4326956e87cbfc913b19dd735b534610cd2b38e6 Mon Sep 17 00:00:00 2001
4b8ad3f
From: Vagrant Cascadian <vagrant@debian.org>
4b8ad3f
Date: Wed, 1 Oct 2014 13:28:18 -0700
4bad927
Subject: [PATCH 07/12] Switch am335x_evm.h to use config_distro_defaults and
4b8ad3f
 config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as
4b8ad3f
 scriptaddr is used for boot scripts in config_distro_defaults.
4b8ad3f
4b8ad3f
---
4b8ad3f
 include/configs/am335x_evm.h      | 26 +++++++++++++++++---------
4b8ad3f
 include/configs/ti_armv7_common.h |  1 +
4b8ad3f
 2 files changed, 18 insertions(+), 9 deletions(-)
4b8ad3f
4b8ad3f
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
4b8ad3f
index e2f7ead..b25d990 100644
4b8ad3f
--- a/include/configs/am335x_evm.h
4b8ad3f
+++ b/include/configs/am335x_evm.h
4b8ad3f
@@ -18,6 +18,21 @@
4b8ad3f
 
4b8ad3f
 #include <configs/ti_am335x_common.h>
4b8ad3f
 
4b8ad3f
+#include <config_distro_defaults.h>
4b8ad3f
+
4b8ad3f
+#define BOOTENV_BOOT_PARTITIONS "2"
4b8ad3f
+
4b8ad3f
+#define BOOTENV_INIT_COMMAND "run findfdt ;"
4b8ad3f
+#ifdef CONFIG_NAND
4b8ad3f
+#define BOOTENV_POST_COMMAND "run nandboot ;"
4b8ad3f
+#endif
4b8ad3f
+
4b8ad3f
+#define BOOT_TARGET_DEVICES(func) \
4b8ad3f
+	func(MMC, mmc, 0) \
4b8ad3f
+	func(MMC, mmc, 1)
4b8ad3f
+
4b8ad3f
+#include <config_distro_bootcmd.h>
4b8ad3f
+
4b8ad3f
 #ifndef CONFIG_SPL_BUILD
4b8ad3f
 # define CONFIG_FIT
4b8ad3f
 # define CONFIG_TIMESTAMP
4b8ad3f
@@ -185,17 +200,10 @@
4b8ad3f
 		"if test $fdtfile = undefined; then " \
4b8ad3f
 			"echo WARNING: Could not determine device tree to use; fi; \0" \
4b8ad3f
 	NANDARGS \
4b8ad3f
-	DFUARGS
4b8ad3f
+	DFUARGS \
4b8ad3f
+	BOOTENV
4b8ad3f
 #endif
4b8ad3f
 
4b8ad3f
-#define CONFIG_BOOTCOMMAND \
4b8ad3f
-	"run findfdt; " \
4b8ad3f
-	"run mmcboot;" \
4b8ad3f
-	"setenv mmcdev 1; " \
4b8ad3f
-	"setenv bootpart 1:2; " \
4b8ad3f
-	"run mmcboot;" \
4b8ad3f
-	"run nandboot;"
4b8ad3f
-
4b8ad3f
 /* NS16550 Configuration */
4b8ad3f
 #define CONFIG_SYS_NS16550_COM1		0x44e09000	/* Base EVM has UART0 */
4b8ad3f
 #define CONFIG_SYS_NS16550_COM2		0x48022000	/* UART1 */
4b8ad3f
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
4b8ad3f
index 85171db..f405fea 100644
4b8ad3f
--- a/include/configs/ti_armv7_common.h
4b8ad3f
+++ b/include/configs/ti_armv7_common.h
4b8ad3f
@@ -54,6 +54,7 @@
4b8ad3f
 #define DEFAULT_LINUX_BOOT_ENV \
4b8ad3f
 	"loadaddr=0x82000000\0" \
4b8ad3f
 	"kernel_addr_r=0x82000000\0" \
4b8ad3f
+	"scriptaddr=0x82000000\0" \
4b8ad3f
 	"fdtaddr=0x88000000\0" \
4b8ad3f
 	"fdt_addr_r=0x88000000\0" \
4b8ad3f
 	"rdaddr=0x88080000\0" \
4b8ad3f
-- 
4b8ad3f
2.1.0
4b8ad3f