All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Hi3660: enable power management features
@ 2018-05-15  2:53 ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: Wei Xu, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk
  Cc: Leo Yan

Since hi3660 drivers have been merged into Linux kernel (mailbox driver is in
Linux-next branch and other drivers are existed in Linux mainline kernel), so
this patch series is to enable power management features on hi3660.

This patch series includes device tree binding for mailbox, stub clock and CPU
OPPs, and has one patch to consolidate the Kconfigs for driver modules.

This patch set have been tested on Hikey960 and also verified the patch 'hisi:
Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX' for Hikey620.

Changes from v1:
* Changed patch subject from "dts: arm64: hi3660" to "arm64: dts: hi3660".


Daniel Lezcano (1):
  hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX

Kaihua Zhong (2):
  arm64: dts: hi3660: Add mailbox node
  arm64: dts: hi3660: Add stub clock node

Leo Yan (1):
  arm64: dts: hi3660: Add CPU frequency scaling support

Tao Wang (1):
  arm64: dts: hi3660: Add thermal cooling management

 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 145 ++++++++++++++++++++++++++++++
 arch/arm64/configs/defconfig              |   1 -
 drivers/clk/hisilicon/Kconfig             |  13 +--
 drivers/mailbox/Kconfig                   |  12 ++-
 4 files changed, 161 insertions(+), 10 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 0/5] Hi3660: enable power management features
@ 2018-05-15  2:53 ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

Since hi3660 drivers have been merged into Linux kernel (mailbox driver is in
Linux-next branch and other drivers are existed in Linux mainline kernel), so
this patch series is to enable power management features on hi3660.

This patch series includes device tree binding for mailbox, stub clock and CPU
OPPs, and has one patch to consolidate the Kconfigs for driver modules.

This patch set have been tested on Hikey960 and also verified the patch 'hisi:
Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX' for Hikey620.

Changes from v1:
* Changed patch subject from "dts: arm64: hi3660" to "arm64: dts: hi3660".


Daniel Lezcano (1):
  hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX

Kaihua Zhong (2):
  arm64: dts: hi3660: Add mailbox node
  arm64: dts: hi3660: Add stub clock node

Leo Yan (1):
  arm64: dts: hi3660: Add CPU frequency scaling support

Tao Wang (1):
  arm64: dts: hi3660: Add thermal cooling management

 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 145 ++++++++++++++++++++++++++++++
 arch/arm64/configs/defconfig              |   1 -
 drivers/clk/hisilicon/Kconfig             |  13 +--
 drivers/mailbox/Kconfig                   |  12 ++-
 4 files changed, 161 insertions(+), 10 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 1/5] arm64: dts: hi3660: Add mailbox node
  2018-05-15  2:53 ` Leo Yan
@ 2018-05-15  2:53   ` Leo Yan
  -1 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: Wei Xu, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk
  Cc: Kaihua Zhong, Leo Yan

From: Kaihua Zhong <zhongkaihua@huawei.com>

Add the mailbox controller node for hi3660 platform.

Signed-off-by: Kaihua Zhong <zhongkaihua@huawei.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index ec3eb8e..b9e7c91 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -274,6 +274,14 @@
 			#reset-cells = <2>;
 		};
 
+		mailbox: mailbox@e896b000 {
+			compatible = "hisilicon,hi3660-mbox";
+			reg = <0x0 0xe896b000 0x0 0x1000>;
+			interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
+			#mbox-cells = <3>;
+		};
+
 		dual_timer0: timer@fff14000 {
 			compatible = "arm,sp804", "arm,primecell";
 			reg = <0x0 0xfff14000 0x0 0x1000>;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 1/5] arm64: dts: hi3660: Add mailbox node
@ 2018-05-15  2:53   ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kaihua Zhong <zhongkaihua@huawei.com>

Add the mailbox controller node for hi3660 platform.

Signed-off-by: Kaihua Zhong <zhongkaihua@huawei.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index ec3eb8e..b9e7c91 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -274,6 +274,14 @@
 			#reset-cells = <2>;
 		};
 
+		mailbox: mailbox at e896b000 {
+			compatible = "hisilicon,hi3660-mbox";
+			reg = <0x0 0xe896b000 0x0 0x1000>;
+			interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
+			#mbox-cells = <3>;
+		};
+
 		dual_timer0: timer at fff14000 {
 			compatible = "arm,sp804", "arm,primecell";
 			reg = <0x0 0xfff14000 0x0 0x1000>;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 2/5] arm64: dts: hi3660: Add stub clock node
  2018-05-15  2:53 ` Leo Yan
@ 2018-05-15  2:53   ` Leo Yan
  -1 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: Wei Xu, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk
  Cc: Kaihua Zhong, Leo Yan

From: Kaihua Zhong <zhongkaihua@huawei.com>

Add stub clock node for hi3660 platform.

Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Kaihua Zhong <zhongkaihua@huawei.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index b9e7c91..3a3bcff 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -282,6 +282,13 @@
 			#mbox-cells = <3>;
 		};
 
+		stub_clock: stub_clock@e896b500 {
+			compatible = "hisilicon,hi3660-stub-clk";
+			reg = <0x0 0xe896b500 0x0 0x0100>;
+			#clock-cells = <1>;
+			mboxes = <&mailbox 13 3 0>;
+		};
+
 		dual_timer0: timer@fff14000 {
 			compatible = "arm,sp804", "arm,primecell";
 			reg = <0x0 0xfff14000 0x0 0x1000>;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 2/5] arm64: dts: hi3660: Add stub clock node
@ 2018-05-15  2:53   ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kaihua Zhong <zhongkaihua@huawei.com>

Add stub clock node for hi3660 platform.

Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Kaihua Zhong <zhongkaihua@huawei.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index b9e7c91..3a3bcff 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -282,6 +282,13 @@
 			#mbox-cells = <3>;
 		};
 
