Commit d6c9bbaad194b48e799ed84df67b629424a56508

Authored by Soren Brinkmann
Committed by Michal Simek
1 parent 19605e2e03

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>

Showing 2 changed files with 22 additions and 0 deletions Side-by-side Diff

arch/arm/cpu/armv7/zynq/clk.c
... ... @@ -6,6 +6,7 @@
6 6 */
7 7 #include <common.h>
8 8 #include <errno.h>
  9 +#include <clk.h>
9 10 #include <asm/io.h>
10 11 #include <asm/arch/hardware.h>
11 12 #include <asm/arch/clk.h>
... ... @@ -635,5 +636,25 @@
635 636 const char *zynq_clk_get_name(enum zynq_clk clk)
636 637 {
637 638 return clks[clk].name;
  639 +}
  640 +
  641 +/**
  642 + * soc_clk_dump() - Print clock frequencies
  643 + * Returns zero on success
  644 + *
  645 + * Implementation for the clk dump command.
  646 + */
  647 +int soc_clk_dump(void)
  648 +{
  649 + int i;
  650 +
  651 + printf("clk\t\tfrequency\n");
  652 + for (i = 0; i < clk_max; i++) {
  653 + const char *name = zynq_clk_get_name(i);
  654 + if (name)
  655 + printf("%10s%20lu\n", name, zynq_clk_get_rate(i));
  656 + }
  657 +
  658 + return 0;
638 659 }
include/configs/zynq-common.h
... ... @@ -164,6 +164,7 @@
164 164 #define CONFIG_BOARD_LATE_INIT
165 165 #define CONFIG_SYS_LONGHELP
166 166 #define CONFIG_CLOCKS
  167 +#define CONFIG_CMD_CLK
167 168 #define CONFIG_SYS_MAXARGS 15 /* max number of command args */
168 169 #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
169 170 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \