linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: mturquette@baylibre.com, sboyd@kernel.org,
	sugar.zhang@rock-chips.com, zhangqing@rock-chips.com,
	robh@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, Elaine Zhang <zhangqing@rock-chips.com>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-clk@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-kernel@vger.kernel.org, huangtao@rock-chips.com,
	finley.xiao@rock-chips.com
Subject: Re: [PATCH v4 5/7] clk: rockchip: add support for pvtpll clk
Date: Tue, 21 Oct 2025 15:47:11 +0200	[thread overview]
Message-ID: <13871591.dW097sEU6C@phil> (raw)
In-Reply-To: <20251021065232.2201500-6-zhangqing@rock-chips.com>

Am Dienstag, 21. Oktober 2025, 08:52:30 Mitteleuropäische Sommerzeit schrieb Elaine Zhang:
> Support to adjust pvtpll by volt-sel and otp.
> Support calibrate pvtpll init frequency.
> 
> PVTPLL is used to monitor the chip performance variance caused by chip
> process, voltage and temperature, and generate a set of reference signals
> for adjusting the voltage of the chip.
> 
> PVTPLL supports the following features:
> 
> 1. A clock oscillation ring is integrated and used to generate a clock
> like signal (osc_clk),the frequency of this clock is determined
> by the cell delay value of clock oscillation ring circuit
> 
> 2. A frequency counter(osc_cnt) is used to measure the frequency of osc_clk.
> 
> 3. A externally input clock (ref_clk) is used as a reference clock for
> detecting the frequency of osc_clk.
> 
> 4. A calculation counter uses ref_clk to generate a configurable
> periodic timing window.
> 
> 5. Two clock counters are used to measure the frequency of the clock
> generated by OSC_WRAPPER?
> 
> 6. Support for dividing the ref_clk and osc_clk
> 
> 7. Support for configuring the effective polarity of the voltage
> regulator signal 'OUT'
> 
> The clock path of cpu used pvtpll:
> 
>     --gpll--|--\
>             |   \                                 | \
>             |    \                                |  \
>             |     \                               |   \
>    --v0pll--| mux |--[gate]--[div]--clk_core_src--|mux |--clk_core
>             |     /                               |   /
>             |    /   --ref_clk--[div]-cpu_pvtpll--|  /
>    --v1pll--|   /                                 | /
>             |--/
> 
> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>

[...]

> +	pvtpll->regmap_cru = syscon_regmap_lookup_by_phandle_optional(np, "rockchip,cru");

Not convinced about that :-) .

(1) the cru itself already ioremaps the CRU memory, so having a syscon
    there would ioremap that memory a second time.
(2) we should definitly not expose the whole CRU io-memory to other
    drivers to write "random" stuff to. This will just invited further
    hacks, where people want to take shortcuts with clock settings.

Also this seems highly specific to the rv1126b.

Looking at the registers, this is a clk-mux between that deepslow clock
and the actual pvtpll output and the config function really only
reparents to the pvtpll in all cases.

So I believe this should in the worst case just be mux clock, but also
I see that the "correct" setting will already be set by the

        /* pvtpll src init */
        writel_relaxed(PVTPLL_SRC_SEL_PVTPLL, reg_base + RV1126B_CORECLKSEL_CON(0));
        writel_relaxed(PVTPLL_SRC_SEL_PVTPLL, reg_base + RV1126B_NPUCLKSEL_CON(0));
        writel_relaxed(PVTPLL_SRC_SEL_PVTPLL, reg_base + RV1126B_VICLKSEL_CON(0));
        writel_relaxed(PVTPLL_SRC_SEL_PVTPLL, reg_base + RV1126B_VEPUCLKSEL_CON(0));
        writel_relaxed(PVTPLL_SRC_SEL_PVTPLL, reg_base + RV1126B_VCPCLKSEL_CON(0));

in the rv1126b clock driver?

So that whole mode setting should not be necessary at all maybe?

Thanks
Heiko




  reply	other threads:[~2025-10-21 13:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21  6:52 [Resend PATCH v4 0/7] clk: rockchip: Add clock controller for the RV1126B and RK3506 Elaine Zhang
2025-10-21  6:52 ` [PATCH v4 1/7] clk: rockchip: Implement rockchip_clk_register_armclk_multi_pll() Elaine Zhang
2025-10-21  6:52 ` [PATCH v4 2/7] dt-bindings: clock, reset: Add support for rv1126b Elaine Zhang
2025-10-21  8:38   ` Heiko Stuebner
2025-10-22  3:21     ` zhangqing
2025-10-22  9:52       ` Heiko Stuebner
2025-10-23  8:43       ` [v4 " Markus Elfring
2025-10-21  6:52 ` [PATCH v4 3/7] clk: rockchip: Add clock controller for the RV1126B Elaine Zhang
2025-10-21  6:52 ` [PATCH v4 4/7] dt-bindings: clock: Add support for rockchip pvtpll Elaine Zhang
2025-10-21 13:48   ` Heiko Stuebner
2025-10-21  6:52 ` [PATCH v4 5/7] clk: rockchip: add support for pvtpll clk Elaine Zhang
2025-10-21 13:47   ` Heiko Stuebner [this message]
2025-10-22  3:44     ` zhangqing
2025-10-21  6:52 ` [PATCH v4 6/7] dt-bindings: clock: rockchip: Add RK3506 clock and reset unit Elaine Zhang
2025-10-21  8:36   ` Heiko Stuebner
2025-10-24  7:14   ` Krzysztof Kozlowski
2025-10-21  6:52 ` [PATCH v4 7/7] clk: rockchip: Add clock and reset driver for RK3506 Elaine Zhang
2025-10-21  6:55 ` [Resend PATCH v4 0/7] clk: rockchip: Add clock controller for the RV1126B and RK3506 Heiko Stuebner
  -- strict thread matches above, loose matches on Subject: below --
2025-10-21  3:38 [PATCH " Elaine Zhang
2025-10-21  3:38 ` [PATCH v4 5/7] clk: rockchip: add support for pvtpll clk Elaine Zhang

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=13871591.dW097sEU6C@phil \
    --to=heiko@sntech.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=finley.xiao@rock-chips.com \
    --cc=huangtao@rock-chips.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sugar.zhang@rock-chips.com \
    --cc=zhangqing@rock-chips.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;
as well as URLs for NNTP newsgroup(s).