blob: b54aa30a94426457edb2520ad80b918a316398f9 [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>
Simon Glass3ba929a2020-10-30 21:38:53 -06005#include <asm/global_data.h>
Masahiro Yamada75f82d02018-03-05 01:20:11 +09006#include <linux/libfdt.h>
Masahiro Yamada9607f7a2015-01-14 17:07:05 +09007#include <linux/compiler.h>
8
9int __weak checkboard(void)
10{
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090011 return 0;
12}
13
14/*
15 * If the root node of the DTB has a "model" property, show it.
Haikun.Wang@freescale.com7f7335e2015-07-09 19:58:03 +080016 * Then call checkboard().
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090017 */
Marcel Ziswiler6e8bc1a2016-11-16 17:49:20 +010018int __weak show_board_info(void)
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090019{
Marcel Ziswiler7c701b32016-11-16 17:49:19 +010020#ifdef CONFIG_OF_CONTROL
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090021 DECLARE_GLOBAL_DATA_PTR;
22 const char *model;
23
24 model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
25
Haikun.Wang@freescale.com7f7335e2015-07-09 19:58:03 +080026 if (model)
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090027 printf("Model: %s\n", model);
Masahiro Yamada9607f7a2015-01-14 17:07:05 +090028#endif
29
30 return checkboard();
31}