History log of /u-boot/cmd/clk.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 5666558a 09-Nov-2023 Igor Prusov <ivprusov@sberdevices.ru>

cmd: clk: Make soc_clk_dump static

After introducing dump to clk_ops there is no need to override or expose
this symbol anymore.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-9-ivprusov@sberdevices.ru

# 258c1002 09-Nov-2023 Igor Prusov <ivprusov@sberdevices.ru>

cmd: clk: Use dump function from clk_ops

Add another loop to dump additional info from clock providers that
implement dump operation.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-7-ivprusov@sberdevices.ru

# 3616218b 07-Oct-2023 Tom Rini <trini@konsulko.com>

cmd: Convert existing long help messages to the new macro

- Generally we just drop the #ifdef CONFIG_SYS_LONGHELP and endif lines
and use U_BOOT_LONGHELP to declare the same variable name as before
- In a few places, either rename the variable to follow convention or
introduce the variable as it was being done inline before.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c40251c1 13-Dec-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: probe the clock before dump them

The clock UCLASS need to be probed to allow availability of the
private data (struct clk *), get in show_clks() with dev_get_clk_ptr()
before use them.

Without this patch the clock dump can cause crash because all the
private data are not available before calling the API clk_get_rate().

It is the case for the SCMI clocks, priv->channel is needed for
scmi_clk_get_rate() and it is initialized only in scmi_clk_probe().
This issue causes a crash for "clk dump" command on STM32MP135F-DK board
for SCMI clock not yet probed.

Fixes: 1a725e229096 ("clk: fix clock tree dump to properly dump out every registered clock")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20221213145708.v2.1.Ia0bc6b272f1e2e3f37873c61d79138c2663c4055@changeid

# 92a1bba8 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: fix long help message

Fix the long help message for "clk setfreq" command

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.4.Ic863c28ffdcc15b3f4616434c2efd88b4e45495c@changeid

# 534859ac 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: update result of do_clk_setfreq

Update the result of do_clk_setfreq and always returns a CMD_RET_ value
(-EINVAL was a possible result).

This patch avoid the CLI output "exit not allowed from main input shell."

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.3.Iec2029edb7fc0b29e13bcb86058ad2f614f62779@changeid

# afcc2614 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: replace clk_lookup by uclass_get_device_by_name

The function clk_lookup can be replaced by a direct call
to uclass_get_device_by_name for UCLASS_CLK.

This patch removes duplicated codes by the generic DM API and avoids
issue in clk_lookup because result of uclass_get_device wasn't tested;
when ret < 0, dev = NULL and dev->name is invalid, the next function
call strcmp(name, dev->name) causes a crash.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20220131172131.2.I7bc7762eff1e31ab7ff5b34c416ee03b8fe52200@changeid

# 3386fb1e 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: test the number of argument in setfreq command

Test the number of argument in setfreq command to avoid a crash when
the command setfreq is called without argument:

STM32MP> clk setfreq
data abort
pc : [<ddba3f18>] lr : [<ddba3f89>]
reloc pc : [<c018ff18>] lr : [<c018ff89>]
sp : dbaf45b8 ip : ddb1d859 fp : 00000002
r10: dbb3fd80 r9 : dbb11e90 r8 : ddbf38cc
r7 : ddb39725 r6 : 00000000 r5 : 00000000 r4 : dbb3fd84
r3 : dbb3fd84 r2 : 0000000a r1 : dbaf45bc r0 : 00000011
Flags: nzCv IRQs off FIQs off Mode SVC_32 (T)
Code: 4dd3 1062 85a3 ddbd (7803) 2b30
Resetting CPU ...

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.1.I32a8f213d330dccd922f7aafc60d3d63fcbe8615@changeid

# 0b1284eb 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with decimal to dectoul()

It is a pain to have to specify the value 10 in each call. Add a new
dectoul() function and update the code to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7ab418fb 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: add support for setting clk rate from cmdline

Add new clk subcommand "clk setfreq", for setting up a clock rate
directly from u-boot cmdline. This is handy for any debugging purposes
towards clocks.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 1a725e22 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: fix clock tree dump to properly dump out every registered clock

Some clocks are not associated to a DM node, so just parsing the DM is not
enough. This is especially true for root clocks, which typically don't have
any parents. Instead, fetch every registered UCLASS_CLK instance, and dump
these out.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

