summaryrefslogtreecommitdiff
path: root/board/xilinx/common/cpu-info.c
blob: bfe7f5b7e385c62ac709c83178ca918e4e7c7a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// SPDX-License-Identifier: GPL-2.0+
/*
 * (C) Copyright 2014 - 2020 Xilinx, Inc.
 * Michal Simek <michal.simek@amd.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;
}