diff options
author | Soren Brinkmann <soren.brinkmann@xilinx.com> | 2013-11-21 13:39:03 -0800 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2014-02-19 09:41:22 +0100 |
commit | d6c9bbaad194b48e799ed84df67b629424a56508 (patch) | |
tree | 43c5c401cb570b08cedd08221252053392c9f201 /arch | |
parent | 19605e2e038eb7266c74c4aba6a4d6c9f33db797 (diff) |
zynq: Implement dump clock command
Enable and implement dump clock command which shows
soc frequencies.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/armv7/zynq/clk.c | 21 |
1 files changed, 21 insertions, 0 deletions
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 <common.h> #include <errno.h> +#include <clk.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/clk.h> @@ -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; +} |