From: Sean Anderson <seanga2@gmail.com>
To: Igor Prusov <ivprusov@sberdevices.ru>,
Michal Simek <michal.simek@amd.com>,
Daniel Schwierzeck <daniel.schwierzeck@gmail.com>,
Lukasz Majewski <lukma@denx.de>,
Ryan Chen <ryan_chen@aspeedtech.com>,
Chia-Wei Wang <chiawei_wang@aspeedtech.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Stefan Roese <sr@denx.de>,
Patrick Delaunay <patrick.delaunay@foss.st.com>,
Patrice Chotard <patrice.chotard@foss.st.com>
Cc: prusovigor@gmail.com, kernel@sberdevices.ru,
Aspeed BMC SW team <BMC-SW@aspeedtech.com>,
Joel Stanley <joel@jms.id.au>,
u-boot@lists.denx.de, u-boot-amlogic@groups.io,
uboot-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v4 6/8] cmd: clk: Use dump function from clk_ops
Date: Wed, 1 Nov 2023 13:10:56 -0400 [thread overview]
Message-ID: <c1c4205c-edb0-7dd2-3ff0-3be1c6a79104@gmail.com> (raw)
In-Reply-To: <20231017165649.1492-7-ivprusov@sberdevices.ru>
On 10/17/23 12:56, Igor Prusov wrote:
> Add another loop to dump additional info from clock providers that
> implement dump operation.
>
> Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
> cmd/clk.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/cmd/clk.c b/cmd/clk.c
> index c7c379d7a6..90cc6fa906 100644
> --- a/cmd/clk.c
> +++ b/cmd/clk.c
> @@ -62,6 +62,7 @@ static void show_clks(struct udevice *dev, int depth, int last_flag)
> int __weak soc_clk_dump(void)
> {
> struct udevice *dev;
> + const struct clk_ops *ops;
>
> printf(" Rate Usecnt Name\n");
> printf("------------------------------------------\n");
> @@ -69,6 +70,14 @@ int __weak soc_clk_dump(void)
> uclass_foreach_dev_probe(UCLASS_CLK, dev)
> show_clks(dev, -1, 0);
>
> + uclass_foreach_dev_probe(UCLASS_CLK, dev) {
> + ops = dev_get_driver_ops(dev);
> + if (ops && ops->dump) {
> + printf("--------------------------\n");
> + ops->dump(dev);
> + }
> + }
> +
> return 0;
> }
> #else
So this produces output like
=> clk dump
Rate Usecnt Name
------------------------------------------
26000000 0 |-- osc
--------------------------
Rate Enabled Name
------------------------
26000000 y osc
780000000 y pll0
390000000 - aclk
390000000 y cpu
390000000 y sram0
390000000 y sram1
7800000 - clint
195000000 y apb0
195000000 y gpio
195000000 y uart1
195000000 y uart2
195000000 y uart3
195000000 y fpioa
195000000 y sha
195000000 y apb1
195000000 y aes
195000000 y otp
195000000 y apb2
195000000 y rom
390000000 y dma
390000000 y dvp
390000000 y fft
390000000 y spi0
390000000 y spi1
390000000 y spi2
97500000 y spi3
390000000 y i2c0
390000000 y i2c1
390000000 y i2c2
390000000 y timer0
390000000 y timer1
390000000 y timer2
390000000 y pll1
390000000 y ai
0 n pll2
0 y i2s0
0 y i2s1
0 y i2s2
0 - i2s0_m
0 - i2s1_m
0 - i2s2_m
13000000 y wdt0
13000000 n wdt1
26000000 n rtc
And TBH I don't think it's particularly clear (at least at a glance) where
one clock ends and another begins. I think something like
diff --git i/cmd/clk.c w/cmd/clk.c
index f55911db7a3..7bbcbfeda33 100644
--- i/cmd/clk.c
+++ w/cmd/clk.c
@@ -73,7 +73,7 @@ static int soc_clk_dump(void)
uclass_foreach_dev_probe(UCLASS_CLK, dev) {
ops = dev_get_driver_ops(dev);
if (ops && ops->dump) {
- printf("--------------------------\n");
+ printf("\n%s %s:\n", dev->driver->name, dev->name);
ops->dump(dev);
}
}
would work a lot better. This produces an output like
=> clk dump
Rate Usecnt Name
------------------------------------------
26000000 0 |-- osc
k210_clk clock-controller:
Rate Enabled Name
------------------------
26000000 y osc
780000000 y pll0
390000000 - aclk
390000000 y cpu
390000000 y sram0
390000000 y sram1
</snip>
which I think makes it clearer that we have a new clock tree getting dumped.
This also doesn't really address multiple interacting clock trees (such as
e.g. if I had another clock derived from a k210_clk in the above example)
but at least it's a start.
--Sean
next prev parent reply other threads:[~2023-11-01 17:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 16:56 [PATCH v4 0/8] clk: Switch from soc_clk_dump to clk_ops function Igor Prusov
2023-10-17 16:56 ` [PATCH v4 1/8] clk: zynq: Move soc_clk_dump to Zynq clock driver Igor Prusov
2023-10-17 16:56 ` [PATCH v4 2/8] clk: ast2600: Move soc_clk_dump function Igor Prusov
2023-10-17 16:56 ` [PATCH v4 3/8] clk: k210: " Igor Prusov
2023-11-01 17:12 ` Sean Anderson
2023-10-17 16:56 ` [PATCH v4 4/8] clk: amlogic: Move driver and ops structs Igor Prusov
2023-10-18 7:42 ` Neil Armstrong
2023-10-17 16:56 ` [PATCH v4 5/8] clk: Add dump operation to clk_ops Igor Prusov
2023-11-01 17:11 ` Sean Anderson
2023-10-17 16:56 ` [PATCH v4 6/8] cmd: clk: Use dump function from clk_ops Igor Prusov
2023-11-01 17:10 ` Sean Anderson [this message]
2023-10-17 16:56 ` [PATCH v4 7/8] clk: treewide: switch to clock dump " Igor Prusov
2023-11-01 17:13 ` Sean Anderson
2023-10-17 16:56 ` [PATCH v4 8/8] cmd: clk: Make soc_clk_dump static Igor Prusov
2023-11-01 17:13 ` Sean Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c1c4205c-edb0-7dd2-3ff0-3be1c6a79104@gmail.com \
--to=seanga2@gmail.com \
--cc=BMC-SW@aspeedtech.com \
--cc=chiawei_wang@aspeedtech.com \
--cc=daniel.schwierzeck@gmail.com \
--cc=ivprusov@sberdevices.ru \
--cc=joel@jms.id.au \
--cc=kernel@sberdevices.ru \
--cc=lukma@denx.de \
--cc=michal.simek@amd.com \
--cc=neil.armstrong@linaro.org \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=prusovigor@gmail.com \
--cc=ryan_chen@aspeedtech.com \
--cc=sr@denx.de \
--cc=u-boot-amlogic@groups.io \
--cc=u-boot@lists.denx.de \
--cc=uboot-stm32@st-md-mailman.stormreply.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox