diff options
author | T Karthik Reddy | 2021-08-10 06:50:20 -0600 |
---|---|---|
committer | Michal Simek | 2021-08-26 08:08:11 +0200 |
commit | 80c0d38a560cd991907340799fb55a6d75dd997f (patch) | |
tree | 4a6f928280ff96ff4e8f7ea3ddbccc02bfd54e47 /board/xilinx | |
parent | 42e20f52d9a4c76f4740ef6310edaa820028e070 (diff) |
xilinx: common: Add function to print SoC info
Add print_cpuinfo() to print SoC info like family & revision.
This function depends on CONFIG_DISPLAY_CPUINFO config.
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'board/xilinx')
-rw-r--r-- | board/xilinx/common/board.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 92b61d83ca4..90c87bab5cf 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -18,6 +18,7 @@ #include <i2c_eeprom.h> #include <net.h> #include <generated/dt.h> +#include <soc.h> #include "fru.h" @@ -440,3 +441,28 @@ int __maybe_unused board_fit_config_name_match(const char *name) return -1; } + +#if defined(CONFIG_DISPLAY_CPUINFO) && !defined(CONFIG_ARCH_ZYNQ) +int print_cpuinfo(void) +{ + struct udevice *soc; + char name[SOC_MAX_STR_SIZE]; + int ret; + + ret = soc_get(&soc); + if (ret) { + printf("CPU: UNKNOWN\n"); + return 0; + } + + ret = soc_get_family(soc, name, SOC_MAX_STR_SIZE); + if (ret) + printf("CPU: %s\n", name); + + ret = soc_get_revision(soc, name, SOC_MAX_STR_SIZE); + if (ret) + printf("Silicon: %s\n", name); + + return 0; +} +#endif |