1 // SPDX-License-Identifier: GPL-2.0+
6 #include <asm/global_data.h>
7 #include <linux/libfdt.h>
8 #include <linux/compiler.h>
10 DECLARE_GLOBAL_DATA_PTR;
12 int __weak checkboard(void)
17 static const struct to_show {
21 { "Manufacturer", SYSINFO_ID_BOARD_MANUFACTURER},
22 { "Prior-stage version", SYSINFO_ID_PRIOR_STAGE_VERSION },
23 { "Prior-stage date", SYSINFO_ID_PRIOR_STAGE_DATE },
27 static int try_sysinfo(void)
33 /* This might provide more detail */
34 ret = sysinfo_get(&dev);
38 ret = sysinfo_detect(dev);
42 ret = sysinfo_get_str(dev, SYSINFO_ID_BOARD_MODEL, sizeof(str), str);
45 printf("Model: %s\n", str);
47 if (IS_ENABLED(CONFIG_SYSINFO_EXTRA)) {
48 const struct to_show *item;
50 for (item = to_show; item->id; item++) {
51 ret = sysinfo_get_str(dev, item->id, sizeof(str), str);
53 printf("%s: %s\n", item->name, str);
60 int show_board_info(void)
62 if (IS_ENABLED(CONFIG_OF_CONTROL)) {
65 if (IS_ENABLED(CONFIG_SYSINFO))
68 /* Fail back to the main 'model' if available */
72 model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
74 printf("Model: %s\n", model);