blob: a6db087f960453cd2041ba1970ccf0986ba40920 [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>
Simon Glass691d7192020-05-10 11:40:02 -06004#include <init.h>
Masahiro Yamadab08c8c42018-03-05 01:20:11 +09005#include <linux/libfdt.h>
Masahiro Yamada0365ffc2015-01-14 17:07:05 +09006#include <linux/compiler.h>
7
8int __weak checkboard(void)
9{
Masahiro Yamada0365ffc2015-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.comdac326b2015-07-09 19:58:03 +080015 * Then call checkboard().
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090016 */
Marcel Ziswilerf7637cc2016-11-16 17:49:20 +010017int __weak show_board_info(void)
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090018{
Marcel Ziswiler62e7a5c2016-11-16 17:49:19 +010019#ifdef CONFIG_OF_CONTROL
Masahiro Yamada0365ffc2015-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.comdac326b2015-07-09 19:58:03 +080025 if (model)
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090026 printf("Model: %s\n", model);
Masahiro Yamada0365ffc2015-01-14 17:07:05 +090027#endif
28
29 return checkboard();
30}