blob: a392bece62c695aa25b4235d5974532fd5bc72d8 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Masahiro Yamada9607f7a2015-01-14 17:07:05 +09002
3#include <common.h>
Masahiro Yamada75f82d02018-03-05 01:20:11 +09004#include <linux/libfdt.h>
Masahiro Yamada9607f7a2015-01-14 17:07:05 +09005#include <linux/compiler.h>
6
7int __weak checkboard(void)
8{
Masahiro Yamada9607f7a2015-01-14 17:07:05 +09009 return 0;
10}
11
12/*
13 * If the root node of the DTB has a "model" property, show it.
Haikun.Wang@freescale.com7f7335e2015-07-09 19:58:03 +080014 * Then call checkboard().
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090015 */
Marcel Ziswiler6e8bc1a2016-11-16 17:49:20 +010016int __weak show_board_info(void)
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090017{
Marcel Ziswiler7c701b32016-11-16 17:49:19 +010018#ifdef CONFIG_OF_CONTROL
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090019 DECLARE_GLOBAL_DATA_PTR;
20 const char *model;
21
22 model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
23
Haikun.Wang@freescale.com7f7335e2015-07-09 19:58:03 +080024 if (model)
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090025 printf("Model: %s\n", model);
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090026#endif
27
28 return checkboard();
29}