# ff8eee03 08-Aug-2018 Marek Vasut <marex@denx.de>

cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ebc675b9 19-Apr-2018 Michal Simek <michal.simek@amd.com>

cmd: clk: Check return value from soc_clk_dump

In case of error in soc_clk_dump function are returned different values
then CMD return values (-1, 0, 1).

For example:
ZynqMP> clk dump
exit not allowed from main input shel

The patch is checking all negative return values and return
CMD_RET_FAILURE which is proper reaction for these cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 2e192b24 17-Jan-2016 Simon Glass <sjg@chromium.org>

Remove the cmd_ prefix from command files

Now that they are in their own directory, we can remove this prefix.
This makes it easier to find a file since the prefix does not get in the
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

# 3616218b 07-Oct-2023 Tom Rini <trini@konsulko.com>

cmd: Convert existing long help messages to the new macro

- Generally we just drop the #ifdef CONFIG_SYS_LONGHELP and endif lines
and use U_BOOT_LONGHELP to declare the same variable name as before
- In a few places, either rename the variable to follow convention or
introduce the variable as it was being done inline before.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c40251c1 13-Dec-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: probe the clock before dump them

The clock UCLASS need to be probed to allow availability of the
private data (struct clk *), get in show_clks() with dev_get_clk_ptr()
before use them.

Without this patch the clock dump can cause crash because all the
private data are not available before calling the API clk_get_rate().

It is the case for the SCMI clocks, priv->channel is needed for
scmi_clk_get_rate() and it is initialized only in scmi_clk_probe().
This issue causes a crash for "clk dump" command on STM32MP135F-DK board
for SCMI clock not yet probed.

Fixes: 1a725e229096 ("clk: fix clock tree dump to properly dump out every registered clock")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20221213145708.v2.1.Ia0bc6b272f1e2e3f37873c61d79138c2663c4055@changeid

# 92a1bba8 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: fix long help message

Fix the long help message for "clk setfreq" command

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.4.Ic863c28ffdcc15b3f4616434c2efd88b4e45495c@changeid

# 534859ac 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: update result of do_clk_setfreq

Update the result of do_clk_setfreq and always returns a CMD_RET_ value
(-EINVAL was a possible result).

This patch avoid the CLI output "exit not allowed from main input shell."

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.3.Iec2029edb7fc0b29e13bcb86058ad2f614f62779@changeid

# afcc2614 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: replace clk_lookup by uclass_get_device_by_name

The function clk_lookup can be replaced by a direct call
to uclass_get_device_by_name for UCLASS_CLK.

This patch removes duplicated codes by the generic DM API and avoids
issue in clk_lookup because result of uclass_get_device wasn't tested;
when ret < 0, dev = NULL and dev->name is invalid, the next function
call strcmp(name, dev->name) causes a crash.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20220131172131.2.I7bc7762eff1e31ab7ff5b34c416ee03b8fe52200@changeid

# 3386fb1e 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: test the number of argument in setfreq command

Test the number of argument in setfreq command to avoid a crash when
the command setfreq is called without argument:

STM32MP> clk setfreq
data abort
pc : [<ddba3f18>] lr : [<ddba3f89>]
reloc pc : [<c018ff18>] lr : [<c018ff89>]
sp : dbaf45b8 ip : ddb1d859 fp : 00000002
r10: dbb3fd80 r9 : dbb11e90 r8 : ddbf38cc
r7 : ddb39725 r6 : 00000000 r5 : 00000000 r4 : dbb3fd84
r3 : dbb3fd84 r2 : 0000000a r1 : dbaf45bc r0 : 00000011
Flags: nzCv IRQs off FIQs off Mode SVC_32 (T)
Code: 4dd3 1062 85a3 ddbd (7803) 2b30
Resetting CPU ...

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.1.I32a8f213d330dccd922f7aafc60d3d63fcbe8615@changeid

# 0b1284eb 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with decimal to dectoul()

It is a pain to have to specify the value 10 in each call. Add a new
dectoul() function and update the code to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7ab418fb 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: add support for setting clk rate from cmdline

Add new clk subcommand "clk setfreq", for setting up a clock rate
directly from u-boot cmdline. This is handy for any debugging purposes
towards clocks.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 1a725e22 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: fix clock tree dump to properly dump out every registered clock

