blob: 765bb24d9376647f0b7519378c11ec75b1ec7e6d [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.
Michal Simeka8c94362023-07-10 14:35:49 +02004 * Michal Simek <michal.simek@amd.com>
Stefan Herbrechtsmeier11ee8352022-06-20 18:36:45 +02005 */
6
Venkatesh Yadav Abbarapud79ebef2022-10-04 11:20:53 +05307#include <init.h>
Stefan Herbrechtsmeier11ee8352022-06-20 18:36:45 +02008#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}