blob: a6db087f960453cd2041ba1970ccf0986ba40920 [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>
Simon Glass97589732020-05-10 11:40:02 -06004#include <init.h>
Masahiro Yamada75f82d02018-03-05 01:20:11 +09005#include <linux/libfdt.h>
Masahiro Yamada9607f7a2015-01-14 17:07:05 +09006#include <linux/compiler.h>
7
8int __weak checkboard(void)
9{
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090010 return 0;
11}
12
13/*
14 * If the root node of the DTB has a "model" property, show it.
Haikun.Wang@freescale.com7f7335e2015-07-09 19:58:03 +080015 * Then call checkboard().
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090016 */
Marcel Ziswiler6e8bc1a2016-11-16 17:49:20 +010017int __weak show_board_info(void)
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090018{
Marcel Ziswiler7c701b32016-11-16 17:49:19 +010019#ifdef CONFIG_OF_CONTROL
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090020 DECLARE_GLOBAL_DATA_PTR;
21 const char *model;
22
23 model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
24
Haikun.Wang@freescale.com7f7335e2015-07-09 19:58:03 +080025 if (model)
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090026 printf("Model: %s\n", model);
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090027#endif
28
29 return checkboard();
30}