1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2014 - 2020 Xilinx, Inc.
4  * Michal Simek <michal.simek@amd.com>
5  */
6 
7 #include <init.h>
8 #include <soc.h>
9 
print_cpuinfo(void)10 int print_cpuinfo(void)
11 {
12 	struct udevice *soc;
13 	char name[SOC_MAX_STR_SIZE];
14 	int ret;
15 
16 	ret = soc_get(&soc);
17 	if (ret) {
18 		printf("CPU:   UNKNOWN\n");
19 		return 0;
20 	}
21 
22 	ret = soc_get_family(soc, name, SOC_MAX_STR_SIZE);
23 	if (ret)
24 		printf("CPU:   %s\n", name);
25 
26 	ret = soc_get_revision(soc, name, SOC_MAX_STR_SIZE);
27 	if (ret)
28 		printf("Silicon: %s\n", name);
29 
30 	ret = soc_get_machine(soc, name, SOC_MAX_STR_SIZE);
31 	if (ret)
32 		printf("Chip:  %s\n", name);
33 
34 	return 0;
35 }
36