Masahiro Yamada | 9607f7a | 2015-01-14 17:07:05 +0900 | [diff] [blame] | 1 | /* |
| 2 | * SPDX-License-Identifier: GPL-2.0+ |
| 3 | */ |
| 4 | |
| 5 | #include <common.h> |
| 6 | #include <libfdt.h> |
| 7 | #include <linux/compiler.h> |
| 8 | |
| 9 | int __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. |
Haikun.Wang@freescale.com | 7f7335e | 2015-07-09 19:58:03 +0800 | [diff] [blame] | 17 | * Then call checkboard(). |
Masahiro Yamada | 9607f7a | 2015-01-14 17:07:05 +0900 | [diff] [blame] | 18 | */ |
| 19 | int show_board_info(void) |
| 20 | { |
| 21 | #ifdef CONFIG_OF_CONTROL |
| 22 | DECLARE_GLOBAL_DATA_PTR; |
| 23 | const char *model; |
| 24 | |
| 25 | model = fdt_getprop(gd->fdt_blob, 0, "model", NULL); |
| 26 | |
Haikun.Wang@freescale.com | 7f7335e | 2015-07-09 19:58:03 +0800 | [diff] [blame] | 27 | if (model) |
Masahiro Yamada | 9607f7a | 2015-01-14 17:07:05 +0900 | [diff] [blame] | 28 | printf("Model: %s\n", model); |
Masahiro Yamada | 9607f7a | 2015-01-14 17:07:05 +0900 | [diff] [blame] | 29 | #endif |
| 30 | |
| 31 | return checkboard(); |
| 32 | } |