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 <common.h>
8#include <init.h>
9#include <soc.h>
10
11int print_cpuinfo(void)
12{
13	struct udevice *soc;
14	char name[SOC_MAX_STR_SIZE];
15	int ret;
16
17	ret = soc_get(&soc);
18	if (ret) {
19		printf("CPU:   UNKNOWN\n");
20		return 0;
21	}
22
23	ret = soc_get_family(soc, name, SOC_MAX_STR_SIZE);
24	if (ret)
25		printf("CPU:   %s\n", name);
26
27	ret = soc_get_revision(soc, name, SOC_MAX_STR_SIZE);
28	if (ret)
29		printf("Silicon: %s\n", name);
30
31	ret = soc_get_machine(soc, name, SOC_MAX_STR_SIZE);
32	if (ret)
33		printf("Chip:  %s\n", name);
34
35	return 0;
36}
37