xref: /openbmc/u-boot/common/board_info.c (revision ef64e782)
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #include <common.h>
4 #include <linux/libfdt.h>
5 #include <linux/compiler.h>
6 
7 int __weak checkboard(void)
8 {
9 	return 0;
10 }
11 
12 /*
13  * If the root node of the DTB has a "model" property, show it.
14  * Then call checkboard().
15  */
16 int __weak show_board_info(void)
17 {
18 #ifdef CONFIG_OF_CONTROL
19 	DECLARE_GLOBAL_DATA_PTR;
20 	const char *model;
21 
22 	model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
23 
24 	if (model)
25 		printf("Model: %s\n", model);
26 #endif
27 
28 	return checkboard();
29 }
30