blob: 4eccc7abbea5624f47a77a5362c205fc2f7b53bd [file] [log] [blame]
Stefan Herbrechtsmeier86ceedd2022-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>
Venkatesh Yadav Abbarapufaf6a282022-10-04 11:20:53 +05308#include <init.h>
Stefan Herbrechtsmeier86ceedd2022-06-20 18:36:45 +02009#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}