From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8421E2F260A; Thu, 23 Oct 2025 08:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207614; cv=none; b=GH/6LsZ0pWpssgxW8+QHuISRzJR9YELaQSM67kYkj7ZLukwHNajxCf5TkDi3eNry6HK5rGBAtmWA/tUBodvDZBuGHhgKsAaB19pc+FVa8WTqbWinGCHZW0YvM0V757RWqyDTNlt6Y8rHnHe+GAXffJhIgb4YE4dE0a2XbTqosUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207614; c=relaxed/simple; bh=VhPtr6TDNe8OLVZ0qvExPnEgZsGRrfM30yFQB8ExEy0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z5Ak4merWL/BkV+R/xveQvy5DpK6ttycTPprNk2rvrGRRB/U7WgQe2qF9AnBRIiiW4l/ZmE4cDRF8gJfHPYq0FPf58Qf7M8y2b2wkJpiaWuPXVOsuQBf82S4UtLxjq+wQ7UC9pPz7bm2mVS+jo4Br7wvVM5fE7ziQCGnYLyUmzU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: a8gUGW8zTVmv6QGKSR7v3Q== X-CSE-MsgGUID: CHzIUoSHQ+yBT++oK9YlVA== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:07 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 86A99417CA94; Thu, 23 Oct 2025 17:20:01 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 01/10] clk: renesas: r9a09g077: add TSU module clock Date: Thu, 23 Oct 2025 11:19:15 +0300 Message-ID: <20251023081925.2412325-2-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have a TSU peripheral with controlled by a module clock. The TSU module clock is enabled in register MSTPCRG (0x30c), at bit 7, resulting in a (0x30c - 0x300) / 4 * 100 + 7 =3D 307 index. Add it to the list of module clocks. Signed-off-by: Cosmin Tanislav Reviewed-by: Geert Uytterhoeven --- drivers/clk/renesas/r9a09g077-cpg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/renesas/r9a09g077-cpg.c b/drivers/clk/renesas/r9a0= 9g077-cpg.c index 5dca5c44043e..79083165537c 100644 --- a/drivers/clk/renesas/r9a09g077-cpg.c +++ b/drivers/clk/renesas/r9a09g077-cpg.c @@ -195,6 +195,7 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] _= _initconst =3D { DEF_MOD("adc0", 206, R9A09G077_CLK_PCLKH), DEF_MOD("adc1", 207, R9A09G077_CLK_PCLKH), DEF_MOD("adc2", 225, R9A09G077_CLK_PCLKM), + DEF_MOD("tsu", 307, R9A09G077_CLK_PCLKL), DEF_MOD("gmac0", 400, R9A09G077_CLK_PCLKM), DEF_MOD("ethsw", 401, R9A09G077_CLK_PCLKM), DEF_MOD("ethss", 403, R9A09G077_CLK_PCLKM), --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CB592F39B8; Thu, 23 Oct 2025 08:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207617; cv=none; b=TvXM2dISgxZUwDVsQs0x5Gi6roTZFGa5sqxcWg6c2fModHDRYJXGDPdeTOWS/n/wLHMd91MiOVZBwuwTxVk+Q4VvC0/LUNFeDiS8w30CPOdeF7J8h5sxCixrQU1sRHtH6tmolsIxBoKYFT07s1uIUllDRgLTxLFEFx9Xh3p+jB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207617; c=relaxed/simple; bh=/4uYISddMlAaS5BVM7Osko00nif0l0gdvol5kQ/okjc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fb8qCY4ldllfvbphNeSC+GVxzjerc1+rAbnWiTHsgrK4Qz7O3o9zuDhkA41k7DcRNXISkyj6+jrX6tSP5fxFROMsmSlUoAIw0F7ZKdvyfdStXWAFKWZ6L5lVjLspQz2N8tZ+tpu7YoIksGNzngX0FSP2VsW8zAomgHVq+HStb4I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: iExKEwvGRcq6l1crlfqvpA== X-CSE-MsgGUID: SZcoBAwvQ6e2Pi8BL7loYQ== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:14 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 9AA5F417CDAD; Thu, 23 Oct 2025 17:20:08 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 02/10] thermal: renesas: rzg3e: make reset optional Date: Thu, 23 Oct 2025 11:19:16 +0300 Message-ID: <20251023081925.2412325-3-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs do not have a reset line. Prepare for them by making it optional. Signed-off-by: Cosmin Tanislav --- drivers/thermal/renesas/rzg3e_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/rene= sas/rzg3e_thermal.c index e66d73ca6752..86c10810e5bf 100644 --- a/drivers/thermal/renesas/rzg3e_thermal.c +++ b/drivers/thermal/renesas/rzg3e_thermal.c @@ -412,7 +412,7 @@ static int rzg3e_thermal_probe(struct platform_device *= pdev) "Clock rate %lu Hz too low (min %u Hz)\n", clk_get_rate(clk), TSU_MIN_CLOCK_RATE); =20 - priv->rstc =3D devm_reset_control_get_exclusive_deasserted(dev, NULL); + priv->rstc =3D devm_reset_control_get_optional_exclusive_deasserted(dev, = NULL); if (IS_ERR(priv->rstc)) return dev_err_probe(dev, PTR_ERR(priv->rstc), "Failed to get/deassert reset control\n"); --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 185372F3611; Thu, 23 Oct 2025 08:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207624; cv=none; b=UNZ2hzBB9b8r7u7L2u85SqJr3jdaOF9afNUksQfhzvH5OgoSYXYFuMt73SU/TzJI84ydfARn9QjGAklVlBccMkwefQuA49D0bmGX5VZTbCHw4+OWNAFXkSWCY0JsrAGUnf+j0mf0t+7BSR/CiUuwVFlCSzR0FmxmFr5IN+5YK7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207624; c=relaxed/simple; bh=8XGgl/QqxZ/G9e52VBDeQ8yMQzvWYFSq06TkfE6206k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CM+3c17xa85rIInLtnWjMdSCOuFclN4Lo5CaqWHbBMpkjP3ADDNA0ohSq+TIhh2htqR3crqf/IJL5Td8ihPldZGi3dZGwPbADhObu0KLdD6sjoQrSffocTslR5CO3heIDCg0twJUzOboSbueQ1Fd8EbppiiK45nmtiLH6wqJ6TI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: uGn7erzOQxKQW0zNFjR7BQ== X-CSE-MsgGUID: UDmdz+diSFW/cmRs/eKj0A== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:21 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6870C417CDAD; Thu, 23 Oct 2025 17:20:15 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 03/10] thermal: renesas: rzg3e: make min and max temperature per-chip Date: Thu, 23 Oct 2025 11:19:17 +0300 Message-ID: <20251023081925.2412325-4-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have different minimum and maximum temperatures compared to the already supported RZ/G3E. Prepare for them by moving these into a chip-specific struct. Signed-off-by: Cosmin Tanislav --- drivers/thermal/renesas/rzg3e_thermal.c | 35 ++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/rene= sas/rzg3e_thermal.c index 86c10810e5bf..3c9ff5e43d7e 100644 --- a/drivers/thermal/renesas/rzg3e_thermal.c +++ b/drivers/thermal/renesas/rzg3e_thermal.c @@ -62,8 +62,6 @@ #define TSU_SICR_CMPCLR BIT(1) =20 /* Temperature calculation constants from datasheet */ -#define TSU_TEMP_D (-41) -#define TSU_TEMP_E 126 #define TSU_CODE_MAX 0xFFF =20 /* Timing specifications from datasheet */ @@ -72,6 +70,11 @@ #define TSU_POLL_DELAY_US 10 /* Polling interval */ #define TSU_MIN_CLOCK_RATE 24000000 /* TSU_PCLK minimum 24MHz */ =20 +struct rzg3e_thermal_info { + int temp_d_mc; + int temp_e_mc; +}; + /** * struct rzg3e_thermal_priv - RZ/G3E TSU private data * @base: TSU register base @@ -79,6 +82,7 @@ * @syscon: regmap for calibration values * @zone: thermal zone device * @rstc: reset control + * @info: chip type specific information * @trmval0: calibration value 0 (b) * @trmval1: calibration value 1 (c) * @trim_offset: offset for trim registers in syscon @@ -90,6 +94,7 @@ struct rzg3e_thermal_priv { struct regmap *syscon; struct thermal_zone_device *zone; struct reset_control *rstc; + const struct rzg3e_thermal_info *info; u16 trmval0; u16 trmval1; u32 trim_offset; @@ -161,17 +166,17 @@ static void rzg3e_thermal_power_off(struct rzg3e_ther= mal_priv *priv) */ static int rzg3e_thermal_code_to_temp(struct rzg3e_thermal_priv *priv, u16= code) { - int temp_e_mc =3D TSU_TEMP_E * MILLIDEGREE_PER_DEGREE; - int temp_d_mc =3D TSU_TEMP_D * MILLIDEGREE_PER_DEGREE; + const struct rzg3e_thermal_info *info =3D priv->info; s64 numerator, denominator; int temp_mc; =20 - numerator =3D (temp_e_mc - temp_d_mc) * (s64)(code - priv->trmval0); + numerator =3D (info->temp_e_mc - info->temp_d_mc) * + (s64)(code - priv->trmval0); denominator =3D priv->trmval1 - priv->trmval0; =20 - temp_mc =3D div64_s64(numerator, denominator) + temp_d_mc; + temp_mc =3D div64_s64(numerator, denominator) + info->temp_d_mc; =20 - return clamp(temp_mc, temp_d_mc, temp_e_mc); + return clamp(temp_mc, info->temp_d_mc, info->temp_e_mc); } =20 /* @@ -180,13 +185,12 @@ static int rzg3e_thermal_code_to_temp(struct rzg3e_th= ermal_priv *priv, u16 code) */ static u16 rzg3e_thermal_temp_to_code(struct rzg3e_thermal_priv *priv, int= temp_mc) { - int temp_e_mc =3D TSU_TEMP_E * MILLIDEGREE_PER_DEGREE; - int temp_d_mc =3D TSU_TEMP_D * MILLIDEGREE_PER_DEGREE; + const struct rzg3e_thermal_info *info =3D priv->info; s64 numerator, denominator; s64 code; =20 - numerator =3D (temp_mc - temp_d_mc) * (priv->trmval1 - priv->trmval0); - denominator =3D temp_e_mc - temp_d_mc; + numerator =3D (temp_mc - info->temp_d_mc) * (priv->trmval1 - priv->trmval= 0); + denominator =3D info->temp_e_mc - info->temp_d_mc; =20 code =3D div64_s64(numerator, denominator) + priv->trmval0; =20 @@ -392,6 +396,8 @@ static int rzg3e_thermal_probe(struct platform_device *= pdev) return ret; platform_set_drvdata(pdev, priv); =20 + priv->info =3D device_get_match_data(dev); + priv->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); @@ -526,8 +532,13 @@ static const struct dev_pm_ops rzg3e_thermal_pm_ops = =3D { SYSTEM_SLEEP_PM_OPS(rzg3e_thermal_suspend, rzg3e_thermal_resume) }; =20 +static const struct rzg3e_thermal_info rzg3e_thermal_info =3D { + .temp_d_mc =3D -41000, + .temp_e_mc =3D 126000, +}; + static const struct of_device_id rzg3e_thermal_dt_ids[] =3D { - { .compatible =3D "renesas,r9a09g047-tsu" }, + { .compatible =3D "renesas,r9a09g047-tsu", .data =3D &rzg3e_thermal_info = }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, rzg3e_thermal_dt_ids); --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60CA62F39B9; Thu, 23 Oct 2025 08:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207631; cv=none; b=GR4owAFRA+wLAhdbbCNZ7thdNZOOKV9ji7FZ7kZjZMrCbwPRvpMC6Wfqn8rZ2qvyIxDCvIK5czae8o2Q/hGfDXFHpSr/rT+SfYINHdkgvlutVrAaNhZaw2OesrmY9XVfxyuaXSPbnE/x35F0OHLJLmYe5mKsaagFuRl1/GwNTic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207631; c=relaxed/simple; bh=Stj18Qd+XArNtfv+ovPOZBZd6ZIg/WDzc0UuZ3vuZIM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uVALc/3V17NX1XJZ5bjyFonB04YCwrGsqaw979PuKtuKNK5+0QJYbPBHJOTm9lh97cN3hw336j6neYCtA4qYNnnXGTpaWTCm66lWR3dlu2+mgI0VVIVmJIolWUoC3FF7LPOubpU4rZ+mfrcEZoR1pGYukuZSqahcEky+abnWeZU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: RtLKIBtWR2il/HUT5E69aQ== X-CSE-MsgGUID: NTXLpINlS0WIBbJc4UXwXg== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:28 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 577B2417CA94; Thu, 23 Oct 2025 17:20:22 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 04/10] thermal: renesas: rzg3e: make calibration value retrieval per-chip Date: Thu, 23 Oct 2025 11:19:18 +0300 Message-ID: <20251023081925.2412325-5-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs expose the temperature calibration data via SMC SIP calls. Prepare for them by moving the syscon usage into a single function, and placing it in the chip-specific struct. Rename the functions to match their functionality, and remove single-use variables from the private state. Also, move the calibration value mask into a macro. Signed-off-by: Cosmin Tanislav --- drivers/thermal/renesas/rzg3e_thermal.c | 62 +++++++++++++------------ 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/rene= sas/rzg3e_thermal.c index 3c9ff5e43d7e..d2525ad3ffcc 100644 --- a/drivers/thermal/renesas/rzg3e_thermal.c +++ b/drivers/thermal/renesas/rzg3e_thermal.c @@ -70,7 +70,12 @@ #define TSU_POLL_DELAY_US 10 /* Polling interval */ #define TSU_MIN_CLOCK_RATE 24000000 /* TSU_PCLK minimum 24MHz */ =20 +#define TSU_TEMP_MASK GENMASK(11, 0) + +struct rzg3e_thermal_priv; + struct rzg3e_thermal_info { + int (*get_trim)(struct rzg3e_thermal_priv *priv); int temp_d_mc; int temp_e_mc; }; @@ -91,13 +96,11 @@ struct rzg3e_thermal_info { struct rzg3e_thermal_priv { void __iomem *base; struct device *dev; - struct regmap *syscon; struct thermal_zone_device *zone; struct reset_control *rstc; const struct rzg3e_thermal_info *info; u16 trmval0; u16 trmval1; - u32 trim_offset; struct mutex lock; }; =20 @@ -334,22 +337,8 @@ static const struct thermal_zone_device_ops rzg3e_tz_o= ps =3D { .set_trips =3D rzg3e_thermal_set_trips, }; =20 -static int rzg3e_thermal_get_calibration(struct rzg3e_thermal_priv *priv) +static int rzg3e_validate_calibration(struct rzg3e_thermal_priv *priv) { - u32 val; - int ret; - - /* Read calibration values from syscon */ - ret =3D regmap_read(priv->syscon, priv->trim_offset, &val); - if (ret) - return ret; - priv->trmval0 =3D val & GENMASK(11, 0); - - ret =3D regmap_read(priv->syscon, priv->trim_offset + 4, &val); - if (ret) - return ret; - priv->trmval1 =3D val & GENMASK(11, 0); - /* Validate calibration data */ if (!priv->trmval0 || !priv->trmval1 || priv->trmval0 =3D=3D priv->trmval1 || @@ -365,17 +354,30 @@ static int rzg3e_thermal_get_calibration(struct rzg3e= _thermal_priv *priv) return 0; } =20 -static int rzg3e_thermal_parse_dt(struct rzg3e_thermal_priv *priv) +static int rzg3e_thermal_get_syscon_trim(struct rzg3e_thermal_priv *priv) { struct device_node *np =3D priv->dev->of_node; + struct regmap *syscon; u32 offset; + int ret; + u32 val; =20 - priv->syscon =3D syscon_regmap_lookup_by_phandle_args(np, "renesas,tsu-tr= im", 1, &offset); - if (IS_ERR(priv->syscon)) - return dev_err_probe(priv->dev, PTR_ERR(priv->syscon), + syscon =3D syscon_regmap_lookup_by_phandle_args(np, "renesas,tsu-trim", 1= , &offset); + if (IS_ERR(syscon)) + return dev_err_probe(priv->dev, PTR_ERR(syscon), "Failed to parse renesas,tsu-trim\n"); =20 - priv->trim_offset =3D offset; + /* Read calibration values from syscon */ + ret =3D regmap_read(syscon, offset, &val); + if (ret) + return ret; + priv->trmval0 =3D val & TSU_TEMP_MASK; + + ret =3D regmap_read(syscon, offset + 4, &val); + if (ret) + return ret; + priv->trmval1 =3D val & TSU_TEMP_MASK; + return 0; } =20 @@ -402,11 +404,16 @@ static int rzg3e_thermal_probe(struct platform_device= *pdev) if (IS_ERR(priv->base)) return PTR_ERR(priv->base); =20 - /* Parse device tree for trim register info */ - ret =3D rzg3e_thermal_parse_dt(priv); + ret =3D priv->info->get_trim(priv); if (ret) return ret; =20 + /* Validate calibration data */ + ret =3D rzg3e_validate_calibration(priv); + if (ret) + return dev_err_probe(dev, ret, + "Failed to get valid calibration data\n"); + /* Get clock to verify frequency - clock is managed by power domain */ clk =3D devm_clk_get(dev, NULL); if (IS_ERR(clk)) @@ -423,12 +430,6 @@ static int rzg3e_thermal_probe(struct platform_device = *pdev) return dev_err_probe(dev, PTR_ERR(priv->rstc), "Failed to get/deassert reset control\n"); =20 - /* Get calibration data */ - ret =3D rzg3e_thermal_get_calibration(priv); - if (ret) - return dev_err_probe(dev, ret, - "Failed to get valid calibration data\n"); - /* Get comparison interrupt */ irq =3D platform_get_irq_byname(pdev, "adcmpi"); if (irq < 0) @@ -533,6 +534,7 @@ static const struct dev_pm_ops rzg3e_thermal_pm_ops =3D= { }; =20 static const struct rzg3e_thermal_info rzg3e_thermal_info =3D { + .get_trim =3D rzg3e_thermal_get_syscon_trim, .temp_d_mc =3D -41000, .temp_e_mc =3D 126000, }; --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 521122F3C02; Thu, 23 Oct 2025 08:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207637; cv=none; b=VVwzol0L2Rh6NjVFkJ7ZzMYe6W0rpsfZsg/Kdp1+sJx0gDWS/naWZSq+eI4e91cU/oDeVO02CcGKdHjJjV6vBemQhROnfnyeAfx8TvDXxkje6mcjIvJcZu2nI4SoAAj0Q3WdpsKbEyR+mP9NCg8tRATIEWMqkpbpCLYX4d97HEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207637; c=relaxed/simple; bh=NIBKgKhv9xAfByUXnE0EheWDX+dBSuLYB4n/gpkUHZs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wru1TcYOgS5ACf4aGwXPrseSxwLJ0yxMq2Y3SPmoV9vk0lI+83EG+eu+GoNsk0X2YTIV4VVhL86C/b4BJVX16GtC/U+eiRnZq9/AUK+2mbdPMwCeWeLyxj1Nob/49Q0Xd4O0V2awE7uNESp0iVSkOnGKDa3usQyIm7ka8hJWlKw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: 4ZjpXm+SQrOM1FWBtn5m4g== X-CSE-MsgGUID: CXQsNf+OQkmoXlNNbE58fw== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:35 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 5BA07417CA94; Thu, 23 Oct 2025 17:20:29 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 05/10] dt-bindings: thermal: r9a09g047-tsu: document RZ/T2H and RZ/N2H Date: Thu, 23 Oct 2025 11:19:19 +0300 Message-ID: <20251023081925.2412325-6-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs include a Temperature Sensor Unit (TSU). The device provides real-time temperature measurements for thermal management, utilizing a single dedicated channel for temperature sensing. Signed-off-by: Cosmin Tanislav --- .../thermal/renesas,r9a09g047-tsu.yaml | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/renesas,r9a09g047-ts= u.yaml b/Documentation/devicetree/bindings/thermal/renesas,r9a09g047-tsu.ya= ml index 8d3f3c24f0f2..3cb66b51831d 100644 --- a/Documentation/devicetree/bindings/thermal/renesas,r9a09g047-tsu.yaml +++ b/Documentation/devicetree/bindings/thermal/renesas,r9a09g047-tsu.yaml @@ -16,7 +16,14 @@ description: =20 properties: compatible: - const: renesas,r9a09g047-tsu + oneOf: + - items: + - const: renesas,r9a09g047-tsu # RZ/G3E + - items: + - const: renesas,r9a09g077-tsu # RZ/T2H + - items: + - const: renesas,r9a09g087-tsu # RZ/N2H + - const: renesas,r9a09g077-tsu # RZ/T2H =20 reg: maxItems: 1 @@ -59,12 +66,21 @@ required: - compatible - reg - clocks - - resets - power-domains - interrupts - interrupt-names - "#thermal-sensor-cells" - - renesas,tsu-trim + +allOf: + - if: + properties: + compatible: + contains: + const: renesas,r9a09g047-tsu + then: + required: + - resets + - renesas,tsu-trim =20 additionalProperties: false =20 --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0221C2F39B5; Thu, 23 Oct 2025 08:20:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207645; cv=none; b=ogQVfY+LMobcYy2KQPCNzFIC30YEfi9YftnPs7aGooxuQ9+peVgF//w0//8aj756nDmESyPDNAC/dXxs0mK7ou982rHyFhMLtyUxBoiea3a8xjJM6Twn2ftYrdahnCKCRTnBeVsJX/1A1qgVUUAQZ9O9gwMAROvxKOuqArEAt4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207645; c=relaxed/simple; bh=MkbSgS4YkR93ogcEb+XS3z4L8GDw28CMziq/2/JDNmg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jfE1thGsvcEj/6fb0MomndG8KLl6p7ouIHmVRSF52dliCqbmhM5/ipZGI1wD0YX5p4N300wExCpqB90QnlyQYgOrXTgScoAn4ovswtXfHR3B+HQdoTX45wHcmQnU9/RSSyR1tYxQLJG7t5IW8tN0SZRsx5fauuGKbF5VVkuVr/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: sze8qMMUReyzy9kyg3LcOA== X-CSE-MsgGUID: wqceSkWbRlaxJV+DuS0Bfw== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:41 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 375AC417CA94; Thu, 23 Oct 2025 17:20:35 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 06/10] thermal: renesas: rzg3e: add support for RZ/T2H and RZ/N2H Date: Thu, 23 Oct 2025 11:19:20 +0300 Message-ID: <20251023081925.2412325-7-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs expose the temperature calibration via SMC SIP and do not have a reset for the TSU peripheral, and use different minimum and maximum temperature values compared to the already supported RZ/G3E. Although the calibration data is stored in an OTP memory, the OTP itself is not memory-mapped, access to it is done through an OTP controller. The OTP controller is only accessible from the secure world, but the temperature calibration data stored in the OTP is exposed via SMC. Add support for retrieving the calibration data using arm_smcc_smc(). Add a compatible for RZ/T2H, RZ/N2H can use it as a fallback. Signed-off-by: Cosmin Tanislav --- drivers/thermal/renesas/rzg3e_thermal.c | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/rene= sas/rzg3e_thermal.c index d2525ad3ffcc..efd09c35b216 100644 --- a/drivers/thermal/renesas/rzg3e_thermal.c +++ b/drivers/thermal/renesas/rzg3e_thermal.c @@ -72,6 +72,10 @@ =20 #define TSU_TEMP_MASK GENMASK(11, 0) =20 +#define RZ_SIP_SVC_GET_SYSTSU 0x82000022 +#define OTP_TSU_REG_ADR_TEMPHI 0x01DC +#define OTP_TSU_REG_ADR_TEMPLO 0x01DD + struct rzg3e_thermal_priv; =20 struct rzg3e_thermal_info { @@ -381,6 +385,21 @@ static int rzg3e_thermal_get_syscon_trim(struct rzg3e_= thermal_priv *priv) return 0; } =20 +static int rzg3e_thermal_get_smc_trim(struct rzg3e_thermal_priv *priv) +{ + struct arm_smccc_res local_res; + + arm_smccc_smc(RZ_SIP_SVC_GET_SYSTSU, OTP_TSU_REG_ADR_TEMPLO, + 0, 0, 0, 0, 0, 0, &local_res); + priv->trmval0 =3D local_res.a0 & TSU_TEMP_MASK; + + arm_smccc_smc(RZ_SIP_SVC_GET_SYSTSU, OTP_TSU_REG_ADR_TEMPHI, + 0, 0, 0, 0, 0, 0, &local_res); + priv->trmval1 =3D local_res.a0 & TSU_TEMP_MASK; + + return 0; +} + static int rzg3e_thermal_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -539,8 +558,15 @@ static const struct rzg3e_thermal_info rzg3e_thermal_i= nfo =3D { .temp_e_mc =3D 126000, }; =20 +static const struct rzg3e_thermal_info rzt2h_thermal_info =3D { + .get_trim =3D rzg3e_thermal_get_smc_trim, + .temp_d_mc =3D -40000, + .temp_e_mc =3D 125000, +}; + static const struct of_device_id rzg3e_thermal_dt_ids[] =3D { { .compatible =3D "renesas,r9a09g047-tsu", .data =3D &rzg3e_thermal_info = }, + { .compatible =3D "renesas,r9a09g077-tsu", .data =3D &rzt2h_thermal_info = }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, rzg3e_thermal_dt_ids); --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8100F2F998D; Thu, 23 Oct 2025 08:20:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207653; cv=none; b=uLlDmjuIogk1s18vxG8Ebhv9oOsDf3YGkGllfG77MRTU2TkM0hSFirt5zbjl0qTzlooPeHvyyYOmWpcGwaWWh+oeAjUSNU3WsUTG4355P66DINnlvgj37v6c3tjbQ27c7VvkNk88cJa19+skAy0GAnl+zJZThn6fJlatN+NcOZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207653; c=relaxed/simple; bh=xB8DFzc5f4HVxaz4ibAx2bYfo7c+ayjhDoWFoXboEUY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uwkqvmqS1YS0Qu+EA0qNsv9R9YC9/rHJQ7GqetbdrsmpXsR7YobVeQI3kDfy1+bSIWPs1RKjv+uUlEFHfjjFDEKPnbpf4Y7UV8nCubwLkEHPWt68iK+6fd6rb93QQfonJbE/sMMPGlsMTpcHVuUImAvBqqoLhy5sPdACf3BOQTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: ZLsoNXSlQSSPA+F492KIGw== X-CSE-MsgGUID: bob2syBVSnWNVIorAGlUfQ== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:48 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 48651417CA94; Thu, 23 Oct 2025 17:20:43 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 07/10] arm64: dts: renesas: r9a09g077: add OPP table Date: Thu, 23 Oct 2025 11:19:21 +0300 Message-ID: <20251023081925.2412325-8-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add OPP table for RZ/T2H SoC. Signed-off-by: Cosmin Tanislav --- arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g077.dtsi index 33925f13ee86..bb030bfed090 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi @@ -14,6 +14,17 @@ / { #size-cells =3D <2>; interrupt-parent =3D <&gic>; =20 + cluster0_opp: opp-table-0 { + compatible =3D "operating-points-v2"; + + opp-600000000 { + opp-hz =3D /bits/ 64 <600000000>; + }; + opp-1200000000 { + opp-hz =3D /bits/ 64 <1200000000>; + }; + }; + cpus { #address-cells =3D <1>; #size-cells =3D <0>; @@ -24,6 +35,8 @@ cpu0: cpu@0 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C0>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 cpu1: cpu@100 { @@ -32,6 +45,8 @@ cpu1: cpu@100 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C1>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 cpu2: cpu@200 { @@ -40,6 +55,8 @@ cpu2: cpu@200 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C2>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 cpu3: cpu@300 { @@ -48,6 +65,8 @@ cpu3: cpu@300 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C3>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 L3_CA55: cache-controller-0 { --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23BD52FB0AA; Thu, 23 Oct 2025 08:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207660; cv=none; b=SePYkTooOQshnOJRnUE5swZOmgq1+Vjjla7anuHMEq18eInMzpW+99S5kZFIduXO9sZ8rNpXvmOPkknyGYBwfoWGJ1yrXKdDzt+9HsDMPTpZk2hJOjZy6Yixovr5j9Bfln6BD21bWVtLCa4YF8qh/mITsVphnKy+ipNTU0d8whE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207660; c=relaxed/simple; bh=81ALuVN/SLvYBy50VZCJcFcx0NqsaCfGlmBKJDatKfw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aNKnKOyJzMfgQADFu11Orfb0fEhbd1QsH4WykObob8eu34G4O4V/WGYFNpZC/rH9RUj8sGjwhsYG4joGiFuB05gp93lBA9BxeSmqjuU6Gt6DktTNx9DevDJ+uXeR5gm5k13d0RirJ/2sMjMR0DZ1zSYxRhDpnfRG5mxo5+aV+hY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: ipixnCrrSyyjAu6i81B5vw== X-CSE-MsgGUID: 42LCZbd1SImBGOZYX3ykFg== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 23 Oct 2025 17:20:56 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 70F56417CA94; Thu, 23 Oct 2025 17:20:50 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 08/10] arm64: dts: renesas: r9a09g087: add OPP table Date: Thu, 23 Oct 2025 11:19:22 +0300 Message-ID: <20251023081925.2412325-9-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add OPP table for RZ/N2H SoC. Signed-off-by: Cosmin Tanislav --- arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g087.dtsi index b7685449a7d7..5eef8c18037e 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi @@ -14,6 +14,17 @@ / { #size-cells =3D <2>; interrupt-parent =3D <&gic>; =20 + cluster0_opp: opp-table-0 { + compatible =3D "operating-points-v2"; + + opp-600000000 { + opp-hz =3D /bits/ 64 <600000000>; + }; + opp-1200000000 { + opp-hz =3D /bits/ 64 <1200000000>; + }; + }; + cpus { #address-cells =3D <1>; #size-cells =3D <0>; @@ -24,6 +35,8 @@ cpu0: cpu@0 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C0>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 cpu1: cpu@100 { @@ -32,6 +45,8 @@ cpu1: cpu@100 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C1>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 cpu2: cpu@200 { @@ -40,6 +55,8 @@ cpu2: cpu@200 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C2>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 cpu3: cpu@300 { @@ -48,6 +65,8 @@ cpu3: cpu@300 { device_type =3D "cpu"; next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; + clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C3>; + operating-points-v2 =3D <&cluster0_opp>; }; =20 L3_CA55: cache-controller-0 { --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1E0D2FDC29; Thu, 23 Oct 2025 08:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207667; cv=none; b=R4UQL35kKuM/EkZF/hDTr+cJR9hACZY8O6XbKfaH+AL7+2k9EWrNJXZN5YtS8wFsRNF/OaFoj3aCT2jKtOK1B3Gm1SdcqQjP/F6ljkXWsMqN7UG4pcUaDUfkUTTtT9UqCXsLmAr9FfOtuTF+CwaOst0DlIhFGUrzh+SjBfLoo3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207667; c=relaxed/simple; bh=LVA7GW9F8kSaUEOhYwNRsN+xXvpmnUqTQ2XuynWD3yI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ab8bpX/3J2+/J26rx/oHh//Q086umVmoTA+g5mMzc2hauW6cQZ5krjWVR/PM6vmoZ2iG7nuSe4sVddoS5It6zV4DRqnDWLuR/vbkUtZND907P8NYVDQrJcKOMaBMY/uOsOmgQl2yog0qUjAsvinl7tI2b1BAHyFCq4bWBNtQ/PM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: JFA/p9RvSr6WN9k7w2zS5g== X-CSE-MsgGUID: Rq2fLBgjTiqzZImYTs6fVQ== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 23 Oct 2025 17:21:04 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id F2878417CA94; Thu, 23 Oct 2025 17:20:58 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 09/10] arm64: dts: renesas: r9a09g077: add TSU and thermal zones support Date: Thu, 23 Oct 2025 11:19:23 +0300 Message-ID: <20251023081925.2412325-10-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/T2H (R9A09G077) SoC includes a Temperature Sensor Unit (TSU). The device provides real-time temperature measurements for thermal management, utilizing a single dedicated channel for temperature sensing. The TSU loads calibration data via SMC SIP. Signed-off-by: Cosmin Tanislav --- arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g077.dtsi index bb030bfed090..42ee9f299837 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi @@ -36,6 +36,7 @@ cpu0: cpu@0 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C0>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -46,6 +47,7 @@ cpu1: cpu@100 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C1>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -56,6 +58,7 @@ cpu2: cpu@200 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C2>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -66,6 +69,7 @@ cpu3: cpu@300 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G077_CLK_CA55C3>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -244,6 +248,17 @@ wdt5: watchdog@80083400 { status =3D "disabled"; }; =20 + tsu: thermal@80086000 { + compatible =3D "renesas,r9a09g077-tsu"; + reg =3D <0 0x80086000 0 0x1000>; + interrupts =3D , + ; + interrupt-names =3D "adi", "adcmpi"; + clocks =3D <&cpg CPG_MOD 307>; + power-domains =3D <&cpg>; + #thermal-sensor-cells =3D <0>; + }; + i2c0: i2c@80088000 { compatible =3D "renesas,riic-r9a09g077"; reg =3D <0 0x80088000 0 0x400>; @@ -844,6 +859,37 @@ sdhi1_vqmmc: vqmmc-regulator { }; }; =20 + thermal-zones { + cpu-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; + thermal-sensors =3D <&tsu>; + + cooling-maps { + map0 { + trip =3D <&target>; + cooling-device =3D <&cpu0 0 1>, <&cpu1 0 1>, + <&cpu2 0 1>, <&cpu3 0 1>; + contribution =3D <1024>; + }; + }; + + trips { + target: trip-point { + temperature =3D <95000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + + sensor_crit: sensor-crit { + temperature =3D <120000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + }; + stmmac_axi_setup: stmmac-axi-config { snps,lpi_en; snps,wr_osr_lmt =3D <0xf>; --=20 2.51.1.dirty From nobody Mon Feb 9 05:20:31 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F18622FF152; Thu, 23 Oct 2025 08:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207678; cv=none; b=f8hG6l5eWUPb3njBISuR7bx/dQUPeyZNkbIfp2JR5vVtvvFGrSRpKoI+EwFWp3JMnlAuhAj7iq7x05GmXUuJfreLn/MlEXa7XxtWu/TgZrR/hKQVlnMizBQgRZZ/8uv+1nA4pDLJhiYJhgk+JWzL6igklSd2u3lTHM5AeFaISOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761207678; c=relaxed/simple; bh=Pg7tjeq7r3AX9QT2iM2Pps0AvibFReG3mtK6Z/Newus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ab24PIh/GiAFt5d6BB/ROVzJzMM49cN8WzJEOHG4xNKxVO4qrQVzVhlGsQMJAU5u0AGZPFApzPqizdxXADi70iQKV+RdOiWCukkEeQYoV7EMF1WWkaT8M8/jMOpfn+/OqMlYXIDDbtDFWfLi5Y+N6jUVyVOeWh3DeZ1BZA4iuAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: Ir7V6Xz6RZG6rhRsZ9GM8g== X-CSE-MsgGUID: kc63CY+wQVOikdpb03IcJA== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Oct 2025 17:21:11 +0900 Received: from demon-pc.localdomain (unknown [10.226.93.77]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0A230417DE80; Thu, 23 Oct 2025 17:21:05 +0900 (JST) From: Cosmin Tanislav To: Cc: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 10/10] arm64: dts: renesas: r9a09g087: add TSU and thermal zones support Date: Thu, 23 Oct 2025 11:19:24 +0300 Message-ID: <20251023081925.2412325-11-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.1.dirty In-Reply-To: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251023081925.2412325-1-cosmin-gabriel.tanislav.xa@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Renesas RZ/N2H (R9A09G087) SoC includes a Temperature Sensor Unit (TSU). The device provides real-time temperature measurements for thermal management, utilizing a single dedicated channel for temperature sensing. The TSU loads calibration data via SMC SIP. Signed-off-by: Cosmin Tanislav --- arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g087.dtsi index 5eef8c18037e..db117b6f75a1 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi @@ -36,6 +36,7 @@ cpu0: cpu@0 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C0>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -46,6 +47,7 @@ cpu1: cpu@100 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C1>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -56,6 +58,7 @@ cpu2: cpu@200 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C2>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -66,6 +69,7 @@ cpu3: cpu@300 { next-level-cache =3D <&L3_CA55>; enable-method =3D "psci"; clocks =3D <&cpg CPG_CORE R9A09G087_CLK_CA55C3>; + #cooling-cells =3D <2>; operating-points-v2 =3D <&cluster0_opp>; }; =20 @@ -244,6 +248,17 @@ wdt5: watchdog@80083400 { status =3D "disabled"; }; =20 + tsu: thermal@80086000 { + compatible =3D "renesas,r9a09g087-tsu", "renesas,r9a09g077-tsu"; + reg =3D <0 0x80086000 0 0x1000>; + interrupts =3D , + ; + interrupt-names =3D "adi", "adcmpi"; + clocks =3D <&cpg CPG_MOD 307>; + power-domains =3D <&cpg>; + #thermal-sensor-cells =3D <0>; + }; + i2c0: i2c@80088000 { compatible =3D "renesas,riic-r9a09g087", "renesas,riic-r9a09g077"; reg =3D <0 0x80088000 0 0x400>; @@ -844,6 +859,37 @@ sdhi1_vqmmc: vqmmc-regulator { }; }; =20 + thermal-zones { + cpu-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; + thermal-sensors =3D <&tsu>; + + cooling-maps { + map0 { + trip =3D <&target>; + cooling-device =3D <&cpu0 0 1>, <&cpu1 0 1>, + <&cpu2 0 1>, <&cpu3 0 1>; + contribution =3D <1024>; + }; + }; + + trips { + target: trip-point { + temperature =3D <95000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + + sensor_crit: sensor-crit { + temperature =3D <120000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + }; + stmmac_axi_setup: stmmac-axi-config { snps,lpi_en; snps,wr_osr_lmt =3D <0xf>; --=20 2.51.1.dirty