Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1501469 > unrolled thread

[PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-10-16 17:10 +0200
Last post2016-10-19 16:30 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-10-16 17:10 +0200
    Re: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table  for LD11 SoC Viresh Kumar <viresh.kumar@linaro.org> - 2016-10-18 13:30 +0200
      Re: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for  LD11 SoC Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-10-19 11:10 +0200
        Re: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table  for LD11 SoC Viresh Kumar <viresh.kumar@linaro.org> - 2016-10-19 16:30 +0200

#1501469 — [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-10-16 17:10 +0200
Subject[PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC
Message-ID<ssVex-7r1-15@gated-at.bofh.it>
Add a CPU clock to every CPU node and a CPU OPP table to use the
generic cpufreq driver.

Note:
clock-latency-ns (300ns) was calculated based on the CPU-gear switch
sequencer spec; it takes 12 clock cycles on the sequencer running
at 50 MHz, plus a bit additional latency.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi | 38 ++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
index 73e0acf..e3eb10f 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
@@ -70,14 +70,18 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a53", "arm,armv8";
 			reg = <0 0x000>;
+			clocks = <&sys_clk 33>;
 			enable-method = "psci";
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu1: cpu@1 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a53", "arm,armv8";
 			reg = <0 0x001>;
+			clocks = <&sys_clk 33>;
 			enable-method = "psci";
+			operating-points-v2 = <&cluster0_opp>;
 		};
 	};
 
@@ -86,6 +90,40 @@
 		method = "smc";
 	};
 
