mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-21 02:33:07 +00:00
faf6a286f1
cpu-info.c defines print_cpuinfo(), but neglected to include its declaration, causing the following sparse and compile time warnings: board/xilinx/common/cpu-info.c:10:5: warning: no previous prototype for 'print_cpuinfo' [-Wmissing-prototypes] Include init.h, which includes the missing declaration. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20221004055053.26047-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
36 lines
654 B
C
36 lines
654 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2014 - 2020 Xilinx, Inc.
|
|
* Michal Simek <michal.simek@xilinx.com>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <init.h>
|
|
#include <soc.h>
|
|
|
|
int print_cpuinfo(void)
|
|
{
|
|
struct udevice *soc;
|
|
char name[SOC_MAX_STR_SIZE];
|
|
int ret;
|
|
|
|
ret = soc_get(&soc);
|
|
if (ret) {
|
|
printf("CPU: UNKNOWN\n");
|
|
return 0;
|
|
}
|
|
|
|
ret = soc_get_family(soc, name, SOC_MAX_STR_SIZE);
|
|
if (ret)
|
|
printf("CPU: %s\n", name);
|
|
|
|
ret = soc_get_revision(soc, name, SOC_MAX_STR_SIZE);
|
|
if (ret)
|
|
printf("Silicon: %s\n", name);
|
|
|
|
ret = soc_get_machine(soc, name, SOC_MAX_STR_SIZE);
|
|
if (ret)
|
|
printf("Chip: %s\n", name);
|
|
|
|
return 0;
|
|
}
|