Stefan Herbrechtsmeier | 11ee835 | 2022-06-20 18:36:45 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * (C) Copyright 2014 - 2020 Xilinx, Inc. |
Michal Simek | a8c9436 | 2023-07-10 14:35:49 +0200 | [diff] [blame] | 4 | * Michal Simek <michal.simek@amd.com> |
Stefan Herbrechtsmeier | 11ee835 | 2022-06-20 18:36:45 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Venkatesh Yadav Abbarapu | d79ebef | 2022-10-04 11:20:53 +0530 | [diff] [blame] | 8 | #include <init.h> |
Stefan Herbrechtsmeier | 11ee835 | 2022-06-20 18:36:45 +0200 | [diff] [blame] | 9 | #include <soc.h> |
| 10 | |
| 11 | int 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 | } |