From 0686fe0edf2ec37b109c9b787985858b4b6a6bb7 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 3 Jun 2013 15:04:21 +0200 Subject: add function to get boardinfo string When using devicetrees the boardinfo (or model) can be obtained from the devicetree. Add a function to get the boardinfo so that we have a chance to add information from the devicetree. Signed-off-by: Sascha Hauer --- common/misc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'common/misc.c') diff --git a/common/misc.c b/common/misc.c index e9fdacc655..806649431d 100644 --- a/common/misc.c +++ b/common/misc.c @@ -125,3 +125,20 @@ EXPORT_SYMBOL(perror); void (*do_execute)(void *func, int argc, char *argv[]); EXPORT_SYMBOL(do_execute); + +static const char *boardinfo; + +const char *barebox_boardinfo(void) +{ + if (boardinfo) + return boardinfo; + + boardinfo = of_get_model(); + if (boardinfo) + boardinfo = xstrdup(boardinfo); + else + boardinfo = CONFIG_BOARDINFO; + + return boardinfo; +} +EXPORT_SYMBOL(barebox_boardinfo); -- cgit v1.2.3