+	cluster0_opp: opp_table {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp@245000000 {
+			opp-hz = /bits/ 64 <245000000>;
+			clock-latency-ns = <300>;
+		};
+		opp@250000000 {
+			opp-hz = /bits/ 64 <250000000>;
+			clock-latency-ns = <300>;
+		};
+		opp@490000000 {
+			opp-hz = /bits/ 64 <490000000>;
+			clock-latency-ns = <300>;
+		};
+		opp@500000000 {
+			opp-hz = /bits/ 64 <500000000>;
+			clock-latency-ns = <300>;
+		};
+		opp@653333333 {
+			opp-hz = /bits/ 64 <653334000>;
+			clock-latency-ns = <300>;
+		};
+		opp@666666666 {
+			opp-hz = /bits/ 64 <666667000>;
+			clock-latency-ns = <300>;
+		};
+		opp@980000000 {
+			opp-hz = /bits/ 64 <980000000>;
+			clock-latency-ns = <300>;
+		};
+	};
+
 	clocks {
 		refclk: ref {
 			compatible = "fixed-clock";
-- 
1.9.1

[toc] | [next] | [standalone]


#1502918 — Re: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-10-18 13:30 +0200
SubjectRe: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC
Message-ID<stAKL-WC-45@gated-at.bofh.it>
In reply to#1501469
On 16-10-16, 23:59, Masahiro Yamada wrote:
> +	cluster0_opp: opp_table {
> +		compatible = "operating-points-v2";
> +		opp-shared;
> +
> +		opp@245000000 {
> +			opp-hz = /bits/ 64 <245000000>;
> +			clock-latency-ns = <300>;
> +		};
> +		opp@250000000 {
> +			opp-hz = /bits/ 64 <250000000>;
> +			clock-latency-ns = <300>;
> +		};
> +		opp@490000000 {
> +			opp-hz = /bits/ 64 <490000000>;
> +			clock-latency-ns = <300>;
> +		};
> +		opp@500000000 {
> +			opp-hz = /bits/ 64 <500000000>;
> +			clock-latency-ns = <300>;
> +		};
> +		opp@653333333 {

Why isn't ^^ matching with below values ? Same in next patch as well.

> +			opp-hz = /bits/ 64 <653334000>;
> +			clock-latency-ns = <300>;
> +		};
> +		opp@666666666 {
> +			opp-hz = /bits/ 64 <666667000>;
> +			clock-latency-ns = <300>;
> +		};
> +		opp@980000000 {
> +			opp-hz = /bits/ 64 <980000000>;
> +			clock-latency-ns = <300>;
> +		};
> +	};
> +
>  	clocks {
>  		refclk: ref {
>  			compatible = "fixed-clock";
> -- 
> 1.9.1

-- 
viresh

[toc] | [prev] | [next] | [standalone]


#1503593 — Re: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-10-19 11:10 +0200
SubjectRe: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC
Message-ID<stV2O-7yU-21@gated-at.bofh.it>
In reply to#1502918
Hi Viresh,


2016-10-18 20:25 GMT+09:00 Viresh Kumar <viresh.kumar@linaro.org>:
> On 16-10-16, 23:59, Masahiro Yamada wrote:
>> +     cluster0_opp: opp_table {
>> +             compatible = "operating-points-v2";
>> +             opp-shared;
>> +
>> +             opp@245000000 {
>> +                     opp-hz = /bits/ 64 <245000000>;
>> +                     clock-latency-ns = <300>;
>> +             };
>> +             opp@250000000 {
>> +                     opp-hz = /bits/ 64 <250000000>;
>> +                     clock-latency-ns = <300>;
>> +             };
>> +             opp@490000000 {
>> +                     opp-hz = /bits/ 64 <490000000>;
>> +                     clock-latency-ns = <300>;
>> +             };
>> +             opp@500000000 {
>> +                     opp-hz = /bits/ 64 <500000000>;
>> +                     clock-latency-ns = <300>;
>> +             };
>> +             opp@653333333 {
>
> Why isn't ^^ matching with below values ? Same in next patch as well.



When I try to update /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq,
it did not work as I had expected.


scaling_max_freq is specified by kHz unit,
on the other hand, clock frequency in the clk driver is specified by Hz.



If the operating point is 653333kHz, the cpufreq requests
the clk driver to set 653333000, but it is lower than
the exact clock, 653333333.
So, the next lower frequency, 500000000 is selected.
As a result, the operating point 653333kHz is never enabled.


So, the operating point must be equal or a little bit bigger.


Do you know a better way to solve this distortion?


-- 
Best Regards
Masahiro Yamada

[toc] | [prev] | [next] | [standalone]


#1503676 — Re: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-10-19 16:30 +0200
SubjectRe: [PATCH 2/3] arm64: dts: uniphier: add CPU clock and OPP table for LD11 SoC
Message-ID<su02v-2rf-95@gated-at.bofh.it>
In reply to#1503593
On 19-10-16, 17:33, Masahiro Yamada wrote:
> Hi Viresh,
> 
> 
> 2016-10-18 20:25 GMT+09:00 Viresh Kumar <viresh.kumar@linaro.org>:
> > On 16-10-16, 23:59, Masahiro Yamada wrote:
> >> +     cluster0_opp: opp_table {
> >> +             compatible = "operating-points-v2";
> >> +             opp-shared;
> >> +
> >> +             opp@245000000 {
> >> +                     opp-hz = /bits/ 64 <245000000>;
> >> +                     clock-latency-ns = <300>;
> >> +             };
> >> +             opp@250000000 {
> >> +                     opp-hz = /bits/ 64 <250000000>;
> >> +                     clock-latency-ns = <300>;
> >> +             };
> >> +             opp@490000000 {
> >> +                     opp-hz = /bits/ 64 <490000000>;
> >> +                     clock-latency-ns = <300>;
> >> +             };
> >> +             opp@500000000 {
> >> +                     opp-hz = /bits/ 64 <500000000>;
> >> +                     clock-latency-ns = <300>;
> >> +             };
> >> +             opp@653333333 {
> >
> > Why isn't ^^ matching with below values ? Same in next patch as well.
> 
> 
> 
> When I try to update /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq,
> it did not work as I had expected.
> 
> 
> scaling_max_freq is specified by kHz unit,
> on the other hand, clock frequency in the clk driver is specified by Hz.
> 
> 
> 
> If the operating point is 653333kHz, the cpufreq requests
> the clk driver to set 653333000, but it is lower than
> the exact clock, 653333333.
> So, the next lower frequency, 500000000 is selected.
> As a result, the operating point 653333kHz is never enabled.
> 
> 
> So, the operating point must be equal or a little bit bigger.
> 
> 
> Do you know a better way to solve this distortion?

I am not sure about how to fix that problem but there is no reason to
have the exact frequency in opp@*** name. Just use what you have used
in opp-hz line and you will have the exact same behavior.

Right now, its a bit confusing if we read the DT.

-- 
viresh

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web