Some clocks are not associated to a DM node, so just parsing the DM is not
enough. This is especially true for root clocks, which typically don't have
any parents. Instead, fetch every registered UCLASS_CLK instance, and dump
these out.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

# ff8eee03 08-Aug-2018 Marek Vasut <marex@denx.de>

cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ebc675b9 19-Apr-2018 Michal Simek <michal.simek@amd.com>

cmd: clk: Check return value from soc_clk_dump

In case of error in soc_clk_dump function are returned different values
then CMD return values (-1, 0, 1).

For example:
ZynqMP> clk dump
exit not allowed from main input shel

The patch is checking all negative return values and return
CMD_RET_FAILURE which is proper reaction for these cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 2e192b24 17-Jan-2016 Simon Glass <sjg@chromium.org>

Remove the cmd_ prefix from command files

Now that they are in their own directory, we can remove this prefix.
This makes it easier to find a file since the prefix does not get in the
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

# c40251c1 13-Dec-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: probe the clock before dump them

The clock UCLASS need to be probed to allow availability of the
private data (struct clk *), get in show_clks() with dev_get_clk_ptr()
before use them.

Without this patch the clock dump can cause crash because all the
private data are not available before calling the API clk_get_rate().

It is the case for the SCMI clocks, priv->channel is needed for
scmi_clk_get_rate() and it is initialized only in scmi_clk_probe().
This issue causes a crash for "clk dump" command on STM32MP135F-DK board
for SCMI clock not yet probed.

Fixes: 1a725e229096 ("clk: fix clock tree dump to properly dump out every registered clock")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20221213145708.v2.1.Ia0bc6b272f1e2e3f37873c61d79138c2663c4055@changeid

# 92a1bba8 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: fix long help message

Fix the long help message for "clk setfreq" command

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.4.Ic863c28ffdcc15b3f4616434c2efd88b4e45495c@changeid

# 534859ac 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: update result of do_clk_setfreq

Update the result of do_clk_setfreq and always returns a CMD_RET_ value
(-EINVAL was a possible result).

This patch avoid the CLI output "exit not allowed from main input shell."

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.3.Iec2029edb7fc0b29e13bcb86058ad2f614f62779@changeid

# afcc2614 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: replace clk_lookup by uclass_get_device_by_name

The function clk_lookup can be replaced by a direct call
to uclass_get_device_by_name for UCLASS_CLK.

This patch removes duplicated codes by the generic DM API and avoids
issue in clk_lookup because result of uclass_get_device wasn't tested;
when ret < 0, dev = NULL and dev->name is invalid, the next function
call strcmp(name, dev->name) causes a crash.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20220131172131.2.I7bc7762eff1e31ab7ff5b34c416ee03b8fe52200@changeid

# 3386fb1e 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: test the number of argument in setfreq command

Test the number of argument in setfreq command to avoid a crash when
the command setfreq is called without argument:

STM32MP> clk setfreq
data abort
pc : [<ddba3f18>] lr : [<ddba3f89>]
reloc pc : [<c018ff18>] lr : [<c018ff89>]
sp : dbaf45b8 ip : ddb1d859 fp : 00000002
r10: dbb3fd80 r9 : dbb11e90 r8 : ddbf38cc
r7 : ddb39725 r6 : 00000000 r5 : 00000000 r4 : dbb3fd84
r3 : dbb3fd84 r2 : 0000000a r1 : dbaf45bc r0 : 00000011
Flags: nzCv IRQs off FIQs off Mode SVC_32 (T)
Code: 4dd3 1062 85a3 ddbd (7803) 2b30
Resetting CPU ...

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.1.I32a8f213d330dccd922f7aafc60d3d63fcbe8615@changeid

# 0b1284eb 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with decimal to dectoul()

It is a pain to have to specify the value 10 in each call. Add a new
dectoul() function and update the code to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7ab418fb 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: add support for setting clk rate from cmdline

Add new clk subcommand "clk setfreq", for setting up a clock rate
directly from u-boot cmdline. This is handy for any debugging purposes
towards clocks.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 1a725e22 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: fix clock tree dump to properly dump out every registered clock

