mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-17 14:18:14 +01:00
Move this comment to its prototype and tidy it up a bit. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
51 lines
919 B
C
51 lines
919 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <init.h>
|
|
#include <sysinfo.h>
|
|
#include <asm/global_data.h>
|
|
#include <linux/libfdt.h>
|
|
#include <linux/compiler.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
int __weak checkboard(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int __weak show_board_info(void)
|
|
{
|
|
if (IS_ENABLED(CONFIG_OF_CONTROL)) {
|
|
struct udevice *dev;
|
|
const char *model;
|
|
char str[80];
|
|
int ret = -ENOSYS;
|
|
|
|
if (IS_ENABLED(CONFIG_SYSINFO)) {
|
|
/* This might provide more detail */
|
|
ret = sysinfo_get(&dev);
|
|
if (!ret) {
|
|
ret = sysinfo_detect(dev);
|
|
if (!ret) {
|
|
ret = sysinfo_get_str(dev,
|
|
SYSINFO_ID_BOARD_MODEL,
|
|
sizeof(str), str);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Fail back to the main 'model' if available */
|
|
if (ret)
|
|
model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
|
|
else
|
|
model = str;
|
|
|
|
if (model)
|
|
printf("Model: %s\n", model);
|
|
}
|
|
|
|
return checkboard();
|
|
}
|