* [PATCH 0/8] Support and fixes the rk3228 SoCS for thermal
@ 2016-02-03 4:12 Caesar Wang
2016-02-03 4:12 ` [PATCH 1/8] clk: rockchip: add id of the tsadc clock found on rk3228 SoCs Caesar Wang
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Caesar Wang @ 2016-02-03 4:12 UTC (permalink / raw)
To: Heiko Stuebner, edubezval
Cc: huangtao, linux-rockchip, zhangqing, Dmitry Torokhov, Caesar Wang,
devicetree, Michael Turquette, linux-pm, Stephen Boyd, Kumar Gala,
linux-kernel, Ian Campbell, Rob Herring, linux-arm-kernel,
Pawel Moll, Zhang Rui, Mark Rutland, Russell King, linux-clk,
Jeffy Chen
Hello Eduardo, Heiko, Michael & Stephen:
This series pacthes to support the rk3228 SoCs thermal.
They have the following patches to work on rk3228 SoCs.
bdc79c0 ARM: dts: rockchip: add the thermal main info found on rk3228
22ea3c3 ARM: dts: rockchip: enable the tsadc for rk3228 evb
b907b75 thermal: rockchip: fix the tsadc sequence output on rk3228/rk3399
fb11fbd thermal: rockchip: the rename compatibles for rockchip SoCs
df9c1bd thermal: rockchip: fix calculation error for code_to_temp
bd2720c thermal: rockchip: fix a impossible condition caused by the warning
8cf2d1b clk: rockchip: add the tsadc clocks found on rk3228 SoCs
1a6f334 clk: rockchip: add id of the tsadc clock found on rk3228 SoCs
Verified on https://github.com/Caesar-github/rockchip/tree/rk3228-thermal-tests.
This series patches are based on
Linux version 4.5.0-rc1+ (wxt@ubuntu) (...) #186 SMP Tue Feb 2 17:11:48 CST 2016
---
Hi Michael,Stephen
PATCH[1/8-2/8]:
Add the tsadc needed clocks for rk3228 SoCs
Hi Eduardo,
PATCH[3/8]:
To fix a build warning came from Dan Carpenter report smatch check,
Thanks.
As the patch exists in https://patchwork.kernel.org/patch/7757311/
PATCH[4/8]:
fix calculation error for code_to_temp
That's a error since the copy causes.
PATCH[5/8]:
the rename compatibles for rockchip SoCs
As the more and more rockchip SOCs are supported in thermal driver. this pacth
supposed to be compatible for better.
PATCH[6/8]:
fix the tsadc sequence output on rk3228/rk3399
Fixes the tsadc sequence output since the rk3228/rk3399 SoCs design.
Hi Heiko,
PATCH[7/8-8/8]: thermal DTS
1) add the thermal main info found on rk3228
2) enable the tsadc for rk3228 evb
I'd appreciate if someone have free time to review that. :)
Caesar Wang (7):
clk: rockchip: add id of the tsadc clock found on rk3228 SoCs
clk: rockchip: add the tsadc clocks found on rk3228 SoCs
thermal: rockchip: fix a impossible condition caused by the warning
thermal: rockchip: the rename compatibles for rockchip SoCs
thermal: rockchip: fix the tsadc sequence output on rk3228/rk3399
ARM: dts: rockchip: enable the tsadc for rk3228 evb
ARM: dts: rockchip: add the thermal main info found on rk3228
Elaine Zhang (1):
thermal: rockchip: fix calculation error for code_to_temp
arch/arm/boot/dts/rk3228-evb.dts | 7 +
arch/arm/boot/dts/rk3228.dtsi | 69 ++++++++++
drivers/clk/rockchip/clk-rk3228.c | 4 +-
drivers/thermal/rockchip_thermal.c | 239 +++++++++++++++++++--------------
include/dt-bindings/clock/rk3228-cru.h | 2 +
5 files changed, 216 insertions(+), 105 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/8] clk: rockchip: add id of the tsadc clock found on rk3228 SoCs
2016-02-03 4:12 [PATCH 0/8] Support and fixes the rk3228 SoCS for thermal Caesar Wang
@ 2016-02-03 4:12 ` Caesar Wang
2016-02-03 4:12 ` [PATCH 7/8] ARM: dts: rockchip: enable the tsadc for rk3228 evb Caesar Wang
2016-02-03 4:12 ` [PATCH 8/8] ARM: dts: rockchip: add the thermal main info found on rk3228 Caesar Wang
2 siblings, 0 replies; 6+ messages in thread
From: Caesar Wang @ 2016-02-03 4:12 UTC (permalink / raw)
To: Heiko Stuebner, edubezval
Cc: huangtao, linux-rockchip, zhangqing, Dmitry Torokhov, Caesar Wang,
devicetree, Kumar Gala, linux-kernel, Ian Campbell, Rob Herring,
Pawel Moll, Mark Rutland, Jeffy Chen
This patch adds 'SCLK_TSADC' and 'PCLK_TSADC' id found on rk3228 SoCs.
That will be needed by TSADC controller.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---
include/dt-bindings/clock/rk3228-cru.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/dt-bindings/clock/rk3228-cru.h b/include/dt-bindings/clock/rk3228-cru.h
index a78dd89..cd2e06b 100644
--- a/include/dt-bindings/clock/rk3228-cru.h
+++ b/include/dt-bindings/clock/rk3228-cru.h
@@ -29,6 +29,7 @@
#define SCLK_SDMMC 68
#define SCLK_SDIO 69
#define SCLK_EMMC 71
+#define SCLK_TSADC 72
#define SCLK_UART0 77
#define SCLK_UART1 78
#define SCLK_UART2 79
@@ -68,6 +69,7 @@
#define PCLK_UART0 341
#define PCLK_UART1 342
#define PCLK_UART2 343
+#define PCLK_TSADC 344
#define PCLK_PWM 350
#define PCLK_TIMER 353
#define PCLK_PERI 363
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 7/8] ARM: dts: rockchip: enable the tsadc for rk3228 evb
2016-02-03 4:12 [PATCH 0/8] Support and fixes the rk3228 SoCS for thermal Caesar Wang
2016-02-03 4:12 ` [PATCH 1/8] clk: rockchip: add id of the tsadc clock found on rk3228 SoCs Caesar Wang
@ 2016-02-03 4:12 ` Caesar Wang
[not found] ` <1454472767-5767-8-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-02-03 4:12 ` [PATCH 8/8] ARM: dts: rockchip: add the thermal main info found on rk3228 Caesar Wang
2 siblings, 1 reply; 6+ messages in thread
From: Caesar Wang @ 2016-02-03 4:12 UTC (permalink / raw)
To: Heiko Stuebner, edubezval
Cc: huangtao, linux-rockchip, zhangqing, Dmitry Torokhov, Caesar Wang,
Russell King, devicetree, Kumar Gala, linux-kernel, Ian Campbell,
Rob Herring, Pawel Moll, Mark Rutland, linux-arm-kernel
This patch enables the tsadc for rk3228 evb board.
The rk3228 evb board uses the CRU to reset the chip since it hasn't the
PMIC to connect it, and TSHUT is low active on evb board.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---
arch/arm/boot/dts/rk3228-evb.dts | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/rk3228-evb.dts b/arch/arm/boot/dts/rk3228-evb.dts
index e3898b8..c75cc41 100644
--- a/arch/arm/boot/dts/rk3228-evb.dts
+++ b/arch/arm/boot/dts/rk3228-evb.dts
@@ -61,6 +61,13 @@
status = "okay";
};
+&tsadc {
+ status = "okay";
+
+ rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
+ rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
+};
+
&uart2 {
status = "okay";
};
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 8/8] ARM: dts: rockchip: add the thermal main info found on rk3228
2016-02-03 4:12 [PATCH 0/8] Support and fixes the rk3228 SoCS for thermal Caesar Wang
2016-02-03 4:12 ` [PATCH 1/8] clk: rockchip: add id of the tsadc clock found on rk3228 SoCs Caesar Wang
2016-02-03 4:12 ` [PATCH 7/8] ARM: dts: rockchip: enable the tsadc for rk3228 evb Caesar Wang
@ 2016-02-03 4:12 ` Caesar Wang
2 siblings, 0 replies; 6+ messages in thread
From: Caesar Wang @ 2016-02-03 4:12 UTC (permalink / raw)
To: Heiko Stuebner, edubezval
Cc: huangtao, linux-rockchip, zhangqing, Dmitry Torokhov, Caesar Wang,
Russell King, devicetree, Kumar Gala, linux-kernel, Ian Campbell,
Rob Herring, Pawel Moll, Mark Rutland, linux-arm-kernel
This patch adds the thermal needed main information for rk3228 SoCS.
Basically has the following content:
1) TSADC controller:
Add the needed attributes for rk3036 TSADC controller.
Especially for the TSHUT, in some cases if we are unable to shut it down
in orderly fashion (says: kernel is stuck holding a lock or similar), then
hardware TSHUT will reset it.
If the temperature is over 95C over a period of time the thermal shutdown
of the tsadc is invoked with can either reset the entire chip via the CRU,
or notify the PMIC via a GPIO. This should be set in the specific board.
2) Thermal zones:
Add the needed device mode for thermal generic framework.
Detail in Documentation/devicetree/bindings/thermal/thermal.txt.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---
arch/arm/boot/dts/rk3228.dtsi | 69 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/arch/arm/boot/dts/rk3228.dtsi b/arch/arm/boot/dts/rk3228.dtsi
index 119ff12..afce7fd 100644
--- a/arch/arm/boot/dts/rk3228.dtsi
+++ b/arch/arm/boot/dts/rk3228.dtsi
@@ -43,6 +43,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/clock/rk3228-cru.h>
+#include <dt-bindings/thermal/thermal.h>
#include "skeleton.dtsi"
/ {
@@ -69,6 +70,7 @@
/* KHz uV */
816000 1000000
>;
+ #cooling-cells = <2>; /* min followed by max */
clock-latency = <40000>;
clocks = <&cru ARMCLK>;
};
@@ -247,6 +249,63 @@
assigned-clock-rates = <594000000>;
};
+ thermal-zones {
+ cpu_thermal: cpu-thermal {
+ polling-delay-passive = <100>; /* milliseconds */
+ polling-delay = <5000>; /* milliseconds */
+
+ thermal-sensors = <&tsadc 0>;
+
+ trips {
+ cpu_alert0: cpu_alert0 {
+ temperature = <70000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "passive";
+ };
+ cpu_alert1: cpu_alert1 {
+ temperature = <75000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "passive";
+ };
+ cpu_crit: cpu_crit {
+ temperature = <90000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "critical";
+ };
+ };
+
+ cooling-maps {
+ map0 {
+ trip = <&cpu_alert0>;
+ cooling-device =
+ <&cpu0 THERMAL_NO_LIMIT 6>;
+ };
+ map1 {
+ trip = <&cpu_alert1>;
+ cooling-device =
+ <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
+ };
+ };
+
+ tsadc: tsadc@11150000 {
+ compatible = "rockchip,rk3228-tsadc";
+ reg = <0x11150000 0x100>;
+ interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
+ clock-names = "tsadc", "apb_pclk";
+ resets = <&cru SRST_TSADC>;
+ reset-names = "tsadc-apb";
+ pinctrl-names = "init", "default", "sleep";
+ pinctrl-0 = <&otp_gpio>;
+ pinctrl-1 = <&otp_out>;
+ pinctrl-2 = <&otp_gpio>;
+ #thermal-sensor-cells = <0>;
+ rockchip,hw-tshut-temp = <95000>;
+ status = "disabled";
+ };
+
emmc: dwmmc@30020000 {
compatible = "rockchip,rk3288-dw-mshc";
reg = <0x30020000 0x4000>;
@@ -394,6 +453,16 @@
};
};
+ tsadc {
+ otp_gpio: otp-gpio {
+ rockchip,pins = <0 24 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ otp_out: otp-out {
+ rockchip,pins = <0 24 RK_FUNC_1 &pcfg_pull_none>;
+ };
+ };
+
uart0 {
uart0_xfer: uart0-xfer {
rockchip,pins = <2 26 RK_FUNC_1 &pcfg_pull_none>,
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 7/8] ARM: dts: rockchip: enable the tsadc for rk3228 evb
[not found] ` <1454472767-5767-8-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2016-02-04 1:34 ` kbuild test robot
2016-02-04 1:47 ` Caesar Wang
0 siblings, 1 reply; 6+ messages in thread
From: kbuild test robot @ 2016-02-04 1:34 UTC (permalink / raw)
Cc: kbuild-all-JC7UmRfGjtg, Heiko Stuebner,
edubezval-Re5JQEeQqe8AvxtiuMwx3w, huangtao-TNX95d0MmH7DzftRWevZcw,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
zhangqing-TNX95d0MmH7DzftRWevZcw, Dmitry Torokhov, Caesar Wang,
Russell King, devicetree-u79uwXL29TY76Z2rM5mHXA, Kumar Gala,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Ian Campbell, Rob Herring,
Pawel Moll, Mark Rutland,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]
Hi Caesar,
[auto build test ERROR on rockchip/for-next]
[also build test ERROR on v4.5-rc2 next-20160203]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Caesar-Wang/Support-and-fixes-the-rk3228-SoCS-for-thermal/20160203-121829
base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
config: arm-multi_v7_defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
Note: the linux-review/Caesar-Wang/Support-and-fixes-the-rk3228-SoCS-for-thermal/20160203-121829 HEAD 661e15b9e9c05d7a350ca8928be2b89e5c36b4d6 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
>> Error: arch/arm/boot/dts/rk3228-evb.dts:64.1-7 Label or path tsadc not found
FATAL ERROR: Syntax error parsing input tree
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 36561 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 7/8] ARM: dts: rockchip: enable the tsadc for rk3228 evb
2016-02-04 1:34 ` kbuild test robot
@ 2016-02-04 1:47 ` Caesar Wang
0 siblings, 0 replies; 6+ messages in thread
From: Caesar Wang @ 2016-02-04 1:47 UTC (permalink / raw)
To: kbuild test robot
Cc: Caesar Wang, huangtao, devicetree, Dmitry Torokhov, Russell King,
Heiko Stuebner, Pawel Moll, Ian Campbell, zhangqing, linux-kernel,
edubezval, linux-rockchip, Rob Herring, kbuild-all, Kumar Gala,
Mark Rutland, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]
Hi Mr,robot
Thanks for the auto tests.
在 2016年02月04日 09:34, kbuild test robot 写道:
> Hi Caesar,
>
> [auto build test ERROR on rockchip/for-next]
> [also build test ERROR on v4.5-rc2 next-20160203]
> [if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
>
> url: https://github.com/0day-ci/linux/commits/Caesar-Wang/Support-and-fixes-the-rk3228-SoCS-for-thermal/20160203-121829
> base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
> config: arm-multi_v7_defconfig (attached as .config)
> reproduce:
> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=arm
>
> Note: the linux-review/Caesar-Wang/Support-and-fixes-the-rk3228-SoCS-for-thermal/20160203-121829 HEAD 661e15b9e9c05d7a350ca8928be2b89e5c36b4d6 builds fine.
> It only hurts bisectibility.
>
> All errors (new ones prefixed by >>):
>
>>> Error: arch/arm/boot/dts/rk3228-evb.dts:64.1-7 Label or path tsadc not found
Since this patch is depend om PATCH[8/8].
(https://patchwork.kernel.org/patch/8197741/)
> FATAL ERROR: Syntax error parsing input tree
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
> [attachment]
>
> .config.gz
> download: http://u.163.com/t0/lFRyviaZlgm
>
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
--
Thanks,
Caesar
[-- Attachment #2: Type: text/html, Size: 3541 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-04 1:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-03 4:12 [PATCH 0/8] Support and fixes the rk3228 SoCS for thermal Caesar Wang
2016-02-03 4:12 ` [PATCH 1/8] clk: rockchip: add id of the tsadc clock found on rk3228 SoCs Caesar Wang
2016-02-03 4:12 ` [PATCH 7/8] ARM: dts: rockchip: enable the tsadc for rk3228 evb Caesar Wang
[not found] ` <1454472767-5767-8-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-02-04 1:34 ` kbuild test robot
2016-02-04 1:47 ` Caesar Wang
2016-02-03 4:12 ` [PATCH 8/8] ARM: dts: rockchip: add the thermal main info found on rk3228 Caesar Wang
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).