Some clocks are not associated to a DM node, so just parsing the DM is not
enough. This is especially true for root clocks, which typically don't have
any parents. Instead, fetch every registered UCLASS_CLK instance, and dump
these out.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

# ff8eee03 08-Aug-2018 Marek Vasut <marex@denx.de>

cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ebc675b9 19-Apr-2018 Michal Simek <michal.simek@amd.com>

cmd: clk: Check return value from soc_clk_dump

In case of error in soc_clk_dump function are returned different values
then CMD return values (-1, 0, 1).

For example:
ZynqMP> clk dump
exit not allowed from main input shel

The patch is checking all negative return values and return
CMD_RET_FAILURE which is proper reaction for these cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 2e192b24 17-Jan-2016 Simon Glass <sjg@chromium.org>

Remove the cmd_ prefix from command files

Now that they are in their own directory, we can remove this prefix.
This makes it easier to find a file since the prefix does not get in the
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

# 92a1bba8 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: fix long help message

Fix the long help message for "clk setfreq" command

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.4.Ic863c28ffdcc15b3f4616434c2efd88b4e45495c@changeid

# 534859ac 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: update result of do_clk_setfreq

Update the result of do_clk_setfreq and always returns a CMD_RET_ value
(-EINVAL was a possible result).

This patch avoid the CLI output "exit not allowed from main input shell."

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.3.Iec2029edb7fc0b29e13bcb86058ad2f614f62779@changeid

# afcc2614 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: replace clk_lookup by uclass_get_device_by_name

The function clk_lookup can be replaced by a direct call
to uclass_get_device_by_name for UCLASS_CLK.

This patch removes duplicated codes by the generic DM API and avoids
issue in clk_lookup because result of uclass_get_device wasn't tested;
when ret < 0, dev = NULL and dev->name is invalid, the next function
call strcmp(name, dev->name) causes a crash.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20220131172131.2.I7bc7762eff1e31ab7ff5b34c416ee03b8fe52200@changeid

# 3386fb1e 31-Jan-2022 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: test the number of argument in setfreq command

Test the number of argument in setfreq command to avoid a crash when
the command setfreq is called without argument:

STM32MP> clk setfreq
data abort
pc : [<ddba3f18>] lr : [<ddba3f89>]
reloc pc : [<c018ff18>] lr : [<c018ff89>]
sp : dbaf45b8 ip : ddb1d859 fp : 00000002
r10: dbb3fd80 r9 : dbb11e90 r8 : ddbf38cc
r7 : ddb39725 r6 : 00000000 r5 : 00000000 r4 : dbb3fd84
r3 : dbb3fd84 r2 : 0000000a r1 : dbaf45bc r0 : 00000011
Flags: nzCv IRQs off FIQs off Mode SVC_32 (T)
Code: 4dd3 1062 85a3 ddbd (7803) 2b30
Resetting CPU ...

Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220131172131.1.I32a8f213d330dccd922f7aafc60d3d63fcbe8615@changeid

# 0b1284eb 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with decimal to dectoul()

It is a pain to have to specify the value 10 in each call. Add a new
dectoul() function and update the code to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7ab418fb 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: add support for setting clk rate from cmdline

Add new clk subcommand "clk setfreq", for setting up a clock rate
directly from u-boot cmdline. This is handy for any debugging purposes
towards clocks.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 1a725e22 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: fix clock tree dump to properly dump out every registered clock

Some clocks are not associated to a DM node, so just parsing the DM is not
enough. This is especially true for root clocks, which typically don't have
any parents. Instead, fetch every registered UCLASS_CLK instance, and dump
these out.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

# ff8eee03 08-Aug-2018 Marek Vasut <marex@denx.de>

cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ebc675b9 19-Apr-2018 Michal Simek <michal.simek@xilinx.com>

cmd: clk: Check return value from soc_clk_dump

In case of error in soc_clk_dump function are returned different values
then CMD return values (-1, 0, 1).

For example:
ZynqMP> clk dump
exit not allowed from main input shel

The patch is checking all negative return values and return
CMD_RET_FAILURE which is proper reaction for these cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 2e192b24 17-Jan-2016 Simon Glass <sjg@chromium.org>

Remove the cmd_ prefix from command files

Now that they are in their own directory, we can remove this prefix.
This makes it easier to find a file since the prefix does not get in the
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

