Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 0/7] Add Renesas RZ/G3L TSU support
@ 2026-09-25  6:15 Biju Das
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Biju Das @ 2026-09-25  6:15 UTC (permalink / raw)
  To: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad

The Thermal sensor unit (a.k.a TSU) IP found on the RZ/G3L SoC is similar
to the RZ/G3S, but it has different calibration constants. Moreover, the
TSU is connected to A/D converter of TSU (a.k.a ADC1) on the RZ/G3L,
whereas it is connected to ADC0 on the RZ/G3S.

Compared to ADC0, there are no A/D conversion result registers(ADCR0 to
ADCR7) on the RZ/G3L, and the INTEN bits in the A/D converter interrupt
control register(a.k.a ADINT)  are also different.

This patch series aims to add support for TSU along with ADC1.

Merge strategy:
  * patch #1-#3 thermal subsystem
  * patch #4-#6 iio subsystem
  * patch #7 SoC subsystem

v3->v4:
 * Dropped clk patch as it is accepted.
 * Collected tag.
 * Updated commit description for patch#5.
 * Updated kernel doc comment for max_channels.
v2->v3:
 * Collected tags
 * Dropped required property '#io-channel-cells' from bindings.
 * Renamed num_channels to max_channels in struct rzg2l_adc_hw_params
v1->v2:
 * Merged TSU and ADC1 series together.
 * Moved the clk patch.

Biju Das (7):
  dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
  thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC
    match data
  thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support
  dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU
  iio: adc: rzg2l_adc: Rename num_channels to max_channels
  iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU
  arm64: dts: renesas: r9a08g046: Enable TSU

 .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 17 ++++-
 .../thermal/renesas,r9a08g045-tsu.yaml        |  4 +-
 arch/arm64/boot/dts/renesas/r9a08g046.dtsi    | 66 +++++++++++++++++++
 drivers/iio/adc/rzg2l_adc.c                   | 29 +++++---
 drivers/thermal/renesas/rzg3s_thermal.c       | 38 ++++++++---
 5 files changed, 133 insertions(+), 21 deletions(-)

-- 
2.43.0


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

