blob: bfe7f5b7e385c62ac709c83178ca918e4e7c7a96 [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
7#include <common.h>
Venkatesh Yadav Abbarapud79ebef2022-10-04 11:20:53 +05308#include <init.h>
Stefan Herbrechtsmeier11ee8352022-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}