* [PATCH 1/3] dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support
2020-11-26 22:30 [PATCH 0/3] thermal: Add support for R-Car V3U (r8a779a0) Niklas Söderlund
@ 2020-11-26 22:30 ` Niklas Söderlund
2020-12-08 18:11 ` Rob Herring
2020-12-16 2:52 ` Yoshihiro Shimoda
2020-11-26 22:30 ` [PATCH 2/3] arm64: dts: renesas: r8a779a0: Add thermal support Niklas Söderlund
2020-11-26 22:30 ` [PATCH 3/3] thermal: rcar_gen3_thermal: Add r8a779a0 support Niklas Söderlund
2 siblings, 2 replies; 8+ messages in thread
From: Niklas Söderlund @ 2020-11-26 22:30 UTC (permalink / raw)
To: Geert Uytterhoeven, devicetree, linux-pm
Cc: linux-renesas-soc, Niklas Söderlund
Add support for R-Car V3U. The V3U IP differs a bit from its siblings in
such way that it have 4 TSC nodes and the interrupts are not routed to
the INTC-AP but to the ECM.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
.../bindings/thermal/rcar-gen3-thermal.yaml | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
index f386f2a7c06c95c7..b33a76eeac4e4fed 100644
--- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
+++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
@@ -26,13 +26,16 @@ properties:
- renesas,r8a77961-thermal # R-Car M3-W+
- renesas,r8a77965-thermal # R-Car M3-N
- renesas,r8a77980-thermal # R-Car V3H
+ - renesas,r8a779a0-thermal # R-Car V3U
+
reg:
minItems: 2
- maxItems: 3
+ maxItems: 4
items:
- description: TSC1 registers
- description: TSC2 registers
- description: TSC3 registers
+ - description: TSC4 registers
interrupts:
items:
@@ -55,12 +58,22 @@ properties:
required:
- compatible
- reg
- - interrupts
- clocks
- power-domains
- resets
- "#thermal-sensor-cells"
+if:
+ not:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,r8a779a0-thermal
+then:
+ required:
+ - interrupts
+
additionalProperties: false
examples:
--
2.29.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support
2020-11-26 22:30 ` [PATCH 1/3] dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support Niklas Söderlund
@ 2020-12-08 18:11 ` Rob Herring
2020-12-16 2:52 ` Yoshihiro Shimoda
1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring @ 2020-12-08 18:11 UTC (permalink / raw)
To: Niklas Söderlund
Cc: devicetree, linux-pm, linux-renesas-soc, Geert Uytterhoeven
On Thu, 26 Nov 2020 23:30:26 +0100, Niklas Söderlund wrote:
> Add support for R-Car V3U. The V3U IP differs a bit from its siblings in
> such way that it have 4 TSC nodes and the interrupts are not routed to
> the INTC-AP but to the ECM.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> .../bindings/thermal/rcar-gen3-thermal.yaml | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 1/3] dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support
2020-11-26 22:30 ` [PATCH 1/3] dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support Niklas Söderlund
2020-12-08 18:11 ` Rob Herring
@ 2020-12-16 2:52 ` Yoshihiro Shimoda
1 sibling, 0 replies; 8+ messages in thread
From: Yoshihiro Shimoda @ 2020-12-16 2:52 UTC (permalink / raw)
To: Niklas Söderlund, Geert Uytterhoeven,
devicetree@vger.kernel.org, linux-pm@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Hi Niklas-san,
Thank you for the patch!
> From: Niklas Söderlund, Sent: Friday, November 27, 2020 7:30 AM
>
> Add support for R-Car V3U. The V3U IP differs a bit from its siblings in
> such way that it have 4 TSC nodes and the interrupts are not routed to
According to the datasheet, V3U has 5 TSC nodes. And, naming order differs
between V3U and other SoCs.
- V3U: TSC0 to TSC4
- other SoCs: TSC1 to TSC2 or 3
So, perhaps, we need to modify "items" of "reg" somehow.
Best regards,
Yoshihiro Shimoda
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] arm64: dts: renesas: r8a779a0: Add thermal support
2020-11-26 22:30 [PATCH 0/3] thermal: Add support for R-Car V3U (r8a779a0) Niklas Söderlund
2020-11-26 22:30 ` [PATCH 1/3] dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support Niklas Söderlund
@ 2020-11-26 22:30 ` Niklas Söderlund
2021-01-05 10:27 ` Geert Uytterhoeven
2020-11-26 22:30 ` [PATCH 3/3] thermal: rcar_gen3_thermal: Add r8a779a0 support Niklas Söderlund
2 siblings, 1 reply; 8+ messages in thread
From: Niklas Söderlund @ 2020-11-26 22:30 UTC (permalink / raw)
To: Geert Uytterhoeven, devicetree, linux-pm
Cc: linux-renesas-soc, Niklas Söderlund
Add support for thermal.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 70 +++++++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
index 6cf77ce9aa9372ce..5bcce5fcfbf5f43d 100644
--- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
@@ -91,6 +91,18 @@ sysc: system-controller@e6180000 {
#power-domain-cells = <1>;
};
+ tsc: thermal@e6190000 {
+ compatible = "renesas,r8a779a0-thermal";
+ reg = <0 0xe6190000 0 0x100>,
+ <0 0xe6198000 0 0x100>,
+ <0 0xe61a0000 0 0x100>,
+ <0 0xe61a8000 0 0x100>;
+ clocks = <&cpg CPG_MOD 919>;
+ power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+ resets = <&cpg 919>;
+ #thermal-sensor-cells = <1>;
+ };
+
scif0: serial@e6e60000 {
compatible = "renesas,scif-r8a779a0",
"renesas,rcar-gen3-scif", "renesas,scif";
@@ -123,6 +135,64 @@ prr: chipid@fff00044 {
};
};
+ thermal-zones {
+ sensor_thermal1: sensor-thermal1 {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+ thermal-sensors = <&tsc 0>;
+
+ trips {
+ sensor1_crit: sensor1-crit {
+ temperature = <120000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ sensor_thermal2: sensor-thermal2 {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+ thermal-sensors = <&tsc 1>;
+
+ trips {
+ sensor2_crit: sensor2-crit {
+ temperature = <120000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ sensor_thermal3: sensor-thermal3 {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+ thermal-sensors = <&tsc 2>;
+
+ trips {
+ sensor3_crit: sensor3-crit {
+ temperature = <120000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ sensor_thermal4: sensor-thermal4 {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+ thermal-sensors = <&tsc 3>;
+
+ trips {
+ sensor4_crit: sensor4-crit {
+ temperature = <120000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
--
2.29.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] arm64: dts: renesas: r8a779a0: Add thermal support
2020-11-26 22:30 ` [PATCH 2/3] arm64: dts: renesas: r8a779a0: Add thermal support Niklas Söderlund
@ 2021-01-05 10:27 ` Geert Uytterhoeven
0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2021-01-05 10:27 UTC (permalink / raw)
To: Niklas Söderlund
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Linux PM list, Linux-Renesas
Hi Niklas,
On Thu, Nov 26, 2020 at 11:30 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Add support for thermal.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Thanks for your patch!
> --- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> @@ -91,6 +91,18 @@ sysc: system-controller@e6180000 {
> #power-domain-cells = <1>;
> };
>
> + tsc: thermal@e6190000 {
> + compatible = "renesas,r8a779a0-thermal";
> + reg = <0 0xe6190000 0 0x100>,
> + <0 0xe6198000 0 0x100>,
> + <0 0xe61a0000 0 0x100>,
> + <0 0xe61a8000 0 0x100>;
The fifth region at 0x161b0000 is missing.
> + clocks = <&cpg CPG_MOD 919>;
> + power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
> + resets = <&cpg 919>;
> + #thermal-sensor-cells = <1>;
> + };
> +
> scif0: serial@e6e60000 {
> compatible = "renesas,scif-r8a779a0",
> "renesas,rcar-gen3-scif", "renesas,scif";
> @@ -123,6 +135,64 @@ prr: chipid@fff00044 {
> };
> };
>
> + thermal-zones {
> + sensor_thermal1: sensor-thermal1 {
> + polling-delay-passive = <250>;
> + polling-delay = <1000>;
> + thermal-sensors = <&tsc 0>;
> +
> + trips {
> + sensor1_crit: sensor1-crit {
> + temperature = <120000>;
> + hysteresis = <1000>;
> + type = "critical";
> + };
> + };
> + };
> +
> + sensor_thermal2: sensor-thermal2 {
> + polling-delay-passive = <250>;
> + polling-delay = <1000>;
> + thermal-sensors = <&tsc 1>;
> +
> + trips {
> + sensor2_crit: sensor2-crit {
> + temperature = <120000>;
> + hysteresis = <1000>;
> + type = "critical";
> + };
> + };
> + };
> +
> + sensor_thermal3: sensor-thermal3 {
> + polling-delay-passive = <250>;
> + polling-delay = <1000>;
> + thermal-sensors = <&tsc 2>;
> +
> + trips {
> + sensor3_crit: sensor3-crit {
> + temperature = <120000>;
> + hysteresis = <1000>;
> + type = "critical";
> + };
> + };
> + };
> +
> + sensor_thermal4: sensor-thermal4 {
> + polling-delay-passive = <250>;
> + polling-delay = <1000>;
> + thermal-sensors = <&tsc 3>;
> +
> + trips {
> + sensor4_crit: sensor4-crit {
> + temperature = <120000>;
> + hysteresis = <1000>;
> + type = "critical";
> + };
> + };
> + };
Missing fifth entry.
> + };
> +
> timer {
> compatible = "arm,armv8-timer";
> interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] thermal: rcar_gen3_thermal: Add r8a779a0 support
2020-11-26 22:30 [PATCH 0/3] thermal: Add support for R-Car V3U (r8a779a0) Niklas Söderlund
2020-11-26 22:30 ` [PATCH 1/3] dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support Niklas Söderlund
2020-11-26 22:30 ` [PATCH 2/3] arm64: dts: renesas: r8a779a0: Add thermal support Niklas Söderlund
@ 2020-11-26 22:30 ` Niklas Söderlund
2021-01-05 10:29 ` Geert Uytterhoeven
2 siblings, 1 reply; 8+ messages in thread
From: Niklas Söderlund @ 2020-11-26 22:30 UTC (permalink / raw)
To: Geert Uytterhoeven, devicetree, linux-pm
Cc: linux-renesas-soc, Niklas Söderlund
Add support for R-Car V3U. The new THCODE values are taken from the
example in the datasheet.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
drivers/thermal/rcar_gen3_thermal.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index 94f2c133a47f66b6..75c69fe6e9553f25 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -60,13 +60,14 @@
#define MCELSIUS(temp) ((temp) * 1000)
#define GEN3_FUSE_MASK 0xFFF
-#define TSC_MAX_NUM 3
+#define TSC_MAX_NUM 4
/* default THCODE values if FUSEs are missing */
static const int thcodes[TSC_MAX_NUM][3] = {
{ 3397, 2800, 2221 },
{ 3393, 2795, 2216 },
{ 3389, 2805, 2237 },
+ { 3415, 2694, 2195 },
};
/* Structure for thermal temperature calculation */
@@ -276,6 +277,10 @@ static const struct of_device_id rcar_gen3_thermal_dt_ids[] = {
.compatible = "renesas,r8a77980-thermal",
.data = &rcar_gen3_ths_tj_1,
},
+ {
+ .compatible = "renesas,r8a779a0-thermal",
+ .data = &rcar_gen3_ths_tj_1,
+ },
{},
};
MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);
--
2.29.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] thermal: rcar_gen3_thermal: Add r8a779a0 support
2020-11-26 22:30 ` [PATCH 3/3] thermal: rcar_gen3_thermal: Add r8a779a0 support Niklas Söderlund
@ 2021-01-05 10:29 ` Geert Uytterhoeven
0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2021-01-05 10:29 UTC (permalink / raw)
To: Niklas Söderlund
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Linux PM list, Linux-Renesas
Hi Niklas,
On Thu, Nov 26, 2020 at 11:30 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Add support for R-Car V3U. The new THCODE values are taken from the
> example in the datasheet.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Thanks for your patch!
> --- a/drivers/thermal/rcar_gen3_thermal.c
> +++ b/drivers/thermal/rcar_gen3_thermal.c
> @@ -60,13 +60,14 @@
> #define MCELSIUS(temp) ((temp) * 1000)
> #define GEN3_FUSE_MASK 0xFFF
>
> -#define TSC_MAX_NUM 3
> +#define TSC_MAX_NUM 4
As pointed out by Shimoda-san in response to the DT binding update,
R-Car V3U has 5 sensors.
>
> /* default THCODE values if FUSEs are missing */
> static const int thcodes[TSC_MAX_NUM][3] = {
> { 3397, 2800, 2221 },
> { 3393, 2795, 2216 },
> { 3389, 2805, 2237 },
> + { 3415, 2694, 2195 },
No idea what the missing fifth entry should be...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread