blob: a392bece62c695aa25b4235d5974532fd5bc72d8 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Masahiro Yamada0365ffc2015-01-14 17:07:05 +09002
3#include <common.h>
Masahiro Yamadab08c8c42018-03-05 01:20:11 +09004#include <linux/libfdt.h>
Masahiro Yamada0365ffc2015-01-14 17:07:05 +09005#include <linux/compiler.h>
6
7int __weak checkboard(void)
8{
Masahiro Yamada0365ffc2015-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.comdac326b2015-07-09 19:58:03 +080014 * Then call checkboard().
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090015 */
Marcel Ziswilerf7637cc2016-11-16 17:49:20 +010016int __weak show_board_info(void)
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090017{
Marcel Ziswiler62e7a5c2016-11-16 17:49:19 +010018#ifdef CONFIG_OF_CONTROL
Masahiro Yamada0365ffc2015-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.comdac326b2015-07-09 19:58:03 +080024 if (model)
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090025 printf("Model: %s\n", model);
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090026#endif
27
28 return checkboard();
29}