From: Stephen Boyd <sboyd@kernel.org>
To: Biju Das <biju.das.jz@bp.renesas.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Michael Turquette <mturquette@baylibre.com>
Cc: linux-renesas-soc@vger.kernel.org
<linux-renesas-soc@vger.kernel.org>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
biju.das.au <biju.das.au@gmail.com>,
linux-clk@vger.kernel.org <linux-clk@vger.kernel.org>
Subject: RE: [PATCH 1/4] clk: renesas: rzv2h-cpg: Add support for coupled clock
Date: Mon, 24 Mar 2025 16:48:04 -0700 [thread overview]
Message-ID: <a6bd517263b66bc69a72d74aeb88cbf5@kernel.org> (raw)
In-Reply-To: <TY3PR01MB113461FA9BBF036D285AAC8F386DB2@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Quoting Biju Das (2025-03-21 07:21:24)
> > -----Original Message-----
> > From: Stephen Boyd <sboyd@kernel.org>
> > > > > >
> > > > > > The parent clock rate of spi and spix2 are different. If we use
> > > > > > an intermediate parent clk, What clk rate the parent will use??
> > > > >
> > > > > Alright, got it. Does the consumer care about the difference
> > > > > between the two clks for the gating
> > > > part?
> > > >
> > > > Although gating bit is same, for some reason their monitor bit is
> > > > different. So, to confirm clk on status we need to check respective
> > > > monitor bits. Parallelly, I will check with hardware team, does it need to monitor both these
> > bits??
> > >
> > > According to hardware team, the spix2 clock is twice the frequency of
> > > the spi clock, and the clock ON/OFF period displayed for each bit in the monitor register varies
> > slightly due to the difference in frequency.
> > >
> > > So to check the status after changing the clock ON/OFF register
> > > setting, please check the two monitor register bits together
> > >
> >
> > That answers the hardware side of the question. Why does software need to care that they're two
> > different things vs. one clk?
>
> From software point, Consumer driver bother only about spi_clk.
>
> So, treating as one clk(spi_clk) should be OK and we should drop
> handling spi_x2 module clk in the clk driver instead treat this as an internal clock
> (".spi_clk_x2")??
>
> Then we should update the binding to have only 3 module clks instead of 4 by dropping
> the spi_x2 module clk.
I don't see why the binding has to be updated. Can't we return a NULL
clk pointer when the driver calls clk_get() on the specifier for the
spi_x2 clk? Then nothing will happen for that clk. I guess we may need
to return the rate of the spi clk multiplied by 2 or something, but that
is far simpler to implement than arbitrating the hardware with custom
logic and meets the same result.
>
> Geert, what is your opinion on this?
>
> Example:
> DEF_SDIV(".spi_clk_x2", CLK_PLLCM33_XSPI, CLK_SMUX2_XSPI_CLK1, CSDIV0_DIVCTL3,
> dtable_2_16),
> DEF_FIXED(".pllcm33_xspi_div2", CLK_PLLCM33_XSPI_DIV2, CLK_PLLCM33_XSPI, 1, 2),
>
>
> DEF_MOD("spi_clk_spi", CLK_PLLCM33_XSPI_DIV2, 10, 1, 5, 1,
> BUS_MSTOP(4, BIT(5))),
>
> Note:
> Currently I am facing an issue which is popped up using single clock,
> If I use spi clock for rpm, then flash write is failing. If it is turned
> on permanently then there is no issue.
next prev parent reply other threads:[~2025-03-24 23:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 11:04 [PATCH 0/4] Add RZ/G3E XSPI clocks Biju Das
2025-03-03 11:04 ` [PATCH 1/4] clk: renesas: rzv2h-cpg: Add support for coupled clock Biju Das
2025-03-05 23:16 ` Stephen Boyd
2025-03-06 10:10 ` Biju Das
2025-03-06 22:36 ` Stephen Boyd
[not found] ` <TY3PR01MB113469E04E10E3D14FB3F69F186D52@TY3PR01MB11346.jpnprd01.prod.outlook.com>
2025-03-14 7:18 ` Biju Das
2025-03-20 21:56 ` Stephen Boyd
2025-03-21 14:21 ` Biju Das
2025-03-24 23:48 ` Stephen Boyd [this message]
2025-03-25 12:22 ` Biju Das
2025-03-26 15:17 ` Biju Das
2025-03-03 11:04 ` [PATCH 2/4] clk: renesas: rzv2h-cpg: Add support for static dividers Biju Das
2025-03-03 11:04 ` [PATCH 3/4] clk: renesas: r9a09g047: Add support for xspi mux and divider Biju Das
2025-03-03 11:04 ` [PATCH 4/4] clk: renesas: r9a09g047: Add XSPI clock/reset Biju Das
2025-03-06 14:44 ` Geert Uytterhoeven
2025-03-20 9:56 ` Biju Das
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=a6bd517263b66bc69a72d74aeb88cbf5@kernel.org \
--to=sboyd@kernel.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mturquette@baylibre.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