* [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
@ 2026-09-25  6:15 ` Biju Das
  2026-09-25  8:37   ` Claudiu Beznea
  2026-09-25  6:16 ` [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU Biju Das
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Biju Das @ 2026-09-25  6:15 UTC (permalink / raw)
  To: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad, Jonathan Cameron

Add the renesas,r9a08g046-tsu compatible string for the RZ/G3L Thermal
Sensor Unit (a.k.a TSU), which is similar to the RZ/G3S TSU but uses
different calibration constants. TSU is connected to a dedicated ADC IP
(a.k.a ADC1) on RZ/G3L.

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No change.
v2->v3:
 * Collected tags
v1->v2:
 * Updated commit description.
---
 .../devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml b/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml
index 573e2b9d3752..20fc1a8000e3 100644
--- a/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml
+++ b/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml
@@ -17,7 +17,9 @@ $ref: thermal-sensor.yaml#
 
 properties:
   compatible:
-    const: renesas,r9a08g045-tsu
+    enum:
+      - renesas,r9a08g045-tsu
+      - renesas,r9a08g046-tsu
 
   reg:
     maxItems: 1
-- 
2.43.0


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

* [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  6:16 ` [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels Biju Das
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Lad Prabhakar, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rafael J. Wysocki, Daniel Lezcano,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, David Lechner, Nuno Sá, Andy Shevchenko,
	Claudiu Beznea, linux-pm, linux-iio, linux-renesas-soc,
	devicetree, Chris Paterson, Biju Das

Add the renesas,r9a08g046-adc1 compatible string for the ADC1
instance on RZ/G3L, which is dedicated to the on-chip TSU (thermal
sensor unit). Unlike the other ADC instances, this one only exposes
a single channel (channel@8), so restrict the allowed channel nodes
accordingly.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * Kept Rb tag from Rob[1]
[1] https://lore.kernel.org/all/TY3PR01MB11346568D44110BCA1CDD146D86802@TY3PR01MB11346.jpnprd01.prod.outlook.com/
v2->v3:
 * Dropped required property '#io-channel-cells'.
v1->v2:
 * No Change.
---
 .../bindings/iio/adc/renesas,rzg2l-adc.yaml     | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
index 40341d541726..f08f5439d127 100644
--- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
@@ -25,7 +25,9 @@ properties:
               - renesas,r9a07g054-adc   # RZ/V2L
           - const: renesas,rzg2l-adc
       - items:
-          - const: renesas,r9a08g045-adc  # RZ/G3S
+          - enum:
+              - renesas,r9a08g045-adc   # RZ/G3S
+              - renesas,r9a08g046-adc1  # RZ/G3L ADC for TSU
 
   reg:
     maxItems: 1
@@ -121,6 +123,19 @@ allOf:
             reg:
               maximum: 7
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a08g046-adc1
+    then:
+      patternProperties:
+        "^channel@[0-7]$": false
+        "^channel@[8]$":
+          properties:
+            reg:
+              const: 8
+
 additionalProperties: false
 
 examples:
-- 
2.43.0


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

* [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
  2026-09-25  6:16 ` [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  6:16 ` [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU Biju Das
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Lad Prabhakar, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rafael J. Wysocki, Daniel Lezcano,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, David Lechner, Nuno Sá, Andy Shevchenko,
	Claudiu Beznea, linux-iio, linux-renesas-soc, linux-pm,
	devicetree, Chris Paterson, Biju Das

Rename the num_channels member of struct rzg2l_adc_hw_params to
max_channels, as it represents the maximum number of channels
supported by the ADC hardware rather than a count of channels
currently in use.

No functional change intended.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * Updated commit description.
 * Updated kernel doc comment for max_channels.
v3:
 * New patch.
---
 drivers/iio/adc/rzg2l_adc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
index 408fbf8c29cc..19b8f1a546a2 100644
--- a/drivers/iio/adc/rzg2l_adc.c
+++ b/drivers/iio/adc/rzg2l_adc.c
@@ -62,7 +62,7 @@
  * @adsmp_mask: ADC sampling period mask (see ADM3 register)
  * @adint_inten_mask: conversion end interrupt mask (see ADINT register)
  * @default_adcmp: default ADC cmp (see ADM3 register)
- * @num_channels: number of supported channels
+ * @max_channels: maximum number of channels
  * @adivc: specifies if ADVIC register is available
  */
 struct rzg2l_adc_hw_params {
@@ -70,7 +70,7 @@ struct rzg2l_adc_hw_params {
 	u16 adsmp_mask;
 	u16 adint_inten_mask;
 	u8 default_adcmp;
-	u8 num_channels;
+	u8 max_channels;
 	bool adivc;
 };
 
@@ -196,7 +196,7 @@ static int rzg2l_adc_conversion_setup(struct rzg2l_adc *adc, u8 ch)
 
 	/* Select analog input channel subjected to conversion. */
 	reg = rzg2l_adc_readl(adc, RZG2L_ADM(2));
-	reg &= ~GENMASK(hw_params->num_channels - 1, 0);
+	reg &= ~GENMASK(hw_params->max_channels - 1, 0);
 	reg |= BIT(ch);
 	rzg2l_adc_writel(adc, RZG2L_ADM(2), reg);
 
@@ -307,11 +307,11 @@ static irqreturn_t rzg2l_adc_isr(int irq, void *dev_id)
 		return IRQ_HANDLED;
 	}
 
-	intst = reg & GENMASK(hw_params->num_channels - 1, 0);
+	intst = reg & GENMASK(hw_params->max_channels - 1, 0);
 	if (!intst)
 		return IRQ_NONE;
 
-	for_each_set_bit(ch, &intst, hw_params->num_channels)
+	for_each_set_bit(ch, &intst, hw_params->max_channels)
 		adc->last_val[ch] = rzg2l_adc_readl(adc, RZG2L_ADCR(ch)) & RZG2L_ADCR_AD_MASK;
 
 	/* clear the channel interrupt */
@@ -341,12 +341,12 @@ static int rzg2l_adc_parse_properties(struct platform_device *pdev, struct rzg2l
 
 	num_channels = devm_iio_adc_device_alloc_chaninfo_se(&pdev->dev,
 						&rzg2l_adc_chan_template,
-						hw_params->num_channels - 1,
+						hw_params->max_channels - 1,
 						&chan_array);
 	if (num_channels < 0)
 		return num_channels;
 
-	if (num_channels > hw_params->num_channels)
+	if (num_channels > hw_params->max_channels)
 		return dev_err_probe(&pdev->dev, -EINVAL,
 				     "num of channel children out of range\n");
 
@@ -429,7 +429,7 @@ static int rzg2l_adc_probe(struct platform_device *pdev)
 	adc = iio_priv(indio_dev);
 
 	adc->hw_params = device_get_match_data(dev);
-	if (!adc->hw_params || adc->hw_params->num_channels > RZG2L_ADC_MAX_CHANNELS)
+	if (!adc->hw_params || adc->hw_params->max_channels > RZG2L_ADC_MAX_CHANNELS)
 		return -EINVAL;
 
 	ret = rzg2l_adc_parse_properties(pdev, adc);
@@ -484,7 +484,7 @@ static int rzg2l_adc_probe(struct platform_device *pdev)
 }
 
 static const struct rzg2l_adc_hw_params rzg2l_hw_params = {
-	.num_channels = 8,
+	.max_channels = 8,
 	.default_adcmp = 0xe,
 	.default_adsmp = { 0x578 },
 	.adsmp_mask = GENMASK(15, 0),
@@ -493,7 +493,7 @@ static const struct rzg2l_adc_hw_params rzg2l_hw_params = {
 };
 
 static const struct rzg2l_adc_hw_params rzg3s_hw_params = {
-	.num_channels = 9,
+	.max_channels = 9,
 	.default_adcmp = 0x1d,
 	.default_adsmp = { 0x7f, 0xff },
 	.adsmp_mask = GENMASK(7, 0),
-- 
2.43.0


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

* [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (2 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  6:16 ` [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU Biju Das
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Lad Prabhakar, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rafael J. Wysocki, Daniel Lezcano,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, David Lechner, Nuno Sá, Andy Shevchenko,
	Claudiu Beznea, linux-iio, linux-renesas-soc, linux-pm,
	devicetree, Chris Paterson, Biju Das

Add renesas,r9a08g046-adc1 compatible string and its hardware
parameters for the ADC1 IP on RZ/G3L, which is dedicated to
the on-chip TSU (thermal sensor unit).

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No Change.
v2->v3:
 * No Change.
v1->v2:
 * No Change.
---
 drivers/iio/adc/rzg2l_adc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
index 19b8f1a546a2..3b95f47445a8 100644
--- a/drivers/iio/adc/rzg2l_adc.c
+++ b/drivers/iio/adc/rzg2l_adc.c
@@ -500,8 +500,17 @@ static const struct rzg2l_adc_hw_params rzg3s_hw_params = {
 	.adint_inten_mask = GENMASK(11, 0),
 };
 
+static const struct rzg2l_adc_hw_params rzg3l_adc1_hw_params = {
+	.max_channels = 9,
+	.default_adcmp = 0x1d,
+	.default_adsmp = { 0x7f, 0xff },
+	.adsmp_mask = GENMASK(7, 0),
+	.adint_inten_mask = BIT(8),
+};
+
 static const struct of_device_id rzg2l_adc_match[] = {
 	{ .compatible = "renesas,r9a08g045-adc", .data = &rzg3s_hw_params },
+	{ .compatible = "renesas,r9a08g046-adc1", .data = &rzg3l_adc1_hw_params },
 	{ .compatible = "renesas,rzg2l-adc", .data = &rzg2l_hw_params },
 	{ }
 };
-- 
2.43.0


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

* [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (3 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  6:28   ` sashiko-bot
  2026-09-27 18:22 ` [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Jonathan Cameron
  2026-09-27 21:02 ` Daniel Lezcano
  6 siblings, 1 reply; 10+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Rafael J. Wysocki,
	Daniel Lezcano, Jonathan Cameron, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, linux-renesas-soc, devicetree, linux-iio, linux-pm,
	Chris Paterson, Biju Das, Prabhakar Mahadev Lad

Add #cooling-cells to the CPU nodes, and describe the ADC1 (used
exclusively by the TSU) and TSU nodes along with a CPU thermal zone
using passive and critical trip points, with CPU frequency cooling
maps for thermal mitigation.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No Change.
v2->v3:
 * No Change.
v1->v2:
 * No Change.
---
 arch/arm64/boot/dts/renesas/r9a08g046.dtsi | 66 ++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
index f33d5d7468ff..35046c7dac54 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
@@ -179,6 +179,7 @@ cpu0: cpu@0 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC0>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -189,6 +190,7 @@ cpu1: cpu@100 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC1>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -199,6 +201,7 @@ cpu2: cpu@200 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC2>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -209,6 +212,7 @@ cpu3: cpu@300 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC3>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -374,6 +378,37 @@ scif5: serial@1004e000 {
 			status = "disabled";
 		};
 
+		adc1: adc@108c0000 {
+			compatible = "renesas,r9a08g046-adc1";
+			reg = <0 0x108c0000 0 0x10000>;
+			interrupts = <GIC_SPI 378 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&cpg CPG_MOD R9A08G046_ADC1_ADCLK>,
+				 <&cpg CPG_MOD R9A08G046_ADC1_PCLK>;
+			clock-names = "adclk", "pclk";
+			resets = <&cpg R9A08G046_ADC1_PRESETN>,
+				 <&cpg R9A08G046_ADC1_ADRST_N>;
+			reset-names = "presetn", "adrst-n";
+			power-domains = <&cpg>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#io-channel-cells = <1>;
+
+			channel@8 {
+				reg = <8>;
+			};
+		};
+
+		tsu: thermal@108d0000 {
+			compatible = "renesas,r9a08g046-tsu";
+			reg = <0 0x108d0000 0 0x10000>;
+			clocks = <&cpg CPG_MOD R9A08G046_TSU_PCLK>;
+			resets = <&cpg R9A08G046_TSU_PRESETN>;
+			power-domains = <&cpg>;
+			#thermal-sensor-cells = <0>;
+			io-channels = <&adc1 0>;
+			io-channel-names = "tsu";
+		};
+
 		i2c0: i2c@100ae000 {
 			compatible = "renesas,riic-r9a08g046", "renesas,riic-r9a09g057";
 			reg = <0 0x100ae000 0 0x400>;
@@ -1382,6 +1417,37 @@ stmmac_axi_setup: stmmac-axi-config {
 		snps,blen = <16 8 4 0 0 0 0>;
 	};
 
+	thermal-zones {
+		cpu-thermal {
+			polling-delay = <1000>;
+			polling-delay-passive = <250>;
+			thermal-sensors = <&tsu>;
+
+			cooling-maps {
+				map0 {
+					trip = <&target>;
+					cooling-device = <&cpu0 0 3>, <&cpu1 0 3>,
+							 <&cpu2 0 3>, <&cpu3 0 3>;
+					contribution = <1024>;
+				};
+			};
+
+			trips {
+				sensor_crit: sensor-crit {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+
+				target: trip-point {
+					temperature = <95000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
-- 
2.43.0


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

* Re: [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU
  2026-09-25  6:16 ` [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU Biju Das
@ 2026-09-25  6:28   ` sashiko-bot
  0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-09-25  6:28 UTC (permalink / raw)
  To: Biju Das; +Cc: devicetree, conor+dt, robh, wsa+renesas

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dts: r9a08g046: io-channels uses logical array index instead of hw channel id
--

commit d469fb6214e936db705b38d76e1e6de3a390e861
Author: Biju Das <biju.das.jz@bp.renesas.com>

arm64: dts: renesas: r9a08g046: Enable TSU

This commit adds cooling cells to the CPU nodes and describes the ADC1 and
TSU nodes. It sets up a CPU thermal zone using passive and critical trip
points for thermal mitigation.

> diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
> index c63a857f0e5b0..a2f6718c0043a 100644
> --- a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
[ ... ]
> @@ -270,6 +274,37 @@ scif5: serial@1004e000 {
>  			status = "disabled";
>  		};
>  
> +		adc1: adc@108c0000 {
> +			compatible = "renesas,r9a08g046-adc1";
> +			reg = <0 0x108c0000 0 0x10000>;
> +			interrupts = <GIC_SPI 378 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&cpg CPG_MOD R9A08G046_ADC1_ADCLK>,
> +				 <&cpg CPG_MOD R9A08G046_ADC1_PCLK>;
> +			clock-names = "adclk", "pclk";
> +			resets = <&cpg R9A08G046_ADC1_PRESETN>,
> +				 <&cpg R9A08G046_ADC1_ADRST_N>;
> +			reset-names = "presetn", "adrst-n";
> +			power-domains = <&cpg>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			#io-channel-cells = <1>;
> +
> +			channel@8 {
> +				reg = <8>;
> +			};
> +		};
> +
> +		tsu: thermal@108d0000 {
> +			compatible = "renesas,r9a08g046-tsu";
> +			reg = <0 0x108d0000 0 0x10000>;
> +			clocks = <&cpg CPG_MOD R9A08G046_TSU_PCLK>;
> +			resets = <&cpg R9A08G046_TSU_PRESETN>;
> +			power-domains = <&cpg>;
> +			#thermal-sensor-cells = <0>;
> +			io-channels = <&adc1 0>;

[Severity: Medium]
Does this io-channels assignment in the tsu node incorrectly use a logical
array index instead of the hardware channel ID?

The renesas,r9a08g046-adc1 ADC provides a temperature channel at hardware
index 8 (channel@8), but this configuration uses index 0. Because the
rzg2l_adc driver lacks a custom .fwnode_xlate callback, the IIO core falls
back to __fwnode_iio_simple_xlate(). This fallback bounds-checks the
requested channel against the allocated array length (which is 1 here),
meaning the correct hardware ID <&adc1 8> would fail with -EINVAL.

Using <&adc1 0> works around this driver limitation by matching the 0th
element, but it leaks the Linux kernel internal array layout into the
hardware description. If another channel is ever added to the device tree
in arch/arm64/boot/dts/renesas/r9a08g046.dtsi, the array indices will shift
and <&adc1 0> could silently bind the TSU to the wrong ADC channel.

> +			io-channel-names = "tsu";
> +		};
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925061617.127349-1-biju.das.jz@bp.renesas.com?part=7

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

* Re: [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
@ 2026-09-25  8:37   ` Claudiu Beznea
  0 siblings, 0 replies; 10+ messages in thread
From: Claudiu Beznea @ 2026-09-25  8:37 UTC (permalink / raw)
  To: Biju Das, Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad, Jonathan Cameron



On 9/25/26 09:15, Biju Das wrote:
> Add the renesas,r9a08g046-tsu compatible string for the RZ/G3L Thermal
> Sensor Unit (a.k.a TSU), which is similar to the RZ/G3S TSU but uses
> different calibration constants. TSU is connected to a dedicated ADC IP
> (a.k.a ADC1) on RZ/G3L.
> 
> Acked-by: Rob Herring (Arm) <robh@kernel.org>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

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

* Re: [PATCH v4 0/7] Add Renesas RZ/G3L TSU support
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (4 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU Biju Das
@ 2026-09-27 18:22 ` Jonathan Cameron
  2026-09-27 21:02 ` Daniel Lezcano
  6 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2026-09-27 18:22 UTC (permalink / raw)
  To: Biju Das
  Cc: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, Zhang Rui, Lukasz Luba, linux-pm, devicetree,
	linux-iio, linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad

On Fri, 25 Sep 2026 07:15:58 +0100
Biju Das <biju.das.jz@bp.renesas.com> wrote:

> The Thermal sensor unit (a.k.a TSU) IP found on the RZ/G3L SoC is similar
> to the RZ/G3S, but it has different calibration constants. Moreover, the
> TSU is connected to A/D converter of TSU (a.k.a ADC1) on the RZ/G3L,
> whereas it is connected to ADC0 on the RZ/G3S.
> 
> Compared to ADC0, there are no A/D conversion result registers(ADCR0 to
> ADCR7) on the RZ/G3L, and the INTEN bits in the A/D converter interrupt
> control register(a.k.a ADINT)  are also different.
> 
> This patch series aims to add support for TSU along with ADC1.
> 
> Merge strategy:
>   * patch #1-#3 thermal subsystem
>   * patch #4-#6 iio subsystem
Applied these to the testing branch of iio.git.  That will show
up in linux-next once 0-day has taken a first look at it.

Thanks,

Jonathan

>   * patch #7 SoC subsystem
> 
> v3->v4:
>  * Dropped clk patch as it is accepted.
>  * Collected tag.
>  * Updated commit description for patch#5.
>  * Updated kernel doc comment for max_channels.
> v2->v3:
>  * Collected tags
>  * Dropped required property '#io-channel-cells' from bindings.
>  * Renamed num_channels to max_channels in struct rzg2l_adc_hw_params
> v1->v2:
>  * Merged TSU and ADC1 series together.
>  * Moved the clk patch.
> 
> Biju Das (7):
>   dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
>   thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC
>     match data
>   thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support
>   dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU
>   iio: adc: rzg2l_adc: Rename num_channels to max_channels
>   iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU
>   arm64: dts: renesas: r9a08g046: Enable TSU
> 
>  .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 17 ++++-
>  .../thermal/renesas,r9a08g045-tsu.yaml        |  4 +-
>  arch/arm64/boot/dts/renesas/r9a08g046.dtsi    | 66 +++++++++++++++++++
>  drivers/iio/adc/rzg2l_adc.c                   | 29 +++++---
>  drivers/thermal/renesas/rzg3s_thermal.c       | 38 ++++++++---
>  5 files changed, 133 insertions(+), 21 deletions(-)
> 


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

* Re: [PATCH v4 0/7] Add Renesas RZ/G3L TSU support
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (5 preceding siblings ...)
  2026-09-27 18:22 ` [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Jonathan Cameron
@ 2026-09-27 21:02 ` Daniel Lezcano
  6 siblings, 0 replies; 10+ messages in thread
From: Daniel Lezcano @ 2026-09-27 21:02 UTC (permalink / raw)
  To: Biju Das, Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad

On 9/25/26 08:15, Biju Das wrote:
> The Thermal sensor unit (a.k.a TSU) IP found on the RZ/G3L SoC is similar
> to the RZ/G3S, but it has different calibration constants. Moreover, the
> TSU is connected to A/D converter of TSU (a.k.a ADC1) on the RZ/G3L,
> whereas it is connected to ADC0 on the RZ/G3S.
> 
> Compared to ADC0, there are no A/D conversion result registers(ADCR0 to
> ADCR7) on the RZ/G3L, and the INTEN bits in the A/D converter interrupt
> control register(a.k.a ADINT)  are also different.
> 
> This patch series aims to add support for TSU along with ADC1.
> 
> Merge strategy:
>    * patch #1-#3 thermal subsystem

Applied, thanks


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

end of thread, other threads:[~2026-09-27 21:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
2026-09-25  8:37   ` Claudiu Beznea
2026-09-25  6:16 ` [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU Biju Das
2026-09-25  6:16 ` [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels Biju Das
2026-09-25  6:16 ` [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU Biju Das
2026-09-25  6:16 ` [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU Biju Das
2026-09-25  6:28   ` sashiko-bot
2026-09-27 18:22 ` [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Jonathan Cameron
2026-09-27 21:02 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox