summaryrefslogtreecommitdiffstats
path: root/board/raspberrypi/rpi
diff options
context:
space:
mode:
authorGuillaume GARDET <guillaume.gardet@free.fr>2015-08-25 15:10:26 +0200
committerTom Rini <trini@konsulko.com>2015-10-24 13:50:30 -0400
commitbff78567da51eee433e0e76a87edc5f0a03a0d8d (patch)
tree385ff6fb8a92cba29ef5fc39bf4993706b86fd53 /board/raspberrypi/rpi
parent13cfbe51357bf3275b14046e0031ea2b7fdaf8ce (diff)
downloadu-boot-bff78567da51eee433e0e76a87edc5f0a03a0d8d.tar.gz
u-boot-bff78567da51eee433e0e76a87edc5f0a03a0d8d.tar.xz
u-boot-bff78567da51eee433e0e76a87edc5f0a03a0d8d.zip
ARM: rpi: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support
Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support and enable it to set 'board_rev' and 'board_name' envs. 'board_rev' can be used in scripts to determine what board we are running on and 'board_name' for pretty printing. Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Cc: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Diffstat (limited to 'board/raspberrypi/rpi')
-rw-r--r--board/raspberrypi/rpi/rpi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 942badb087..6451d1d916 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -242,10 +242,23 @@ static void set_usbethaddr(void)
return;
}
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+static void set_board_info(void)
+{
+ 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 /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */
+
int misc_init_r(void)
{
set_fdtfile();
set_usbethaddr();
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+ set_board_info();
+#endif
return 0;
}