提交 80c0d38a 编写于 作者: T T Karthik Reddy 提交者: Michal Simek

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: NT Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: NAshok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
上级 42e20f52
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <i2c_eeprom.h> #include <i2c_eeprom.h>
#include <net.h> #include <net.h>
#include <generated/dt.h> #include <generated/dt.h>
#include <soc.h>
#include "fru.h" #include "fru.h"
...@@ -440,3 +441,28 @@ int __maybe_unused board_fit_config_name_match(const char *name) ...@@ -440,3 +441,28 @@ int __maybe_unused board_fit_config_name_match(const char *name)
return -1; 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册