blob: 4a863d00dec8561e0dcc71c55d8011d37d01db5a [file] [log] [blame]
Stefan Herbrechtsmeier11ee8352022-06-20 18:36:45 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2014 - 2020 Xilinx, Inc.
4 * Michal Simek <michal.simek@xilinx.com>
5 */
6
7#include <common.h>
8#include <soc.h>
9
10int 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}