linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Holland <samuel@sholland.org>
To: qianfanguijin@163.com
Cc: linux-sunxi@lists.linux.dev, Rob Herring <robh+dt@kernel.org>,
	Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH v5 2/3] ARM: dts: sun8i-r40: add opp table for cpu
Date: Mon, 4 Jul 2022 23:57:44 -0500	[thread overview]
Message-ID: <161faad6-4ee5-97a7-ab4a-53bcb5b47334@sholland.org> (raw)
In-Reply-To: <20220517013607.2252-3-qianfanguijin@163.com>

On 5/16/22 8:36 PM, qianfanguijin@163.com wrote:
> From: qianfan Zhao <qianfanguijin@163.com>
> 
> OPP table value is get from allwinner lichee linux-3.10 kernel driver
> 
> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
>  .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  1 +
>  arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi      | 52 +++++++++++++++++++
>  arch/arm/boot/dts/sun8i-r40-feta40i.dtsi      |  1 +
>  arch/arm/boot/dts/sun8i-r40.dtsi              |  8 +++
>  arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts      |  1 +
>  .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  1 +
>  6 files changed, 64 insertions(+)
>  create mode 100644 arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi
> 
> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> index 4f30018ec4a2..28197bbcb1d5 100644
> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> @@ -43,6 +43,7 @@
>  
>  /dts-v1/;
>  #include "sun8i-r40.dtsi"
> +#include "sun8i-r40-cpu-opp.dtsi"
>  
>  #include <dt-bindings/gpio/gpio.h>
>  
> diff --git a/arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi b/arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi
> new file mode 100644
> index 000000000000..4faa22d3bac8
> --- /dev/null
> +++ b/arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi
> @@ -0,0 +1,52 @@
> +/{
> +	cpu0_opp_table: opp_table0 {

The binding requires the node name to match a specific regex. The patch as
written does not validate:

arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dtb: opp_table0: $nodename:0: 'opp_table0'
does not match '^opp-table(-[a-z0-9]+)?$'
        From schema: Documentation/devicetree/bindings/opp/opp-v2.yaml

With the node renamed to "opp-table-cpu" (following H3), the devicetrees pass
validation. So with that one change:

Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>

Regards,
Samuel

> +		compatible = "operating-points-v2";
> +		opp-shared;
> +
> +		opp-720000000 {
> +			opp-hz = /bits/ 64 <720000000>;
> +			opp-microvolt = <1000000 1000000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-912000000 {
> +			opp-hz = /bits/ 64 <912000000>;
> +			opp-microvolt = <1100000 1100000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1008000000 {
> +			opp-hz = /bits/ 64 <1008000000>;
> +			opp-microvolt = <1160000 1160000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1104000000 {
> +			opp-hz = /bits/ 64 <1104000000>;
> +			opp-microvolt = <1240000 1240000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1200000000 {
> +			opp-hz = /bits/ 64 <1200000000>;
> +			opp-microvolt = <1300000 1300000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +	};
> +};
> +
> +&cpu0 {
> +	operating-points-v2 = <&cpu0_opp_table>;
> +};
> +
> +&cpu1 {
> +	operating-points-v2 = <&cpu0_opp_table>;
> +};
> +
> +&cpu2 {
> +	operating-points-v2 = <&cpu0_opp_table>;
> +};
> +
> +&cpu3 {
> +	operating-points-v2 = <&cpu0_opp_table>;
> +};
> diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
> index b872b51a346d..9f39b5a2bb35 100644
> --- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
> +++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
> @@ -5,6 +5,7 @@
>  //  Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
>  
>  #include "sun8i-r40.dtsi"
> +#include "sun8i-r40-cpu-opp.dtsi"
>  
>  &cpu0 {
>  	cpu-supply = <&reg_dcdc2>;
> diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
> index 291f4784e86c..ae2a5ebd9924 100644
> --- a/arch/arm/boot/dts/sun8i-r40.dtsi
> +++ b/arch/arm/boot/dts/sun8i-r40.dtsi
> @@ -84,24 +84,32 @@ cpu0: cpu@0 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <0>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
>  		};
>  
>  		cpu1: cpu@1 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <1>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
>  		};
>  
>  		cpu2: cpu@2 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <2>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
>  		};
>  
>  		cpu3: cpu@3 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <3>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
>  		};
>  	};
>  
> diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
> index 0eb1990742ff..9f472521f4a4 100644
> --- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
> +++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
> @@ -45,6 +45,7 @@
>  
>  /dts-v1/;
>  #include "sun8i-r40.dtsi"
> +#include "sun8i-r40-cpu-opp.dtsi"
>  
>  #include <dt-bindings/gpio/gpio.h>
>  
> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> index fdf8bd12faaa..434871040aca 100644
> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> @@ -42,6 +42,7 @@
>  
>  /dts-v1/;
>  #include "sun8i-r40.dtsi"
> +#include "sun8i-r40-cpu-opp.dtsi"
>  
>  #include <dt-bindings/gpio/gpio.h>
>  
> 


  reply	other threads:[~2022-07-05  4:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  1:36 [PATCH v5 0/3] ARM: sun8i-r40: CPU improve qianfanguijin
2022-05-17  1:36 ` [PATCH v5 1/3] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board qianfanguijin
2022-07-05  4:45   ` Samuel Holland
2022-05-17  1:36 ` [PATCH v5 2/3] ARM: dts: sun8i-r40: add opp table for cpu qianfanguijin
2022-07-05  4:57   ` Samuel Holland [this message]
2022-05-17  1:36 ` [PATCH v5 3/3] ARM: dts: sun8i-r40: Add thermal trip points/cooling maps qianfanguijin
2022-07-05  5:07   ` Samuel Holland
2022-07-05 19:41 ` [PATCH v5 0/3] ARM: sun8i-r40: CPU improve Jernej Škrabec

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=161faad6-4ee5-97a7-ab4a-53bcb5b47334@sholland.org \
    --to=samuel@sholland.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mripard@kernel.org \
    --cc=qianfanguijin@163.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=wens@csie.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).