diff mbox

[U-Boot] ARM: DRA7xx: Update the board_name env variable

Message ID 1405348078-10971-1-git-send-email-lokeshvutla@ti.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Lokesh Vutla July 14, 2014, 2:27 p.m. UTC
Update the board_name env variable and accordingly
populate the dtb file.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 board/ti/dra7xx/evm.c             |    6 ++++++
 include/configs/ti_omap5_common.h |    3 +++
 2 files changed, 9 insertions(+)

Comments

Tom Rini July 14, 2014, 3:20 p.m. UTC | #1
On Mon, Jul 14, 2014 at 07:57:58PM +0530, Lokesh Vutla wrote:

> Update the board_name env variable and accordingly
> populate the dtb file.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

Applied to u-boot/master, thanks!

... but I'd really like to see if we can figure something better out
moving forward.  We're tying the SoC to the board when that's not always
true and thus making things less clear when its time to make a custom
board what goes where.
diff mbox

Patch

diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 073d151..7f19655 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -82,6 +82,12 @@  int board_init(void)
 
 int board_late_init(void)
 {
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+	if (omap_revision() == DRA722_ES1_0)
+		setenv("board_name", "dra72x");
+	else
+		setenv("board_name", "dra7xx");
+#endif
 	init_sata(0);
 	return 0;
 }
diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h
index a582fa4..cb928ab 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -67,6 +67,7 @@ 
 #define PARTS_DEFAULT
 #endif
 
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
 	"console=" CONSOLEDEV ",115200n8\0" \
@@ -116,6 +117,8 @@ 
 			"setenv fdtfile omap5-uevm.dtb; fi; " \
 		"if test $board_name = dra7xx; then " \
 			"setenv fdtfile dra7-evm.dtb; fi;" \
+		"if test $board_name = dra72x; then " \
+			"setenv fdtfile dra72-evm.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" \