diff mbox

[4/5] ARC: AXS103: DTS: Set cpu frequency explicitly via dts

Message ID 20170814161213.17522-5-Eugeniy.Paltsev@synopsys.com
State New
Headers show

Commit Message

Eugeniy Paltsev Aug. 14, 2017, 4:12 p.m. UTC
Set cpu frequency explicitly via "cpu-freq" param in cpu 0 node
in device tree.

We add "cpu-freq" only to cpu 0 as all cpus are clocking from same
clock source (same pll in our case).

We override cpus node in skeleton as we don't need this change for
nsim.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/boot/dts/axc003.dtsi     | 13 +++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

Comments

Vineet Gupta Aug. 22, 2017, 9:40 p.m. UTC | #1
On 08/14/2017 09:12 AM, Eugeniy Paltsev wrote:
> Set cpu frequency explicitly via "cpu-freq" param in cpu 0 node
> in device tree.
>
> We add "cpu-freq" only to cpu 0 as all cpus are clocking from same
> clock source (same pll in our case).
>
> We override cpus node in skeleton as we don't need this change for
> nsim.

Given that you added a generic feature as part of 1/5 - do other platforms 
abilis/nps need corresponding fixups as this one !

>
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> ---
>   arch/arc/boot/dts/axc003.dtsi     | 13 +++++++++++++
>   arch/arc/boot/dts/axc003_idu.dtsi | 35 +++++++++++++++++++++++++++++++++++
>   2 files changed, 48 insertions(+)
>
> diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
> index dca7e39..7c7411c 100644
> --- a/arch/arc/boot/dts/axc003.dtsi
> +++ b/arch/arc/boot/dts/axc003.dtsi
> @@ -17,6 +17,19 @@
>   	#address-cells = <2>;
>   	#size-cells = <2>;
>   
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "snps,archs38";
> +			reg = <0>;
> +			cpu-freq = <100000000>;
> +			clocks = <&core_clk>;
> +		};
> +	};
> +
>   	cpu_card {
>   		compatible = "simple-bus";
>   		#address-cells = <1>;
> diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
> index 5b56bef..44bc01e 100644
> --- a/arch/arc/boot/dts/axc003_idu.dtsi
> +++ b/arch/arc/boot/dts/axc003_idu.dtsi
> @@ -17,6 +17,41 @@
>   	#address-cells = <2>;
>   	#size-cells = <2>;
>   
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		/*
> +		 * "cpu-freq" was added only to cpu 0 as all cpus are clocking
> +		 * from same clock source (same pll (core_clk) in our case).
> +		 */
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "snps,archs38";
> +			reg = <0>;
> +			cpu-freq = <100000000>;
> +			clocks = <&core_clk>;
> +		};
> +		cpu@1 {
> +			device_type = "cpu";
> +			compatible = "snps,archs38";
> +			reg = <1>;
> +			clocks = <&core_clk>;
> +		};
> +		cpu@2 {
> +			device_type = "cpu";
> +			compatible = "snps,archs38";
> +			reg = <2>;
> +			clocks = <&core_clk>;
> +		};
> +		cpu@3 {
> +			device_type = "cpu";
> +			compatible = "snps,archs38";
> +			reg = <3>;
> +			clocks = <&core_clk>;
> +		};
> +	};
> +
>   	cpu_card {
>   		compatible = "simple-bus";
>   		#address-cells = <1>;
Eugeniy Paltsev Aug. 23, 2017, 11:24 a.m. UTC | #2
On Tue, 2017-08-22 at 14:40 -0700, Vineet Gupta wrote:
> On 08/14/2017 09:12 AM, Eugeniy Paltsev wrote:

> > Set cpu frequency explicitly via "cpu-freq" param in cpu 0 node

> > in device tree.

> > 

> > We add "cpu-freq" only to cpu 0 as all cpus are clocking from same

> > clock source (same pll in our case).

> > 

> > We override cpus node in skeleton as we don't need this change for

> > nsim.

> 

> Given that you added a generic feature as part of 1/5 - do other

> platforms 

> abilis/nps need corresponding fixups as this one !


Actually no.
If cpu 0 node don't have "cpu-freq" property we simply print cpu
frequency and don't try to change it.
So we can left other dts untouched. 

> > 

> > Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

> > ---

> >   arch/arc/boot/dts/axc003.dtsi     | 13 +++++++++++++

> >   arch/arc/boot/dts/axc003_idu.dtsi | 35

> > +++++++++++++++++++++++++++++++++++

> >   2 files changed, 48 insertions(+)

> > 

> > diff --git a/arch/arc/boot/dts/axc003.dtsi

> > b/arch/arc/boot/dts/axc003.dtsi

> > index dca7e39..7c7411c 100644

> > --- a/arch/arc/boot/dts/axc003.dtsi

> > +++ b/arch/arc/boot/dts/axc003.dtsi

> > @@ -17,6 +17,19 @@

> >   	#address-cells = <2>;

> >   	#size-cells = <2>;

> >   

> > +	cpus {

> > +		#address-cells = <1>;

> > +		#size-cells = <0>;

> > +

> > +		cpu@0 {

> > +			device_type = "cpu";

> > +			compatible = "snps,archs38";

> > +			reg = <0>;

> > +			cpu-freq = <100000000>;

> > +			clocks = <&core_clk>;

> > +		};

> > +	};

> > +

> >   	cpu_card {

> >   		compatible = "simple-bus";

> >   		#address-cells = <1>;

> > diff --git a/arch/arc/boot/dts/axc003_idu.dtsi

> > b/arch/arc/boot/dts/axc003_idu.dtsi

> > index 5b56bef..44bc01e 100644

> > --- a/arch/arc/boot/dts/axc003_idu.dtsi

> > +++ b/arch/arc/boot/dts/axc003_idu.dtsi

> > @@ -17,6 +17,41 @@

> >   	#address-cells = <2>;

> >   	#size-cells = <2>;

> >   

> > +	cpus {

> > +		#address-cells = <1>;

> > +		#size-cells = <0>;

> > +

> > +		/*

> > +		 * "cpu-freq" was added only to cpu 0 as all cpus

> > are clocking

> > +		 * from same clock source (same pll (core_clk) in

> > our case).

> > +		 */

> > +		cpu@0 {

> > +			device_type = "cpu";

> > +			compatible = "snps,archs38";

> > +			reg = <0>;

> > +			cpu-freq = <100000000>;

> > +			clocks = <&core_clk>;

> > +		};

> > +		cpu@1 {

> > +			device_type = "cpu";

> > +			compatible = "snps,archs38";

> > +			reg = <1>;

> > +			clocks = <&core_clk>;

> > +		};

> > +		cpu@2 {

> > +			device_type = "cpu";

> > +			compatible = "snps,archs38";

> > +			reg = <2>;

> > +			clocks = <&core_clk>;

> > +		};

> > +		cpu@3 {

> > +			device_type = "cpu";

> > +			compatible = "snps,archs38";

> > +			reg = <3>;

> > +			clocks = <&core_clk>;

> > +		};

> > +	};

> > +

> >   	cpu_card {

> >   		compatible = "simple-bus";

> >   		#address-cells = <1>;

> 

> 

-- 
 Eugeniy Paltsev
Vineet Gupta Aug. 23, 2017, 4:39 p.m. UTC | #3
On 08/23/2017 04:24 AM, Eugeniy Paltsev wrote:
>> Given that you added a generic feature as part of 1/5 - do other
>> platforms
>> abilis/nps need corresponding fixups as this one !
> Actually no.
> If cpu 0 node don't have "cpu-freq" property we simply print cpu
> frequency and don't try to change it.
> So we can left other dts untouched.

OK good. But to keep things consistent lets fix the rest of DTs, as needed, as a 
separate patch.
diff mbox

Patch

diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
index dca7e39..7c7411c 100644
--- a/arch/arc/boot/dts/axc003.dtsi
+++ b/arch/arc/boot/dts/axc003.dtsi
@@ -17,6 +17,19 @@ 
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "snps,archs38";
+			reg = <0>;
+			cpu-freq = <100000000>;
+			clocks = <&core_clk>;
+		};
+	};
+
 	cpu_card {
 		compatible = "simple-bus";
 		#address-cells = <1>;
diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
index 5b56bef..44bc01e 100644
--- a/arch/arc/boot/dts/axc003_idu.dtsi
+++ b/arch/arc/boot/dts/axc003_idu.dtsi
@@ -17,6 +17,41 @@ 
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/*
+		 * "cpu-freq" was added only to cpu 0 as all cpus are clocking
+		 * from same clock source (same pll (core_clk) in our case).
+		 */
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "snps,archs38";
+			reg = <0>;
+			cpu-freq = <100000000>;
+			clocks = <&core_clk>;
+		};
+		cpu@1 {
+			device_type = "cpu";
+			compatible = "snps,archs38";
+			reg = <1>;
+			clocks = <&core_clk>;
+		};
+		cpu@2 {
+			device_type = "cpu";
+			compatible = "snps,archs38";
+			reg = <2>;
+			clocks = <&core_clk>;
+		};
+		cpu@3 {
+			device_type = "cpu";
+			compatible = "snps,archs38";
+			reg = <3>;
+			clocks = <&core_clk>;
+		};
+	};
+
 	cpu_card {
 		compatible = "simple-bus";
 		#address-cells = <1>;