summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-19 11:29:02 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-03-22 09:14:02 +0100
commite96dc23280c43dd6b026ea71bcbaf3353abb4c83 (patch)
tree3d7cda1a4e7d3a447e99a788bbf11104b894a956 /common
parentd84ada844b2fdf99a3b394ded66d9b44f5909f9e (diff)
downloadbarebox-e96dc23280c43dd6b026ea71bcbaf3353abb4c83.tar.gz
barebox-e96dc23280c43dd6b026ea71bcbaf3353abb4c83.tar.xz
of: Pass barebox version to kernel
Pass the barebox version to Linux in case somebody is interested in it under Linux. We use put the version under /chosen/barebox-version and it can be read under Linux in /sys/firmware/devicetree/base/chosen/barebox-version. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/Makefile2
-rw-r--r--common/oftree.c1
-rw-r--r--common/version.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/common/Makefile b/common/Makefile
index a9abcd1bc6..4e9681f203 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -11,7 +11,7 @@ obj-y += bootsource.o
obj-y += restart.o
obj-y += poweroff.o
obj-$(CONFIG_AUTO_COMPLETE) += complete.o
-obj-$(CONFIG_BANNER) += version.o
+obj-y += version.o
obj-$(CONFIG_BAREBOX_UPDATE) += bbu.o
obj-$(CONFIG_BINFMT) += binfmt.o
obj-$(CONFIG_BLOCK) += block.o
diff --git a/common/oftree.c b/common/oftree.c
index 40eb35f188..8a2ede4c60 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -128,6 +128,7 @@ static int of_fixup_bootargs(struct device_node *root, void *unused)
if (!node)
return -ENOMEM;
+ of_property_write_string(node, "barebox-version", release_string);
err = of_property_write_string(node, "bootargs", str);
diff --git a/common/version.c b/common/version.c
index f37cb5527f..8b1fd4dbe7 100644
--- a/common/version.c
+++ b/common/version.c
@@ -10,6 +10,7 @@ const char release_string[] =
"barebox-" UTS_RELEASE;
EXPORT_SYMBOL(release_string);
+#ifdef CONFIG_BANNER
void barebox_banner (void)
{
printf("\n\n");
@@ -17,3 +18,4 @@ void barebox_banner (void)
printf("\n\n");
pr_info("Board: %s\n", barebox_get_model());
}
+#endif