From: Soren Brinkmann Date: Thu, 21 Nov 2013 21:39:03 +0000 (-0800) Subject: zynq: Implement dump clock command X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=d6c9bbaad194b48e799ed84df67b629424a56508;p=u-boot.git zynq: Implement dump clock command Enable and implement dump clock command which shows soc frequencies. Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- diff --git a/arch/arm/cpu/armv7/zynq/clk.c b/arch/arm/cpu/armv7/zynq/clk.c index 0891a23526..43071111c4 100644 --- a/arch/arm/cpu/armv7/zynq/clk.c +++ b/arch/arm/cpu/armv7/zynq/clk.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include #include @@ -636,3 +637,23 @@ const char *zynq_clk_get_name(enum zynq_clk clk) { return clks[clk].name; } + +/** + * soc_clk_dump() - Print clock frequencies + * Returns zero on success + * + * Implementation for the clk dump command. + */ +int soc_clk_dump(void) +{ + int i; + + printf("clk\t\tfrequency\n"); + for (i = 0; i < clk_max; i++) { + const char *name = zynq_clk_get_name(i); + if (name) + printf("%10s%20lu\n", name, zynq_clk_get_rate(i)); + } + + return 0; +} diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 406ccaf9df..d6dc74581e 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -164,6 +164,7 @@ #define CONFIG_BOARD_LATE_INIT #define CONFIG_SYS_LONGHELP #define CONFIG_CLOCKS +#define CONFIG_CMD_CLK #define CONFIG_SYS_MAXARGS 15 /* max number of command args */ #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \