linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: Alexey Charkov <alchark@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Chen-Yu Tsai <wens@kernel.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] arm64: dts: rockchip: Add OPP data for CPU cores on RK3588
Date: Fri, 01 Mar 2024 07:31:33 +0100	[thread overview]
Message-ID: <ed2b97a0487455aaef6a6e6144165512@manjaro.org> (raw)
In-Reply-To: <20240229-rk-dts-additions-v3-4-6afe8473a631@gmail.com>

On 2024-02-29 20:26, Alexey Charkov wrote:
> By default the CPUs on RK3588 start up in a conservative performance
> mode. Add frequency and voltage mappings to the device tree to enable
> dynamic scaling via cpufreq.
> 
> OPP values are adapted from Radxa's downstream kernel for Rock 5B [1],
> stripping them down to the minimum frequency and voltage combinations
> as expected by the generic upstream cpufreq-dt driver, and also 
> dropping
> those OPPs that don't differ in voltage but only in frequency (keeping
> the top frequency OPP in each case).

Please, let's consider extracting the OPPs into a separate 
rk3588s-opp.dtsi
file, as I already explained in detail and proposed in the message 
linked
below.  To be fair, it might also be seen as redundant, because the 
RK3399
does that because of the need for different OPPs for different RK3399 
SoC
variants, but it would make leaving the TSADC disabled 100% safe.

Though, the RK3328 SoC dtsi also leaves the TSADC disabled on the SoC 
level
and enables it for each RK3328-based board, so I'm no longer sure do we
really need a separate rk3588s-opp.dtsi file to be on the 100% safe side
with the TSADC disabled on the RK3588(s) SoC level.

- 
https://lore.kernel.org/linux-rockchip/ad00189e1a25ca90128be6c8b3841b77@manjaro.org/

> Note that this patch ignores voltage scaling for the CPU memory
> interface which the downstream kernel does through a custom cpufreq
> driver, and which is why the downstream version has two sets of voltage
> values for each OPP (the second one being meant for the memory
> interface supply regulator). This is done instead via regulator
> coupling between CPU and memory interface supplies on affected boards.

I'm still digging through various documents, to find a more clear 
explanation
of what those *_MEM_* voltages are exactly for.  I'll reply in more 
detail in
the respective patch thread, of course.

> This has been tested on Rock 5B with u-boot 2023.11 compiled from
> Collabora's integration tree [2] with binary bl31 and appears to be
> stable both under active cooling and passive cooling (with throttling)
> 
> [1] 
> https://github.com/radxa/kernel/blob/stable-5.10-rock5/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> [2] 
> https://gitlab.collabora.com/hardware-enablement/rockchip-3588/u-boot
> 
> Signed-off-by: Alexey Charkov <alchark@gmail.com>
> ---
>  arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 122 
> ++++++++++++++++++++++++++++++
>  1 file changed, 122 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> index 9bf197358642..bd39c5c47bfb 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> @@ -97,6 +97,7 @@ cpu_l0: cpu@0 {
>  			clocks = <&scmi_clk SCMI_CLK_CPUL>;
>  			assigned-clocks = <&scmi_clk SCMI_CLK_CPUL>;
>  			assigned-clock-rates = <816000000>;
> +			operating-points-v2 = <&cluster0_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <32768>;
>  			i-cache-line-size = <64>;
> @@ -116,6 +117,7 @@ cpu_l1: cpu@100 {
>  			enable-method = "psci";
>  			capacity-dmips-mhz = <530>;
>  			clocks = <&scmi_clk SCMI_CLK_CPUL>;
> +			operating-points-v2 = <&cluster0_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <32768>;
>  			i-cache-line-size = <64>;
> @@ -135,6 +137,7 @@ cpu_l2: cpu@200 {
>  			enable-method = "psci";
>  			capacity-dmips-mhz = <530>;
>  			clocks = <&scmi_clk SCMI_CLK_CPUL>;
> +			operating-points-v2 = <&cluster0_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <32768>;
>  			i-cache-line-size = <64>;
> @@ -154,6 +157,7 @@ cpu_l3: cpu@300 {
>  			enable-method = "psci";
>  			capacity-dmips-mhz = <530>;
>  			clocks = <&scmi_clk SCMI_CLK_CPUL>;
> +			operating-points-v2 = <&cluster0_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <32768>;
>  			i-cache-line-size = <64>;
> @@ -175,6 +179,7 @@ cpu_b0: cpu@400 {
>  			clocks = <&scmi_clk SCMI_CLK_CPUB01>;
>  			assigned-clocks = <&scmi_clk SCMI_CLK_CPUB01>;
>  			assigned-clock-rates = <816000000>;
> +			operating-points-v2 = <&cluster1_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <65536>;
>  			i-cache-line-size = <64>;
> @@ -194,6 +199,7 @@ cpu_b1: cpu@500 {
>  			enable-method = "psci";
>  			capacity-dmips-mhz = <1024>;
>  			clocks = <&scmi_clk SCMI_CLK_CPUB01>;
> +			operating-points-v2 = <&cluster1_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <65536>;
>  			i-cache-line-size = <64>;
> @@ -215,6 +221,7 @@ cpu_b2: cpu@600 {
>  			clocks = <&scmi_clk SCMI_CLK_CPUB23>;
>  			assigned-clocks = <&scmi_clk SCMI_CLK_CPUB23>;
>  			assigned-clock-rates = <816000000>;
> +			operating-points-v2 = <&cluster2_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <65536>;
>  			i-cache-line-size = <64>;
> @@ -234,6 +241,7 @@ cpu_b3: cpu@700 {
>  			enable-method = "psci";
>  			capacity-dmips-mhz = <1024>;
>  			clocks = <&scmi_clk SCMI_CLK_CPUB23>;
> +			operating-points-v2 = <&cluster2_opp_table>;
>  			cpu-idle-states = <&CPU_SLEEP>;
>  			i-cache-size = <65536>;
>  			i-cache-line-size = <64>;
> @@ -348,6 +356,120 @@ l3_cache: l3-cache {
>  		};
>  	};
> 
> +	cluster0_opp_table: opp-table-cluster0 {
> +		compatible = "operating-points-v2";
> +		opp-shared;
> +
> +		opp-1008000000 {
> +			opp-hz = /bits/ 64 <1008000000>;
> +			opp-microvolt = <675000 675000 950000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1200000000 {
> +			opp-hz = /bits/ 64 <1200000000>;
> +			opp-microvolt = <712500 712500 950000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1416000000 {
> +			opp-hz = /bits/ 64 <1416000000>;
> +			opp-microvolt = <762500 762500 950000>;
> +			clock-latency-ns = <40000>;
> +			opp-suspend;
> +		};
> +		opp-1608000000 {
> +			opp-hz = /bits/ 64 <1608000000>;
> +			opp-microvolt = <850000 850000 950000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1800000000 {
> +			opp-hz = /bits/ 64 <1800000000>;
> +			opp-microvolt = <950000 950000 950000>;
> +			clock-latency-ns = <40000>;
> +		};
> +	};
> +
> +	cluster1_opp_table: opp-table-cluster1 {
> +		compatible = "operating-points-v2";
> +		opp-shared;
> +
> +		opp-1200000000 {
> +			opp-hz = /bits/ 64 <1200000000>;
> +			opp-microvolt = <675000 675000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1416000000 {
> +			opp-hz = /bits/ 64 <1416000000>;
> +			opp-microvolt = <725000 725000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1608000000 {
> +			opp-hz = /bits/ 64 <1608000000>;
> +			opp-microvolt = <762500 762500 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1800000000 {
> +			opp-hz = /bits/ 64 <1800000000>;
> +			opp-microvolt = <850000 850000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-2016000000 {
> +			opp-hz = /bits/ 64 <2016000000>;
> +			opp-microvolt = <925000 925000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-2208000000 {
> +			opp-hz = /bits/ 64 <2208000000>;
> +			opp-microvolt = <987500 987500 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-2400000000 {
> +			opp-hz = /bits/ 64 <2400000000>;
> +			opp-microvolt = <1000000 1000000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +	};
> +
> +	cluster2_opp_table: opp-table-cluster2 {
> +		compatible = "operating-points-v2";
> +		opp-shared;
> +
> +		opp-1200000000 {
> +			opp-hz = /bits/ 64 <1200000000>;
> +			opp-microvolt = <675000 675000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1416000000 {
> +			opp-hz = /bits/ 64 <1416000000>;
> +			opp-microvolt = <725000 725000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1608000000 {
> +			opp-hz = /bits/ 64 <1608000000>;
> +			opp-microvolt = <762500 762500 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-1800000000 {
> +			opp-hz = /bits/ 64 <1800000000>;
> +			opp-microvolt = <850000 850000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-2016000000 {
> +			opp-hz = /bits/ 64 <2016000000>;
> +			opp-microvolt = <925000 925000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-2208000000 {
> +			opp-hz = /bits/ 64 <2208000000>;
> +			opp-microvolt = <987500 987500 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +		opp-2400000000 {
> +			opp-hz = /bits/ 64 <2400000000>;
> +			opp-microvolt = <1000000 1000000 1000000>;
> +			clock-latency-ns = <40000>;
> +		};
> +	};
> +
>  	firmware {
>  		optee: optee {
>  			compatible = "linaro,optee-tz";

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2024-03-01  6:31 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 19:26 [PATCH v3 0/5] RK3588 and Rock 5B dts additions: thermal, OPP and fan Alexey Charkov
2024-02-29 19:26 ` [PATCH v3 1/5] arm64: dts: rockchip: enable built-in thermal monitoring on RK3588 Alexey Charkov
2024-02-29 20:21   ` Dragan Simic
2024-03-01  5:12     ` Alexey Charkov
2024-03-01  5:51       ` Dragan Simic
2024-03-01  8:25         ` Alexey Charkov
2024-03-01  8:52           ` Dragan Simic
2024-03-01  9:24             ` Dragan Simic
2024-03-01 11:10             ` Alexey Charkov
2024-03-01 12:02               ` Chen-Yu Tsai
2024-03-01 13:11                 ` Dragan Simic
2024-03-01 12:34               ` Dragan Simic
2024-02-29 21:11   ` Dragan Simic
2024-03-01  5:20     ` Alexey Charkov
2024-03-01  6:14       ` Dragan Simic
2024-03-01  7:51         ` Alexey Charkov
2024-03-01  8:21           ` Dragan Simic
2024-03-02 11:25   ` Heiko Stuebner
2024-03-02 18:38     ` Dragan Simic
2024-02-29 19:26 ` [PATCH v3 2/5] arm64: dts: rockchip: enable automatic active cooling on Rock 5B Alexey Charkov
2024-02-29 21:25   ` Dragan Simic
2024-03-01  5:21     ` Alexey Charkov
2024-03-01  6:17       ` Dragan Simic
2024-03-01  8:25         ` Dragan Simic
2024-03-01  8:30           ` Alexey Charkov
2024-03-01  9:32             ` Dragan Simic
2024-02-29 19:26 ` [PATCH v3 3/5] arm64: dts: rockchip: Add CPU/memory regulator coupling for RK3588 Alexey Charkov
2024-03-01  8:13   ` Dragan Simic
2024-03-11 10:24     ` Dragan Simic
2024-02-29 19:26 ` [PATCH v3 4/5] arm64: dts: rockchip: Add OPP data for CPU cores on RK3588 Alexey Charkov
2024-03-01  6:31   ` Dragan Simic [this message]
2024-02-29 19:26 ` [PATCH v3 5/5] arm64: dts: rockchip: Add further granularity in RK3588 CPU OPPs Alexey Charkov
2024-03-01  6:36   ` Dragan Simic
2024-03-04 17:50 ` [PATCH v3 0/5] RK3588 and Rock 5B dts additions: thermal, OPP and fan Sebastian Reichel
2024-03-05  8:06   ` Alexey Charkov
2024-03-07 12:38     ` Alexey Charkov
2024-03-07 14:21       ` Dragan Simic
2024-03-11  7:08         ` Dragan Simic
2024-03-07 22:16       ` Sebastian Reichel
2024-03-13 16:39         ` Sebastian Reichel
2024-03-13 16:44           ` Dragan Simic
2024-04-10  9:19 ` Diederik de Haas
2024-04-10  9:28   ` Dragan Simic
2024-04-20 17:53     ` Diederik de Haas
2024-04-21 16:07       ` Dragan Simic

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=ed2b97a0487455aaef6a6e6144165512@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=alchark@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=wens@kernel.org \
    /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).