clk: support clk tree dump
authorPeng Fan <peng.fan@nxp.com>
Wed, 21 Aug 2019 13:35:14 +0000 (13:35 +0000)
committerLukasz Majewski <lukma@denx.de>
Wed, 21 Aug 2019 22:10:09 +0000 (00:10 +0200)
commitaeeb2e6d9c67273da5d91f7567657447878eb493
treed42adea665093563e3f6295e8df73b4d5ab3b7ca
parent0520be0f67e358f57f5a1f805b24f39b143e4334
clk: support clk tree dump

The previous code only dump the clk list. This patch is
to support clk tree dump, and also dump the enable_cnt.

The code used in patch is similar to dm_dump_all, but
the code here only filter out the UCLASS_CLK devices.

On i.MX8MM, Partial output:
u-boot=> clk dump
 Rate               Usecnt      Name
------------------------------------------
 24000000             0        |-- clock-osc-24m
 24000000             0        |   |-- dram_pll_ref_sel
 750000000            0        |   |   `-- dram_pll
 750000000            0        |   |       `-- dram_pll_bypass
 750000000            0        |   |           `-- dram_pll_out
 24000000             0        |   |-- arm_pll_ref_sel
 1200000000           0        |   |   `-- arm_pll
 1200000000           0        |   |       `-- arm_pll_bypass
 1200000000           0        |   |           `-- arm_pll_out
 1200000000           0        |   |               `-- arm_a53_src
 1200000000           0        |   |                   `-- arm_a53_cg
 1200000000           0        |   |                       `-- arm_a53_div
 24000000             4        |   |-- sys_pll1_ref_sel
 800000000            4        |   |   `-- sys_pll1
 800000000            4        |   |       `-- sys_pll1_bypass
 800000000            4        |   |           `-- sys_pll1_out
 40000000             0        |   |               |-- sys_pll1_40m

Signed-off-by: Peng Fan <peng.fan@nxp.com>
cmd/clk.c