# 0b1284eb 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with decimal to dectoul()

It is a pain to have to specify the value 10 in each call. Add a new
dectoul() function and update the code to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7ab418fb 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: add support for setting clk rate from cmdline

Add new clk subcommand "clk setfreq", for setting up a clock rate
directly from u-boot cmdline. This is handy for any debugging purposes
towards clocks.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 1a725e22 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: fix clock tree dump to properly dump out every registered clock

Some clocks are not associated to a DM node, so just parsing the DM is not
enough. This is especially true for root clocks, which typically don't have
any parents. Instead, fetch every registered UCLASS_CLK instance, and dump
these out.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

# ff8eee03 08-Aug-2018 Marek Vasut <marex@denx.de>

cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ebc675b9 19-Apr-2018 Michal Simek <michal.simek@xilinx.com>

cmd: clk: Check return value from soc_clk_dump

In case of error in soc_clk_dump function are returned different values
then CMD return values (-1, 0, 1).

For example:
ZynqMP> clk dump
exit not allowed from main input shel

The patch is checking all negative return values and return
CMD_RET_FAILURE which is proper reaction for these cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 2e192b24 17-Jan-2016 Simon Glass <sjg@chromium.org>

Remove the cmd_ prefix from command files

Now that they are in their own directory, we can remove this prefix.
This makes it easier to find a file since the prefix does not get in the
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

# 7ab418fb 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: add support for setting clk rate from cmdline

Add new clk subcommand "clk setfreq", for setting up a clock rate
directly from u-boot cmdline. This is handy for any debugging purposes
towards clocks.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 1a725e22 11-Jun-2021 Tero Kristo <t-kristo@ti.com>

clk: fix clock tree dump to properly dump out every registered clock

Some clocks are not associated to a DM node, so just parsing the DM is not
enough. This is especially true for root clocks, which typically don't have
any parents. Instead, fetch every registered UCLASS_CLK instance, and dump
these out.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>

# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

# ff8eee03 08-Aug-2018 Marek Vasut <marex@denx.de>

cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ebc675b9 19-Apr-2018 Michal Simek <michal.simek@xilinx.com>

cmd: clk: Check return value from soc_clk_dump

In case of error in soc_clk_dump function are returned different values
then CMD return values (-1, 0, 1).

For example:
ZynqMP> clk dump
exit not allowed from main input shel

The patch is checking all negative return values and return
CMD_RET_FAILURE which is proper reaction for these cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 2e192b24 17-Jan-2016 Simon Glass <sjg@chromium.org>

Remove the cmd_ prefix from command files

Now that they are in their own directory, we can remove this prefix.
This makes it easier to find a file since the prefix does not get in the
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 689ca8c5 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: correctly handle depth for clk dump

Update depth only when clock uclass is found to have correct display
of command "clk dump".

Without this patch, the displayed depth is the binding depth for
all the uclass and that can be strange as only clock uclass nodes
are displayed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cc632841 30-Jul-2020 Patrick Delaunay <patrick.delaunay@st.com>

cmd: clk: cosmetic: correct code alignment in show_clks

Correct code alignment in show_clks() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# aeeb2e6d 21-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 80b44fb3 17-Mar-2019 Ismael Luceno Cortes <ismael.luceno@silicon-gears.com>

cmd: clk: Handle ENODEV from clk_get_rate

clk_get_rate may return -ENODEV if the clock isn't valid.

Also, make the error cases go through a single path.

Fixes: ff8eee0330a6 ("cmd: clk: Add trivial implementation of clock dump
for DM")

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>


# ff8eee03 08-Aug-2018 Marek Vasut <marex@denx.de>

cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>


# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>


# ebc675b9 19-Apr-2018 Michal Simek <michal.simek@xilinx.com>

cmd: clk: Check return value from soc_clk_dump

In case of error in soc_clk_dump function are returned different values
then CMD return values (-1, 0, 1).

For example:
ZynqMP> clk dump
exit not allowed from main input shel

The patch is checking all negative return values and return
CMD_RET_FAILURE which is proper reaction for these cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>


# 2e192b24 17-Jan-2016 Simon Glass <sjg@chromium.org>

Remove the cmd_ prefix from command files

Now that they are in their own directory, we can remove this prefix.
This makes it easier to find a file since the prefix does not get in the
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>