+		stub_clock: stub_clock at e896b500 {
+			compatible = "hisilicon,hi3660-stub-clk";
+			reg = <0x0 0xe896b500 0x0 0x0100>;
+			#clock-cells = <1>;
+			mboxes = <&mailbox 13 3 0>;
+		};
+
 		dual_timer0: timer at fff14000 {
 			compatible = "arm,sp804", "arm,primecell";
 			reg = <0x0 0xfff14000 0x0 0x1000>;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 3/5] arm64: dts: hi3660: Add CPU frequency scaling support
  2018-05-15  2:53 ` Leo Yan
@ 2018-05-15  2:53   ` Leo Yan
  -1 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: Wei Xu, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk
  Cc: Leo Yan

Add two CPU OPP tables, one table is corresponding to one cluster,
which allow CPU frequency scaling on hi3660 platforms.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 86 +++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index 3a3bcff..a39da09 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -62,6 +62,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu1: cpu@1 {
@@ -72,6 +74,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu2: cpu@2 {
@@ -82,6 +86,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu3: cpu@3 {
@@ -92,6 +98,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu4: cpu@100 {
@@ -102,6 +110,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		cpu5: cpu@101 {
@@ -112,6 +122,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		cpu6: cpu@102 {
@@ -122,6 +134,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		cpu7: cpu@103 {
@@ -132,6 +146,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		idle-states {
@@ -174,6 +190,76 @@
 		};
 	};
 
+	cluster0_opp: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp00 {
+			opp-hz = /bits/ 64 <533000000>;
+			opp-microvolt = <700000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp01 {
+			opp-hz = /bits/ 64 <999000000>;
+			opp-microvolt = <800000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp02 {
+			opp-hz = /bits/ 64 <1402000000>;
+			opp-microvolt = <900000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp03 {
+			opp-hz = /bits/ 64 <1709000000>;
+			opp-microvolt = <1000000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp04 {
+			opp-hz = /bits/ 64 <1844000000>;
+			opp-microvolt = <1100000>;
+			clock-latency-ns = <300000>;
+		};
+	};
+
+	cluster1_opp: opp_table1 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp10 {
+			opp-hz = /bits/ 64 <903000000>;
+			opp-microvolt = <700000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp11 {
+			opp-hz = /bits/ 64 <1421000000>;
+			opp-microvolt = <800000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp12 {
+			opp-hz = /bits/ 64 <1805000000>;
+			opp-microvolt = <900000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp13 {
+			opp-hz = /bits/ 64 <2112000000>;
+			opp-microvolt = <1000000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp14 {
+			opp-hz = /bits/ 64 <2362000000>;
+			opp-microvolt = <1100000>;
+			clock-latency-ns = <300000>;
+		};
+	};
+
 	gic: interrupt-controller@e82b0000 {
 		compatible = "arm,gic-400";
 		reg = <0x0 0xe82b1000 0 0x1000>, /* GICD */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 3/5] arm64: dts: hi3660: Add CPU frequency scaling support
@ 2018-05-15  2:53   ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

Add two CPU OPP tables, one table is corresponding to one cluster,
which allow CPU frequency scaling on hi3660 platforms.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 86 +++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index 3a3bcff..a39da09 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -62,6 +62,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu1: cpu at 1 {
@@ -72,6 +74,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu2: cpu at 2 {
@@ -82,6 +86,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu3: cpu at 3 {
@@ -92,6 +98,8 @@
 			next-level-cache = <&A53_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>;
 			capacity-dmips-mhz = <592>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu4: cpu at 100 {
@@ -102,6 +110,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		cpu5: cpu at 101 {
@@ -112,6 +122,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		cpu6: cpu at 102 {
@@ -122,6 +134,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		cpu7: cpu at 103 {
@@ -132,6 +146,8 @@
 			next-level-cache = <&A73_L2>;
 			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
 			capacity-dmips-mhz = <1024>;
+			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
+			operating-points-v2 = <&cluster1_opp>;
 		};
 
 		idle-states {
@@ -174,6 +190,76 @@
 		};
 	};
 
+	cluster0_opp: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp00 {
+			opp-hz = /bits/ 64 <533000000>;
+			opp-microvolt = <700000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp01 {
+			opp-hz = /bits/ 64 <999000000>;
+			opp-microvolt = <800000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp02 {
+			opp-hz = /bits/ 64 <1402000000>;
+			opp-microvolt = <900000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp03 {
+			opp-hz = /bits/ 64 <1709000000>;
+			opp-microvolt = <1000000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp04 {
+			opp-hz = /bits/ 64 <1844000000>;
+			opp-microvolt = <1100000>;
+			clock-latency-ns = <300000>;
+		};
+	};
+
+	cluster1_opp: opp_table1 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp10 {
+			opp-hz = /bits/ 64 <903000000>;
+			opp-microvolt = <700000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp11 {
+			opp-hz = /bits/ 64 <1421000000>;
+			opp-microvolt = <800000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp12 {
+			opp-hz = /bits/ 64 <1805000000>;
+			opp-microvolt = <900000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp13 {
+			opp-hz = /bits/ 64 <2112000000>;
+			opp-microvolt = <1000000>;
+			clock-latency-ns = <300000>;
+		};
+
+		opp14 {
+			opp-hz = /bits/ 64 <2362000000>;
+			opp-microvolt = <1100000>;
+			clock-latency-ns = <300000>;
+		};
+	};
+
 	gic: interrupt-controller at e82b0000 {
 		compatible = "arm,gic-400";
 		reg = <0x0 0xe82b1000 0 0x1000>, /* GICD */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 4/5] arm64: dts: hi3660: Add thermal cooling management
  2018-05-15  2:53 ` Leo Yan
@ 2018-05-15  2:53   ` Leo Yan
  -1 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: Wei Xu, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk
  Cc: Tao Wang, Leo Yan

From: Tao Wang <jean.wangtao@linaro.org>

Add nodes and properties for thermal cooling management support.

Signed-off-by: Tao Wang <jean.wangtao@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 44 +++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index a39da09..e20edd9 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -7,6 +7,7 @@
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/hi3660-clock.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
 	compatible = "hisilicon,hi3660";
@@ -64,6 +65,8 @@
 			capacity-dmips-mhz = <592>;
 			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
 			operating-points-v2 = <&cluster0_opp>;
+			#cooling-cells = <2>;
+			dynamic-power-coefficient = <110>;
 		};
 
 		cpu1: cpu@1 {
@@ -112,6 +115,8 @@
 			capacity-dmips-mhz = <1024>;
 			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
 			operating-points-v2 = <&cluster1_opp>;
+			#cooling-cells = <2>;
+			dynamic-power-coefficient = <550>;
 		};
 
 		cpu5: cpu@101 {
@@ -1073,5 +1078,44 @@
 			interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
 			#thermal-sensor-cells = <1>;
 		};
+
+		thermal-zones {
+
+			cls0: cls0 {
+				polling-delay = <1000>;
+				polling-delay-passive = <100>;
+				sustainable-power = <4500>;
+
+				/* sensor ID */
+				thermal-sensors = <&tsensor 1>;
+
+				trips {
+					threshold: trip-point@0 {
+						temperature = <65000>;
+						hysteresis = <1000>;
+						type = "passive";
+					};
+
+					target: trip-point@1 {
+						temperature = <75000>;
+						hysteresis = <1000>;
+						type = "passive";
+					};
+				};
+
+				cooling-maps {
+					map0 {
+						trip = <&target>;
+						contribution = <1024>;
+						cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+					};
+					map1 {
+						trip = <&target>;
+						contribution = <512>;
+						cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+					};
+				};
+			};
+		};
 	};
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 4/5] arm64: dts: hi3660: Add thermal cooling management
@ 2018-05-15  2:53   ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tao Wang <jean.wangtao@linaro.org>

Add nodes and properties for thermal cooling management support.

Signed-off-by: Tao Wang <jean.wangtao@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 44 +++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index a39da09..e20edd9 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -7,6 +7,7 @@
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/hi3660-clock.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
 	compatible = "hisilicon,hi3660";
@@ -64,6 +65,8 @@
 			capacity-dmips-mhz = <592>;
 			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>;
 			operating-points-v2 = <&cluster0_opp>;
+			#cooling-cells = <2>;
+			dynamic-power-coefficient = <110>;
 		};
 
 		cpu1: cpu at 1 {
@@ -112,6 +115,8 @@
 			capacity-dmips-mhz = <1024>;
 			clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>;
 			operating-points-v2 = <&cluster1_opp>;
+			#cooling-cells = <2>;
+			dynamic-power-coefficient = <550>;
 		};
 
 		cpu5: cpu at 101 {
@@ -1073,5 +1078,44 @@
 			interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
 			#thermal-sensor-cells = <1>;
 		};
+
+		thermal-zones {
+
+			cls0: cls0 {
+				polling-delay = <1000>;
+				polling-delay-passive = <100>;
+				sustainable-power = <4500>;
+
+				/* sensor ID */
+				thermal-sensors = <&tsensor 1>;
+
+				trips {
+					threshold: trip-point at 0 {
+						temperature = <65000>;
+						hysteresis = <1000>;
+						type = "passive";
+					};
+
+					target: trip-point at 1 {
+						temperature = <75000>;
+						hysteresis = <1000>;
+						type = "passive";
+					};
+				};
+
+				cooling-maps {
+					map0 {
+						trip = <&target>;
+						contribution = <1024>;
+						cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+					};
+					map1 {
+						trip = <&target>;
+						contribution = <512>;
+						cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+					};
+				};
+			};
+		};
 	};
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 5/5] hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
  2018-05-15  2:53 ` Leo Yan
@ 2018-05-15  2:53   ` Leo Yan
  -1 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: Wei Xu, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk
  Cc: Leo Yan

From: Daniel Lezcano <daniel.lezcano@linaro.org>

The current defconfig is inconsistent as it selects the mailbox and
the clock for the hi6220 and the hi3660 without having their Kconfigs
making sure the dependencies are correct. It ends up when selecting
different versions for the kernel (for example when git bisecting)
those options disappear and they don't get back, leading to unexpected
behaviors. In our case, the cpufreq driver does no longer work because
the clock fails to initialize due to the clock stub and the mailbox
missing.

In order to have the dependencies correctly set when defaulting, let's
do the same as commit 3a49afb84ca074e ("clk: enable hi655x common clk
automatically") where we select automatically the driver when the
parent driver is selected. With sensible defaults in place, we can leave
other choices for EXPERT.

Acked-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/configs/defconfig  |  1 -
 drivers/clk/hisilicon/Kconfig | 13 ++++++++-----
 drivers/mailbox/Kconfig       | 12 ++++++++----
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index ecf6137..1d9d8b9 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -549,7 +549,6 @@ CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_ARM_MHU=y
 CONFIG_PLATFORM_MHU=y
 CONFIG_BCM2835_MBOX=y
-CONFIG_HI6220_MBOX=y
 CONFIG_QCOM_APCS_IPC=y
 CONFIG_ROCKCHIP_IOMMU=y
 CONFIG_TEGRA_IOMMU_SMMU=y
diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig
index 1bd4355..becdb1d 100644
--- a/drivers/clk/hisilicon/Kconfig
+++ b/drivers/clk/hisilicon/Kconfig
@@ -44,14 +44,17 @@ config RESET_HISI
 	  Build reset controller driver for HiSilicon device chipsets.
 
 config STUB_CLK_HI6220
-	bool "Hi6220 Stub Clock Driver"
-	depends on COMMON_CLK_HI6220 && MAILBOX
-	default ARCH_HISI
+	bool "Hi6220 Stub Clock Driver" if EXPERT
+	depends on (COMMON_CLK_HI6220 || COMPILE_TEST)
+	depends on MAILBOX
+	default COMMON_CLK_HI6220
 	help
 	  Build the Hisilicon Hi6220 stub clock driver.
 
 config STUB_CLK_HI3660
-	bool "Hi3660 Stub Clock Driver"
-	depends on COMMON_CLK_HI3660 && MAILBOX
+	bool "Hi3660 Stub Clock Driver" if EXPERT
+	depends on (COMMON_CLK_HI3660 || COMPILE_TEST)
+	depends on MAILBOX
+	default COMMON_CLK_HI3660
 	help
 	  Build the Hisilicon Hi3660 stub clock driver.
diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
index a2bb274..567cd02 100644
--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -109,16 +109,20 @@ config TI_MESSAGE_MANAGER
 	  platform has support for the hardware block.
 
 config HI3660_MBOX
-	tristate "Hi3660 Mailbox"
-	depends on ARCH_HISI && OF
+	tristate "Hi3660 Mailbox" if EXPERT
+	depends on (ARCH_HISI || COMPILE_TEST)
+	depends on OF
+	default ARCH_HISI
 	help
 	  An implementation of the hi3660 mailbox. It is used to send message
 	  between application processors and other processors/MCU/DSP. Select
 	  Y here if you want to use Hi3660 mailbox controller.
 
 config HI6220_MBOX
-	tristate "Hi6220 Mailbox"
-	depends on ARCH_HISI
+	tristate "Hi6220 Mailbox" if EXPERT
+	depends on (ARCH_HISI || COMPILE_TEST)
+	depends on OF
+	default ARCH_HISI
 	help
 	  An implementation of the hi6220 mailbox. It is used to send message
 	  between application processors and MCU. Say Y here if you want to
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 5/5] hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
@ 2018-05-15  2:53   ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15  2:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Daniel Lezcano <daniel.lezcano@linaro.org>

The current defconfig is inconsistent as it selects the mailbox and
the clock for the hi6220 and the hi3660 without having their Kconfigs
making sure the dependencies are correct. It ends up when selecting
different versions for the kernel (for example when git bisecting)
those options disappear and they don't get back, leading to unexpected
behaviors. In our case, the cpufreq driver does no longer work because
the clock fails to initialize due to the clock stub and the mailbox
missing.

In order to have the dependencies correctly set when defaulting, let's
do the same as commit 3a49afb84ca074e ("clk: enable hi655x common clk
automatically") where we select automatically the driver when the
parent driver is selected. With sensible defaults in place, we can leave
other choices for EXPERT.

Acked-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 arch/arm64/configs/defconfig  |  1 -
 drivers/clk/hisilicon/Kconfig | 13 ++++++++-----
 drivers/mailbox/Kconfig       | 12 ++++++++----
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index ecf6137..1d9d8b9 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -549,7 +549,6 @@ CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_ARM_MHU=y
 CONFIG_PLATFORM_MHU=y
 CONFIG_BCM2835_MBOX=y
-CONFIG_HI6220_MBOX=y
 CONFIG_QCOM_APCS_IPC=y
 CONFIG_ROCKCHIP_IOMMU=y
 CONFIG_TEGRA_IOMMU_SMMU=y
diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig
index 1bd4355..becdb1d 100644
--- a/drivers/clk/hisilicon/Kconfig
+++ b/drivers/clk/hisilicon/Kconfig
@@ -44,14 +44,17 @@ config RESET_HISI
 	  Build reset controller driver for HiSilicon device chipsets.
 
 config STUB_CLK_HI6220
-	bool "Hi6220 Stub Clock Driver"
-	depends on COMMON_CLK_HI6220 && MAILBOX
-	default ARCH_HISI
+	bool "Hi6220 Stub Clock Driver" if EXPERT
+	depends on (COMMON_CLK_HI6220 || COMPILE_TEST)
+	depends on MAILBOX
+	default COMMON_CLK_HI6220
 	help
 	  Build the Hisilicon Hi6220 stub clock driver.
 
 config STUB_CLK_HI3660
-	bool "Hi3660 Stub Clock Driver"
-	depends on COMMON_CLK_HI3660 && MAILBOX
+	bool "Hi3660 Stub Clock Driver" if EXPERT
+	depends on (COMMON_CLK_HI3660 || COMPILE_TEST)
+	depends on MAILBOX
+	default COMMON_CLK_HI3660
 	help
 	  Build the Hisilicon Hi3660 stub clock driver.
diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
index a2bb274..567cd02 100644
--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -109,16 +109,20 @@ config TI_MESSAGE_MANAGER
 	  platform has support for the hardware block.
 
 config HI3660_MBOX
-	tristate "Hi3660 Mailbox"
-	depends on ARCH_HISI && OF
+	tristate "Hi3660 Mailbox" if EXPERT
+	depends on (ARCH_HISI || COMPILE_TEST)
+	depends on OF
+	default ARCH_HISI
 	help
 	  An implementation of the hi3660 mailbox. It is used to send message
 	  between application processors and other processors/MCU/DSP. Select
 	  Y here if you want to use Hi3660 mailbox controller.
 
 config HI6220_MBOX
-	tristate "Hi6220 Mailbox"
-	depends on ARCH_HISI
+	tristate "Hi6220 Mailbox" if EXPERT
+	depends on (ARCH_HISI || COMPILE_TEST)
+	depends on OF
+	default ARCH_HISI
 	help
 	  An implementation of the hi6220 mailbox. It is used to send message
 	  between application processors and MCU. Say Y here if you want to
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 5/5] hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
  2018-05-15  2:53   ` Leo Yan
  (?)
@ 2018-05-15  8:23     ` Wei Xu
  -1 siblings, 0 replies; 20+ messages in thread
From: Wei Xu @ 2018-05-15  8:23 UTC (permalink / raw)
  To: Leo Yan, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk

Hi Leo, Daniel,

On 2018/5/15 3:53, Leo Yan wrote:
> From: Daniel Lezcano <daniel.lezcano@linaro.org>
> 
> The current defconfig is inconsistent as it selects the mailbox and
> the clock for the hi6220 and the hi3660 without having their Kconfigs
> making sure the dependencies are correct. It ends up when selecting
> different versions for the kernel (for example when git bisecting)
> those options disappear and they don't get back, leading to unexpected
> behaviors. In our case, the cpufreq driver does no longer work because
> the clock fails to initialize due to the clock stub and the mailbox
> missing.
> 
> In order to have the dependencies correctly set when defaulting, let's
> do the same as commit 3a49afb84ca074e ("clk: enable hi655x common clk
> automatically") where we select automatically the driver when the
> parent driver is selected. With sensible defaults in place, we can leave
> other choices for EXPERT.
> 
> Acked-by: Stephen Boyd <sboyd@kernel.org>
> Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  arch/arm64/configs/defconfig  |  1 -
>  drivers/clk/hisilicon/Kconfig | 13 ++++++++-----
>  drivers/mailbox/Kconfig       | 12 ++++++++----
>  3 files changed, 16 insertions(+), 10 deletions(-)

Could you separate this patch into clk, mailbox and defconfig 3 parts?
Thanks!

Best Regards,
Wei

> 
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index ecf6137..1d9d8b9 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -549,7 +549,6 @@ CONFIG_HWSPINLOCK_QCOM=y
>  CONFIG_ARM_MHU=y
>  CONFIG_PLATFORM_MHU=y
>  CONFIG_BCM2835_MBOX=y
> -CONFIG_HI6220_MBOX=y
>  CONFIG_QCOM_APCS_IPC=y
>  CONFIG_ROCKCHIP_IOMMU=y
>  CONFIG_TEGRA_IOMMU_SMMU=y
> diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig
> index 1bd4355..becdb1d 100644
> --- a/drivers/clk/hisilicon/Kconfig
> +++ b/drivers/clk/hisilicon/Kconfig
> @@ -44,14 +44,17 @@ config RESET_HISI
>  	  Build reset controller driver for HiSilicon device chipsets.
>  
>  config STUB_CLK_HI6220
> -	bool "Hi6220 Stub Clock Driver"
> -	depends on COMMON_CLK_HI6220 && MAILBOX
> -	default ARCH_HISI
> +	bool "Hi6220 Stub Clock Driver" if EXPERT
> +	depends on (COMMON_CLK_HI6220 || COMPILE_TEST)
> +	depends on MAILBOX
> +	default COMMON_CLK_HI6220
>  	help
>  	  Build the Hisilicon Hi6220 stub clock driver.
>  
>  config STUB_CLK_HI3660
> -	bool "Hi3660 Stub Clock Driver"
> -	depends on COMMON_CLK_HI3660 && MAILBOX
> +	bool "Hi3660 Stub Clock Driver" if EXPERT
> +	depends on (COMMON_CLK_HI3660 || COMPILE_TEST)
> +	depends on MAILBOX
> +	default COMMON_CLK_HI3660
>  	help
>  	  Build the Hisilicon Hi3660 stub clock driver.
> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> index a2bb274..567cd02 100644
> --- a/drivers/mailbox/Kconfig
> +++ b/drivers/mailbox/Kconfig
> @@ -109,16 +109,20 @@ config TI_MESSAGE_MANAGER
>  	  platform has support for the hardware block.
>  
>  config HI3660_MBOX
> -	tristate "Hi3660 Mailbox"
> -	depends on ARCH_HISI && OF
> +	tristate "Hi3660 Mailbox" if EXPERT
> +	depends on (ARCH_HISI || COMPILE_TEST)
> +	depends on OF
> +	default ARCH_HISI
>  	help
>  	  An implementation of the hi3660 mailbox. It is used to send message
>  	  between application processors and other processors/MCU/DSP. Select
>  	  Y here if you want to use Hi3660 mailbox controller.
>  
>  config HI6220_MBOX
> -	tristate "Hi6220 Mailbox"
> -	depends on ARCH_HISI
> +	tristate "Hi6220 Mailbox" if EXPERT
> +	depends on (ARCH_HISI || COMPILE_TEST)
> +	depends on OF
> +	default ARCH_HISI
>  	help
>  	  An implementation of the hi6220 mailbox. It is used to send message
>  	  between application processors and MCU. Say Y here if you want to
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 5/5] hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
@ 2018-05-15  8:23     ` Wei Xu
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Xu @ 2018-05-15  8:23 UTC (permalink / raw)
  To: Leo Yan, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk

Hi Leo, Daniel,

On 2018/5/15 3:53, Leo Yan wrote:
> From: Daniel Lezcano <daniel.lezcano@linaro.org>
> 
> The current defconfig is inconsistent as it selects the mailbox and
> the clock for the hi6220 and the hi3660 without having their Kconfigs
> making sure the dependencies are correct. It ends up when selecting
> different versions for the kernel (for example when git bisecting)
> those options disappear and they don't get back, leading to unexpected
> behaviors. In our case, the cpufreq driver does no longer work because
> the clock fails to initialize due to the clock stub and the mailbox
> missing.
> 
> In order to have the dependencies correctly set when defaulting, let's
> do the same as commit 3a49afb84ca074e ("clk: enable hi655x common clk
> automatically") where we select automatically the driver when the
> parent driver is selected. With sensible defaults in place, we can leave
> other choices for EXPERT.
> 
> Acked-by: Stephen Boyd <sboyd@kernel.org>
> Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  arch/arm64/configs/defconfig  |  1 -
>  drivers/clk/hisilicon/Kconfig | 13 ++++++++-----
>  drivers/mailbox/Kconfig       | 12 ++++++++----
>  3 files changed, 16 insertions(+), 10 deletions(-)

Could you separate this patch into clk, mailbox and defconfig 3 parts?
Thanks!

Best Regards,
Wei

> 
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index ecf6137..1d9d8b9 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -549,7 +549,6 @@ CONFIG_HWSPINLOCK_QCOM=y
>  CONFIG_ARM_MHU=y
>  CONFIG_PLATFORM_MHU=y
>  CONFIG_BCM2835_MBOX=y
> -CONFIG_HI6220_MBOX=y
>  CONFIG_QCOM_APCS_IPC=y
>  CONFIG_ROCKCHIP_IOMMU=y
>  CONFIG_TEGRA_IOMMU_SMMU=y
> diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig
> index 1bd4355..becdb1d 100644
> --- a/drivers/clk/hisilicon/Kconfig
> +++ b/drivers/clk/hisilicon/Kconfig
> @@ -44,14 +44,17 @@ config RESET_HISI
>  	  Build reset controller driver for HiSilicon device chipsets.
>  
>  config STUB_CLK_HI6220
> -	bool "Hi6220 Stub Clock Driver"
> -	depends on COMMON_CLK_HI6220 && MAILBOX
> -	default ARCH_HISI
> +	bool "Hi6220 Stub Clock Driver" if EXPERT
> +	depends on (COMMON_CLK_HI6220 || COMPILE_TEST)
> +	depends on MAILBOX
> +	default COMMON_CLK_HI6220
>  	help
>  	  Build the Hisilicon Hi6220 stub clock driver.
>  
>  config STUB_CLK_HI3660
> -	bool "Hi3660 Stub Clock Driver"
> -	depends on COMMON_CLK_HI3660 && MAILBOX
> +	bool "Hi3660 Stub Clock Driver" if EXPERT
> +	depends on (COMMON_CLK_HI3660 || COMPILE_TEST)
> +	depends on MAILBOX
> +	default COMMON_CLK_HI3660
>  	help
>  	  Build the Hisilicon Hi3660 stub clock driver.
> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> index a2bb274..567cd02 100644
> --- a/drivers/mailbox/Kconfig
> +++ b/drivers/mailbox/Kconfig
> @@ -109,16 +109,20 @@ config TI_MESSAGE_MANAGER
>  	  platform has support for the hardware block.
>  
>  config HI3660_MBOX
> -	tristate "Hi3660 Mailbox"
> -	depends on ARCH_HISI && OF
> +	tristate "Hi3660 Mailbox" if EXPERT
> +	depends on (ARCH_HISI || COMPILE_TEST)
> +	depends on OF
> +	default ARCH_HISI
>  	help
>  	  An implementation of the hi3660 mailbox. It is used to send message
>  	  between application processors and other processors/MCU/DSP. Select
>  	  Y here if you want to use Hi3660 mailbox controller.
>  
>  config HI6220_MBOX
> -	tristate "Hi6220 Mailbox"
> -	depends on ARCH_HISI
> +	tristate "Hi6220 Mailbox" if EXPERT
> +	depends on (ARCH_HISI || COMPILE_TEST)
> +	depends on OF
> +	default ARCH_HISI
>  	help
>  	  An implementation of the hi6220 mailbox. It is used to send message
>  	  between application processors and MCU. Say Y here if you want to
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 5/5] hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
@ 2018-05-15  8:23     ` Wei Xu
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Xu @ 2018-05-15  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Leo, Daniel,

On 2018/5/15 3:53, Leo Yan wrote:
> From: Daniel Lezcano <daniel.lezcano@linaro.org>
> 
> The current defconfig is inconsistent as it selects the mailbox and
> the clock for the hi6220 and the hi3660 without having their Kconfigs
> making sure the dependencies are correct. It ends up when selecting
> different versions for the kernel (for example when git bisecting)
> those options disappear and they don't get back, leading to unexpected
> behaviors. In our case, the cpufreq driver does no longer work because
> the clock fails to initialize due to the clock stub and the mailbox
> missing.
> 
> In order to have the dependencies correctly set when defaulting, let's
> do the same as commit 3a49afb84ca074e ("clk: enable hi655x common clk
> automatically") where we select automatically the driver when the
> parent driver is selected. With sensible defaults in place, we can leave
> other choices for EXPERT.
> 
> Acked-by: Stephen Boyd <sboyd@kernel.org>
> Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  arch/arm64/configs/defconfig  |  1 -
>  drivers/clk/hisilicon/Kconfig | 13 ++++++++-----
>  drivers/mailbox/Kconfig       | 12 ++++++++----
>  3 files changed, 16 insertions(+), 10 deletions(-)

Could you separate this patch into clk, mailbox and defconfig 3 parts?
Thanks!

Best Regards,
Wei

> 
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index ecf6137..1d9d8b9 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -549,7 +549,6 @@ CONFIG_HWSPINLOCK_QCOM=y
>  CONFIG_ARM_MHU=y
>  CONFIG_PLATFORM_MHU=y
>  CONFIG_BCM2835_MBOX=y
> -CONFIG_HI6220_MBOX=y
>  CONFIG_QCOM_APCS_IPC=y
>  CONFIG_ROCKCHIP_IOMMU=y
>  CONFIG_TEGRA_IOMMU_SMMU=y
> diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig
> index 1bd4355..becdb1d 100644
> --- a/drivers/clk/hisilicon/Kconfig
> +++ b/drivers/clk/hisilicon/Kconfig
> @@ -44,14 +44,17 @@ config RESET_HISI
>  	  Build reset controller driver for HiSilicon device chipsets.
>  
>  config STUB_CLK_HI6220
> -	bool "Hi6220 Stub Clock Driver"
> -	depends on COMMON_CLK_HI6220 && MAILBOX
> -	default ARCH_HISI
> +	bool "Hi6220 Stub Clock Driver" if EXPERT
> +	depends on (COMMON_CLK_HI6220 || COMPILE_TEST)
> +	depends on MAILBOX
> +	default COMMON_CLK_HI6220
>  	help
>  	  Build the Hisilicon Hi6220 stub clock driver.
>  
>  config STUB_CLK_HI3660
> -	bool "Hi3660 Stub Clock Driver"
> -	depends on COMMON_CLK_HI3660 && MAILBOX
> +	bool "Hi3660 Stub Clock Driver" if EXPERT
> +	depends on (COMMON_CLK_HI3660 || COMPILE_TEST)
> +	depends on MAILBOX
> +	default COMMON_CLK_HI3660
>  	help
>  	  Build the Hisilicon Hi3660 stub clock driver.
> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> index a2bb274..567cd02 100644
> --- a/drivers/mailbox/Kconfig
> +++ b/drivers/mailbox/Kconfig
> @@ -109,16 +109,20 @@ config TI_MESSAGE_MANAGER
>  	  platform has support for the hardware block.
>  
>  config HI3660_MBOX
> -	tristate "Hi3660 Mailbox"
> -	depends on ARCH_HISI && OF
> +	tristate "Hi3660 Mailbox" if EXPERT
> +	depends on (ARCH_HISI || COMPILE_TEST)
> +	depends on OF
> +	default ARCH_HISI
>  	help
>  	  An implementation of the hi3660 mailbox. It is used to send message
>  	  between application processors and other processors/MCU/DSP. Select
>  	  Y here if you want to use Hi3660 mailbox controller.
>  
>  config HI6220_MBOX
> -	tristate "Hi6220 Mailbox"
> -	depends on ARCH_HISI
> +	tristate "Hi6220 Mailbox" if EXPERT
> +	depends on (ARCH_HISI || COMPILE_TEST)
> +	depends on OF
> +	default ARCH_HISI
>  	help
>  	  An implementation of the hi6220 mailbox. It is used to send message
>  	  between application processors and MCU. Say Y here if you want to
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 0/5] Hi3660: enable power management features
  2018-05-15  2:53 ` Leo Yan
  (?)
@ 2018-05-15 14:50   ` Wei Xu
  -1 siblings, 0 replies; 20+ messages in thread
From: Wei Xu @ 2018-05-15 14:50 UTC (permalink / raw)
  To: Leo Yan, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk

Hi Leo,

On 2018/5/15 3:53, Leo Yan wrote:
> Since hi3660 drivers have been merged into Linux kernel (mailbox driver is in
> Linux-next branch and other drivers are existed in Linux mainline kernel), so
> this patch series is to enable power management features on hi3660.
> 
> This patch series includes device tree binding for mailbox, stub clock and CPU
> OPPs, and has one patch to consolidate the Kconfigs for driver modules.
> 
> This patch set have been tested on Hikey960 and also verified the patch 'hisi:
> Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX' for Hikey620.
> 
> Changes from v1:
> * Changed patch subject from "dts: arm64: hi3660" to "arm64: dts: hi3660".
> 
> 
> Daniel Lezcano (1):
>   hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
> 
> Kaihua Zhong (2):
>   arm64: dts: hi3660: Add mailbox node
>   arm64: dts: hi3660: Add stub clock node
> 
> Leo Yan (1):
>   arm64: dts: hi3660: Add CPU frequency scaling support
> 
> Tao Wang (1):
>   arm64: dts: hi3660: Add thermal cooling management
> 
>  arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 145 ++++++++++++++++++++++++++++++
>  arch/arm64/configs/defconfig              |   1 -
>  drivers/clk/hisilicon/Kconfig             |  13 +--
>  drivers/mailbox/Kconfig                   |  12 ++-
>  4 files changed, 161 insertions(+), 10 deletions(-)
> 

Applied patch 1 to 4.
Thanks!

Best Regards,
Wei

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 0/5] Hi3660: enable power management features
@ 2018-05-15 14:50   ` Wei Xu
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Xu @ 2018-05-15 14:50 UTC (permalink / raw)
  To: Leo Yan, Rob Herring, Mark Rutland, Michael Turquette,
	Stephen Boyd, Jassi Brar, Arnd Bergmann, Olof Johansson,
	Daniel Lezcano, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk

Hi Leo,

On 2018/5/15 3:53, Leo Yan wrote:
> Since hi3660 drivers have been merged into Linux kernel (mailbox driver is in
> Linux-next branch and other drivers are existed in Linux mainline kernel), so
> this patch series is to enable power management features on hi3660.
> 
> This patch series includes device tree binding for mailbox, stub clock and CPU
> OPPs, and has one patch to consolidate the Kconfigs for driver modules.
> 
> This patch set have been tested on Hikey960 and also verified the patch 'hisi:
> Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX' for Hikey620.
> 
> Changes from v1:
> * Changed patch subject from "dts: arm64: hi3660" to "arm64: dts: hi3660".
> 
> 
> Daniel Lezcano (1):
>   hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
> 
> Kaihua Zhong (2):
>   arm64: dts: hi3660: Add mailbox node
>   arm64: dts: hi3660: Add stub clock node
> 
> Leo Yan (1):
>   arm64: dts: hi3660: Add CPU frequency scaling support
> 
> Tao Wang (1):
>   arm64: dts: hi3660: Add thermal cooling management
> 
>  arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 145 ++++++++++++++++++++++++++++++
>  arch/arm64/configs/defconfig              |   1 -
>  drivers/clk/hisilicon/Kconfig             |  13 +--
>  drivers/mailbox/Kconfig                   |  12 ++-
>  4 files changed, 161 insertions(+), 10 deletions(-)
> 

Applied patch 1 to 4.
Thanks!

Best Regards,
Wei

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 0/5] Hi3660: enable power management features
@ 2018-05-15 14:50   ` Wei Xu
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Xu @ 2018-05-15 14:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Leo,

On 2018/5/15 3:53, Leo Yan wrote:
> Since hi3660 drivers have been merged into Linux kernel (mailbox driver is in
> Linux-next branch and other drivers are existed in Linux mainline kernel), so
> this patch series is to enable power management features on hi3660.
> 
> This patch series includes device tree binding for mailbox, stub clock and CPU
> OPPs, and has one patch to consolidate the Kconfigs for driver modules.
> 
> This patch set have been tested on Hikey960 and also verified the patch 'hisi:
> Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX' for Hikey620.
> 
> Changes from v1:
> * Changed patch subject from "dts: arm64: hi3660" to "arm64: dts: hi3660".
> 
> 
> Daniel Lezcano (1):
>   hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
> 
> Kaihua Zhong (2):
>   arm64: dts: hi3660: Add mailbox node
>   arm64: dts: hi3660: Add stub clock node
> 
> Leo Yan (1):
>   arm64: dts: hi3660: Add CPU frequency scaling support
> 
> Tao Wang (1):
>   arm64: dts: hi3660: Add thermal cooling management
> 
>  arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 145 ++++++++++++++++++++++++++++++
>  arch/arm64/configs/defconfig              |   1 -
>  drivers/clk/hisilicon/Kconfig             |  13 +--
>  drivers/mailbox/Kconfig                   |  12 ++-
>  4 files changed, 161 insertions(+), 10 deletions(-)
> 

Applied patch 1 to 4.
Thanks!

Best Regards,
Wei

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 0/5] Hi3660: enable power management features
  2018-05-15 14:50   ` Wei Xu
@ 2018-05-15 14:54     ` Leo Yan
  -1 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15 14:54 UTC (permalink / raw)
  To: Wei Xu
  Cc: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd,
	Jassi Brar, Arnd Bergmann, Olof Johansson, Daniel Lezcano,
	linux-arm-kernel, devicetree, linux-kernel, linux-clk

On Tue, May 15, 2018 at 03:50:54PM +0100, Wei Xu wrote:
> Hi Leo,
> 
> On 2018/5/15 3:53, Leo Yan wrote:
> > Since hi3660 drivers have been merged into Linux kernel (mailbox driver is in
> > Linux-next branch and other drivers are existed in Linux mainline kernel), so
> > this patch series is to enable power management features on hi3660.
> > 
> > This patch series includes device tree binding for mailbox, stub clock and CPU
> > OPPs, and has one patch to consolidate the Kconfigs for driver modules.
> > 
> > This patch set have been tested on Hikey960 and also verified the patch 'hisi:
> > Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX' for Hikey620.
> > 
> > Changes from v1:
> > * Changed patch subject from "dts: arm64: hi3660" to "arm64: dts: hi3660".
> > 
> > 
> > Daniel Lezcano (1):
> >   hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
> > 
> > Kaihua Zhong (2):
> >   arm64: dts: hi3660: Add mailbox node
> >   arm64: dts: hi3660: Add stub clock node
> > 
> > Leo Yan (1):
> >   arm64: dts: hi3660: Add CPU frequency scaling support
> > 
> > Tao Wang (1):
> >   arm64: dts: hi3660: Add thermal cooling management
> > 
> >  arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 145 ++++++++++++++++++++++++++++++
> >  arch/arm64/configs/defconfig              |   1 -
> >  drivers/clk/hisilicon/Kconfig             |  13 +--
> >  drivers/mailbox/Kconfig                   |  12 ++-
> >  4 files changed, 161 insertions(+), 10 deletions(-)
> > 
> 
> Applied patch 1 to 4.
> Thanks!

Thanks a lot, Wei.

> Best Regards,
> Wei
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 0/5] Hi3660: enable power management features
@ 2018-05-15 14:54     ` Leo Yan
  0 siblings, 0 replies; 20+ messages in thread
From: Leo Yan @ 2018-05-15 14:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, May 15, 2018 at 03:50:54PM +0100, Wei Xu wrote:
> Hi Leo,
> 
> On 2018/5/15 3:53, Leo Yan wrote:
> > Since hi3660 drivers have been merged into Linux kernel (mailbox driver is in
> > Linux-next branch and other drivers are existed in Linux mainline kernel), so
> > this patch series is to enable power management features on hi3660.
> > 
> > This patch series includes device tree binding for mailbox, stub clock and CPU
> > OPPs, and has one patch to consolidate the Kconfigs for driver modules.
> > 
> > This patch set have been tested on Hikey960 and also verified the patch 'hisi:
> > Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX' for Hikey620.
> > 
> > Changes from v1:
> > * Changed patch subject from "dts: arm64: hi3660" to "arm64: dts: hi3660".
> > 
> > 
> > Daniel Lezcano (1):
> >   hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX
> > 
> > Kaihua Zhong (2):
> >   arm64: dts: hi3660: Add mailbox node
> >   arm64: dts: hi3660: Add stub clock node
> > 
> > Leo Yan (1):
> >   arm64: dts: hi3660: Add CPU frequency scaling support
> > 
> > Tao Wang (1):
> >   arm64: dts: hi3660: Add thermal cooling management
> > 
> >  arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 145 ++++++++++++++++++++++++++++++
> >  arch/arm64/configs/defconfig              |   1 -
> >  drivers/clk/hisilicon/Kconfig             |  13 +--
> >  drivers/mailbox/Kconfig                   |  12 ++-
> >  4 files changed, 161 insertions(+), 10 deletions(-)
> > 
> 
> Applied patch 1 to 4.
> Thanks!

Thanks a lot, Wei.

> Best Regards,
> Wei
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-05-15 14:55 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  2:53 [PATCH v2 0/5] Hi3660: enable power management features Leo Yan
2018-05-15  2:53 ` Leo Yan
2018-05-15  2:53 ` [PATCH v2 1/5] arm64: dts: hi3660: Add mailbox node Leo Yan
2018-05-15  2:53   ` Leo Yan
2018-05-15  2:53 ` [PATCH v2 2/5] arm64: dts: hi3660: Add stub clock node Leo Yan
2018-05-15  2:53   ` Leo Yan
2018-05-15  2:53 ` [PATCH v2 3/5] arm64: dts: hi3660: Add CPU frequency scaling support Leo Yan
2018-05-15  2:53   ` Leo Yan
2018-05-15  2:53 ` [PATCH v2 4/5] arm64: dts: hi3660: Add thermal cooling management Leo Yan
2018-05-15  2:53   ` Leo Yan
2018-05-15  2:53 ` [PATCH v2 5/5] hisi: Consolidate the Kconfigs for the CLOCK_STUB and the MAILBOX Leo Yan
2018-05-15  2:53   ` Leo Yan
2018-05-15  8:23   ` Wei Xu
2018-05-15  8:23     ` Wei Xu
2018-05-15  8:23     ` Wei Xu
2018-05-15 14:50 ` [PATCH v2 0/5] Hi3660: enable power management features Wei Xu
2018-05-15 14:50   ` Wei Xu
2018-05-15 14:50   ` Wei Xu
2018-05-15 14:54   ` Leo Yan
2018-05-15 14:54     ` Leo Yan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.