blob: 42d0641294a86c0c632213dd8a1ed52e96bbd7be [file] [log] [blame]
Masahiro Yamada0365ffc2015-01-14 17:07:05 +09001/*
2 * SPDX-License-Identifier: GPL-2.0+
3 */
4
5#include <common.h>
6#include <libfdt.h>
7#include <linux/compiler.h>
8
9int __weak checkboard(void)
10{
11 printf("Board: Unknown\n");
12 return 0;
13}
14
15/*
16 * If the root node of the DTB has a "model" property, show it.
17 * If CONFIG_OF_CONTROL is disabled or the "model" property is missing,
18 * fall back to checkboard().
19 */
20int show_board_info(void)
21{
22#ifdef CONFIG_OF_CONTROL
23 DECLARE_GLOBAL_DATA_PTR;
24 const char *model;
25
26 model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
27
28 if (model) {
29 printf("Model: %s\n", model);
30 return 0;
31 }
32#endif
33
34 return checkboard();
35}