public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: rpi: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support
@ 2015-08-18 14:03 Guillaume GARDET
  2015-08-19  3:14 ` Stephen Warren
  0 siblings, 1 reply; 9+ messages in thread
From: Guillaume GARDET @ 2015-08-18 14:03 UTC (permalink / raw)
  To: u-boot

Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support to set 'board_rev' and 
'board_name' envs.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>

Cc: Stephen Warren <swarren@wwwdotorg.org>

---
 board/raspberrypi/rpi/rpi.c  | 6 ++++++
 include/configs/rpi-common.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index d21750e..b61ff67 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -240,6 +240,12 @@ int misc_init_r(void)
 {
 	set_fdtfile();
 	set_usbethaddr();
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+	char str_rev[11];
+	sprintf(str_rev, "0x%X", rpi_board_rev);
+	setenv("board_rev", str_rev);
+	setenv("board_name", models[rpi_board_rev].name);
+#endif
 	return 0;
 }
 
diff --git a/include/configs/rpi-common.h b/include/configs/rpi-common.h
index 8830a10..17237cf 100644
--- a/include/configs/rpi-common.h
+++ b/include/configs/rpi-common.h
@@ -133,6 +133,7 @@
 #include <config_distro_defaults.h>
 
 /* Environment */
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define ENV_DEVICE_SETTINGS \
 	"stdin=serial,lcd\0" \
 	"stdout=serial,lcd\0" \
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-24 21:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 14:03 [U-Boot] [PATCH] ARM: rpi: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support Guillaume GARDET
2015-08-19  3:14 ` Stephen Warren
2015-08-21  9:47   ` Guillaume Gardet
2015-08-26  1:34     ` Stephen Warren
2015-08-26  1:46       ` Ian Lepore
2015-08-26  1:59         ` Stephen Warren
2015-08-25 13:10   ` [U-Boot] [PATCH V2] " Guillaume GARDET
2015-08-26  1:40     ` Stephen Warren
2015-10-24 21:15     ` [U-Boot] [U-Boot, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox