This patchset reflect the DT changes for thermal framework change on omap4 board, more specific, on panda ES board. It is used for thermal framework testing to approve new thermal framework backport is working.
The patchset is on git://git.linaro.org/kernel/linux-linaro-stable.git thermal-framework-test
Haojian give me lots help to find out missed patches. Thanks a lot!
Any comments are appreciated!
Thanks Alex
[PATCH 1/7] arm: dts: add omap4 CPU thermal data [PATCH 2/7] arm: dts: add omap4460 thermal data [PATCH 3/7] ARM: omap dts syntax error fix [PATCH 4/7] arm: dts: make OMAP4460 bandgap node to belong to OCP [PATCH 5/7] ARM: 7758/1: introduce config HAS_BANDGAP [PATCH 6/7] arm: dts: add cooling properties on omap4460 cpu node [PATCH 7/7] thermal: ti-soc-thermal: use standard GPIO DT bindings
From: Eduardo Valentin eduardo.valentin@ti.com
This patch changes a dtsi file to contain the thermal data for MPU domain on OMAP4 and later SoCs. This data will enable the passive cooling with CPUfreq cooling device at 100C and the system will do a thermal shutdown at 125C.
This thermal data can be reused across TI SoC devices.
Cc: "Benoît Cousson" bcousson@baylibre.com Cc: Tony Lindgren tony@atomide.com Cc: Rob Herring rob.herring@calxeda.com Cc: Pawel Moll pawel.moll@arm.com Cc: Mark Rutland mark.rutland@arm.com Cc: Stephen Warren swarren@wwwdotorg.org Cc: Ian Campbell ian.campbell@citrix.com Cc: Russell King linux@arm.linux.org.uk Cc: linux-omap@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com (cherry picked from commit 0bbf6c54d100836db40ba020b7c9793ea3e6be0b)
Signed-off-by: Alex Shi alex.shi@linaro.org --- arch/arm/boot/dts/omap4-cpu-thermal.dtsi | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 arch/arm/boot/dts/omap4-cpu-thermal.dtsi
diff --git a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi new file mode 100644 index 0000000..cb9458f --- /dev/null +++ b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi @@ -0,0 +1,41 @@ +/* + * Device Tree Source for OMAP4/5 SoC CPU thermal + * + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * Contact: Eduardo Valentin eduardo.valentin@ti.com + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#include <dt-bindings/thermal/thermal.h> + +cpu_thermal: cpu_thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + + /* sensor ID */ + thermal-sensors = <&bandgap 0>; + + trips { + cpu_alert0: cpu_alert { + temperature = <100000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "passive"; + }; + cpu_crit: cpu_crit { + temperature = <125000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu_alert0>; + cooling-device = + <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +};
From: Eduardo Valentin eduardo.valentin@ti.com
This patch changes the dtsi entry on omap4460 to contain the thermal data. This data will enable the passive cooling with CPUfreq cooling device at 100C and the system will do a thermal shutdown at 125C.
Cc: "Benoît Cousson" bcousson@baylibre.com Cc: Tony Lindgren tony@atomide.com Cc: Rob Herring rob.herring@calxeda.com Cc: Pawel Moll pawel.moll@arm.com Cc: Mark Rutland mark.rutland@arm.com Cc: Stephen Warren swarren@wwwdotorg.org Cc: Ian Campbell ian.campbell@citrix.com Cc: Russell King linux@arm.linux.org.uk Cc: linux-omap@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com (cherry picked from commit 8af51b0ff4089f1bc734259deb57d39520d38f92)
Signed-off-by: Alex Shi alex.shi@linaro.org
Conflicts: arch/arm/boot/dts/omap4460.dtsi --- arch/arm/boot/dts/omap4460.dtsi | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi index 2cf227c..d1afe1b 100644 --- a/arch/arm/boot/dts/omap4460.dtsi +++ b/arch/arm/boot/dts/omap4460.dtsi @@ -12,7 +12,7 @@ / { cpus { /* OMAP446x 'standard device' variants OPP50 to OPPTurbo */ - cpu@0 { + cpu0: cpu@0 { operating-points = < /* kHz uV */ 350000 1025000 @@ -29,4 +29,19 @@ <0 55 0x4>; ti,hwmods = "debugss"; }; + + thermal-zones { + #include "omap4-cpu-thermal.dtsi" + }; + + bandgap: bandgap { + reg = <0x4a002260 0x4 + 0x4a00232C 0x4 + 0x4a002378 0x18>; + compatible = "ti,omap4460-bandgap"; + interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; /* talert */ + gpios = <&gpio3 22 0>; /* tshut */ + + #thermal-sensor-cells = <0>; + }; };
From: Haojian Zhuang haojian.zhuang@linaro.org
Fix DT syntax error and missing head file.
DTC arch/arm/boot/dts/omap4-panda-es.dtb Error: arch/arm/boot/dts/omap4460.dtsi:34.17-41 syntax error FATAL ERROR: Unable to parse input tree
Signed-off-by: Haojian Zhuang haojian.zhuang@gmail.com Signed-off-by: Alex Shi alex.shi@linaro.org --- arch/arm/boot/dts/omap4-panda-es.dts | 4 ++-- arch/arm/boot/dts/omap4460.dtsi | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts index f1d8c21..c6f012e 100644 --- a/arch/arm/boot/dts/omap4-panda-es.dts +++ b/arch/arm/boot/dts/omap4-panda-es.dts @@ -7,8 +7,8 @@ */ /dts-v1/;
-/include/ "omap4460.dtsi" -/include/ "omap4-panda-common.dtsi" +#include "omap4460.dtsi" +#include "omap4-panda-common.dtsi"
/* Audio routing is differnet between PandaBoard4430 and PandaBoardES */ &sound { diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi index d1afe1b..f53c4e8 100644 --- a/arch/arm/boot/dts/omap4460.dtsi +++ b/arch/arm/boot/dts/omap4460.dtsi @@ -7,7 +7,8 @@ * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. */ -/include/ "omap4.dtsi" +#include "omap4.dtsi" +#include <dt-bindings/interrupt-controller/irq.h>
/ { cpus {
From: Eduardo Valentin eduardo.valentin@ti.com
Small fix on representation. Bandgap node belongs to OCP.
Cc: "Benoît Cousson" bcousson@baylibre.com Cc: Tony Lindgren tony@atomide.com Cc: Rob Herring rob.herring@calxeda.com Cc: Pawel Moll pawel.moll@arm.com Cc: Mark Rutland mark.rutland@arm.com Cc: Stephen Warren swarren@wwwdotorg.org Cc: Ian Campbell ijc+devicetree@hellion.org.uk Cc: Russell King linux@arm.linux.org.uk Cc: linux-omap@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Suggested-by: Nishanth Menon nm@ti.com Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com (cherry picked from commit 135df807c3d3ea152ac86ec6f27837a60f41ca6b)
Signed-off-by: Alex Shi alex.shi@linaro.org --- arch/arm/boot/dts/omap4460.dtsi | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi index f53c4e8..5aff0b0 100644 --- a/arch/arm/boot/dts/omap4460.dtsi +++ b/arch/arm/boot/dts/omap4460.dtsi @@ -35,14 +35,16 @@ #include "omap4-cpu-thermal.dtsi" };
- bandgap: bandgap { - reg = <0x4a002260 0x4 - 0x4a00232C 0x4 - 0x4a002378 0x18>; - compatible = "ti,omap4460-bandgap"; - interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; /* talert */ - gpios = <&gpio3 22 0>; /* tshut */ + ocp { + bandgap: bandgap { + reg = <0x4a002260 0x4 + 0x4a00232C 0x4 + 0x4a002378 0x18>; + compatible = "ti,omap4460-bandgap"; + interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; /* talert */ + gpios = <&gpio3 22 0>; /* tshut */
- #thermal-sensor-cells = <0>; + #thermal-sensor-cells = <0>; + }; }; };
From: Eduardo Valentin eduardo.valentin@ti.com
Bandgap is a device used to measure temperature on electronic equipments. It is widely used in digital integrated circuits. It is based on the dependency between silicon voltage and temperature.
This patch introduce HAS_BANDGAP config entry. This config is a boolean value so that arch code can flag if they feature a bandgap device.
This config entry follows the same idea behind ARCH_HAS_CPUFREQ.
Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Fabio Stevam festevam@gmail.com Acked-by: Tony Lindgren tony@atomide.com Acked-by: Amit Daniel Kachhap amit.daniel@samsung.com Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com Signed-off-by: Russell King rmk+kernel@arm.linux.org.uk (cherry picked from commit 4a1b573346ee0d64d95beb78d49a5bbb574e6c6a)
Signed-off-by: Alex Shi alex.shi@linaro.org --- arch/arm/Kconfig | 3 +++ arch/arm/mach-omap2/Kconfig | 1 + 2 files changed, 4 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1116be5..12570d0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -174,6 +174,9 @@ config ARCH_HAS_CPUFREQ and that the relevant menu configurations are displayed for it.
+config ARCH_HAS_BANDGAP + bool + config GENERIC_HWEIGHT bool default y diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index f49cd51..8620ab5 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -4,6 +4,7 @@ config ARCH_OMAP config ARCH_OMAP2PLUS bool "TI OMAP2/3/4/5 SoCs with device tree support" if (ARCH_MULTI_V6 || ARCH_MULTI_V7) select ARCH_HAS_CPUFREQ + select ARCH_HAS_BANDGAP select ARCH_HAS_HOLES_MEMORYMODEL select ARCH_OMAP select ARCH_REQUIRE_GPIOLIB
From: Eduardo Valentin eduardo.valentin@ti.com
OMAP4460 devices can reach high temperatures and thus needs to have cpufreq-cooling on systems running on it.
This patch adds the required cooling device properties so that cpufreq-cpu0 driver loads the cooling device.
Cc: "Benoît Cousson" bcousson@baylibre.com Cc: Tony Lindgren tony@atomide.com Cc: Rob Herring rob.herring@calxeda.com Cc: Pawel Moll pawel.moll@arm.com Cc: Mark Rutland mark.rutland@arm.com Cc: Stephen Warren swarren@wwwdotorg.org Cc: Ian Campbell ian.campbell@citrix.com Cc: Russell King linux@arm.linux.org.uk Cc: linux-omap@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com (cherry picked from commit 616a66351d6cd4a9bdb20fe49ee2505d9cc8a0db)
Signed-off-by: Alex Shi alex.shi@linaro.org --- arch/arm/boot/dts/omap4460.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi index 5aff0b0..ced5383 100644 --- a/arch/arm/boot/dts/omap4460.dtsi +++ b/arch/arm/boot/dts/omap4460.dtsi @@ -21,6 +21,11 @@ 920000 1313000 >; clock-latency = <300000>; /* From legacy driver */ + + /* cooling options */ + cooling-min-level = <0>; + cooling-max-level = <2>; + #cooling-cells = <2>; /* min followed by max */ }; };
From: Eduardo Valentin eduardo.valentin@ti.com
This change updates the ti-soc-thermal driver to use standard GPIO DT bindings to read the GPIO number associated to thermal shutdown IRQ, in case the device features it.
Previously, the code was using a specific DT bindings. As now OMAP supports the standard way to model GPIOs, there is no point in having a ti specific binding.
Cc: Zhang Rui rui.zhang@intel.com Cc: Grant Likely grant.likely@linaro.org Cc: Rob Herring rob.herring@calxeda.com Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com (cherry picked from commit 57d1617137dd61825a3a7cebf61015f58afce510)
Signed-off-by: Alex Shi alex.shi@linaro.org --- drivers/staging/ti-soc-thermal/ti-bandgap.c | 8 ++------ drivers/staging/ti-soc-thermal/ti_soc_thermal.txt | 9 +++++---- 2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/ti-soc-thermal/ti-bandgap.c b/drivers/staging/ti-soc-thermal/ti-bandgap.c index f20c1cf..c7fc0d0 100644 --- a/drivers/staging/ti-soc-thermal/ti-bandgap.c +++ b/drivers/staging/ti-soc-thermal/ti-bandgap.c @@ -38,6 +38,7 @@ #include <linux/of_device.h> #include <linux/of_platform.h> #include <linux/of_irq.h> +#include <linux/of_gpio.h> #include <linux/io.h>
#include "ti-bandgap.h" @@ -1123,7 +1124,6 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) const struct of_device_id *of_id; struct ti_bandgap *bgp; struct resource *res; - u32 prop; int i;
/* just for the sake */ @@ -1167,11 +1167,7 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) } while (res);
if (TI_BANDGAP_HAS(bgp, TSHUT)) { - if (of_property_read_u32(node, "ti,tshut-gpio", &prop) < 0) { - dev_err(&pdev->dev, "missing tshut gpio in device tree\n"); - return ERR_PTR(-EINVAL); - } - bgp->tshut_gpio = prop; + bgp->tshut_gpio = of_get_gpio(node, 0); if (!gpio_is_valid(bgp->tshut_gpio)) { dev_err(&pdev->dev, "invalid gpio for tshut (%d)\n", bgp->tshut_gpio); diff --git a/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt b/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt index a4a33d1..382bd98 100644 --- a/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt +++ b/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt @@ -17,8 +17,9 @@ Required properties: - interrupts : this entry should indicate which interrupt line the talert signal is routed to; Specific: -- ti,tshut-gpio : this entry should be used to inform which GPIO -line the tshut signal is routed to; +- gpios : this entry should be used to inform which GPIO +line the tshut signal is routed to. The informed GPIO will +be treated as an IRQ; - regs : this entry must also be specified and it is specific to each bandgap version, because the mapping may change from soc to soc, apart of depending on available features. @@ -37,7 +38,7 @@ bandgap { 0x4a002378 0x18>; compatible = "ti,omap4460-bandgap"; interrupts = <0 126 4>; /* talert */ - ti,tshut-gpio = <86>; + gpios = <&gpio3 22 0>; /* tshut */ };
OMAP4470: @@ -47,7 +48,7 @@ bandgap { 0x4a002378 0x18>; compatible = "ti,omap4470-bandgap"; interrupts = <0 126 4>; /* talert */ - ti,tshut-gpio = <86>; + gpios = <&gpio3 22 0>; /* tshut */ };
OMAP5430:
linaro-kernel@lists.linaro.org