From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B4BA1F9F47; Wed, 26 Nov 2025 13:04:53 +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=1764162295; cv=none; b=DcHqOlEQG6qoY5oF4P6yTMF3QZVMtisTuMHRUyi5J3PydMTd972VlIr9OewULrBAXrWGACwFbdgcWLj/bPKOC3dJfWICmSZJZMTBHa/cOz15+uMk9Zm/3WE2UWouVg06I851hCZ16I6mWu4lMLkz0gJ+TRKT9xdpgqcalEHtwdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162295; c=relaxed/simple; bh=M0x5/t/mwATltuD96QkP0RYumSKKZX9WxjovT1nuazE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YABNAwAHRVxqH/b0JHhME1N3pwSvaZoZHk8ClS9Q5Lez+OP0ujt7AI7b5FUipXzrKbGXDfG1iiBn5rXW3QGOaw1ipiGllv4Rt6MlzHWzyzAob5iXKl1hkarZDUhGQn9y69BGOt3lgG6Y0rOhZ58Do84wZ1TcQz4DqFIvkv/HOaY= 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: xubRuzV/Rw6g9Qz1yzDh3A== X-CSE-MsgGUID: vy0v+ysgSfmYd5PCcaEvUw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 26 Nov 2025 22:04:49 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 9241F400EF74; Wed, 26 Nov 2025 22:04:44 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 1/9] thermal: renesas: rzg3e: make reset optional Date: Wed, 26 Nov 2025 15:03:48 +0200 Message-ID: <20251126130356.2768625-2-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54A7421B905; Wed, 26 Nov 2025 13:04:55 +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=1764162298; cv=none; b=NUYZ629QCcUtjJEJG//Ki+4zlT+A1SgOvkWIai+XSZdX9/mZoDFTy0Yn8n5c+pO3fxhoyuogqjPwsSWR05q6sB1v1jBGUfE2LR3IP60l03OPagSa8VYRy6HKqNWZihsPWGRbIIGVuHXJDuFfhkp/VFZbXHEAsT7fHR9Dt/jaAU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162298; c=relaxed/simple; bh=J9yUnSMRv9Tph8SjqcMrQkdXFrwHmRg+3/BxnDv5X2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q9RDK3CUILqoVlJmBrq3rLbKAtb6H9utaWHqqeix8TL8xTJ4BP8nYO1WpV1MrFnz6m7f80zINHLkCS6m4jLxoNGNzf/Xyh0p6wCAoYCz9o7h/wXxFQ9a54LE9gVNwmOm/xeu8ZIRJdfzoD0PqDPX3kTXiNPFG4H808H3tjlpiDY= 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: WZp3P4KRQAWOBdcMj8r8SQ== X-CSE-MsgGUID: yWByuc9OR5u5PPaTbabQDw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 26 Nov 2025 22:04:55 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8B6EF400EF74; Wed, 26 Nov 2025 22:04:50 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 2/9] thermal: renesas: rzg3e: make min and max temperature per-chip Date: Wed, 26 Nov 2025 15:03:49 +0200 Message-ID: <20251126130356.2768625-3-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDA701FDA8E; Wed, 26 Nov 2025 13:05:08 +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=1764162311; cv=none; b=BaPLDhJ1vHa3x84iT1s4FyxAiRCGO8dhLqBe8zOMACShJdZInFJaEHWYhqAirPi7UfSvb1p+6BcCip5+DhFgtNceq9uVPzw+R0768ivgK4uO6LXycns5TZVNhnxXAdonrZ5iyNSbjvwdkxHqu0+LDqOC/ZYUztR29v7hxg8BuL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162311; c=relaxed/simple; bh=eO68xX3nlLsLgYXyLrLouBr7TE7szV//psbvg31pDR0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Aho7LHc42Tglf9m0zDGkf3YMLp2lZm7byCaysvbjAEQNtgPMerU23jhxQuv6DmQpO9OQOMP905b4knr7v7sV2mZ/dRXl23GffViB1MyIE8OjsYcfX5EsZ+H2K2aUDQLAZ4IKmXSJtXaAJ2u5FVaeHsN/UVdPfAEfvvSpwdqA15g= 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: Qr0sJnkBQ9irgHekIha/sg== X-CSE-MsgGUID: F+P7PkhGRa6EF4ljcCMSAQ== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 26 Nov 2025 22:05:01 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 753C5400EF74; Wed, 26 Nov 2025 22:04:56 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 3/9] thermal: renesas: rzg3e: make calibration value retrieval per-chip Date: Wed, 26 Nov 2025 15:03:50 +0200 Message-ID: <20251126130356.2768625-4-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8952C20B212; Wed, 26 Nov 2025 13:05:11 +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=1764162313; cv=none; b=pNpjG1mZIS+H4q1R/gBlIOoVBr9s3UB130ir+jPeabCJsq2eV1PA+5zGt83STOthZj/oX+rmRsvvQXR1WYs+4uRovzHuFjhNEs/Ms1iE0R8hsN6nFBb4ZeXEsXtLfOM6gm7xxtz4n72hlCaNmzAvltbEYvA0WDeBTypcG9q0+0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162313; c=relaxed/simple; bh=4SiWj9a1d7toS3gwQAjuL4oqqXFetkhqtGEYTIZAt6I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=foAwnHWFamOaaq/DojfJjv1NYkq3Tr9bOPW5m62/b4ODR8yDrGahuu1QlrDx/wn8dCMz1j/mzqDHkgJJJmFA0V3e+ca2BXI7yEpQivZNZK4Dj92/BUbIeNBtA3Dk9qRgsbVkBHh958QjyUYDLCtcuroX4KZvg6RAQPaVO46bdKA= 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: BetQJCRUTSSDtfgZ3N8hPA== X-CSE-MsgGUID: 0RCFpmENQbee/dnzMQpK4w== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 26 Nov 2025 22:05:07 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4F4D9400EF6C; Wed, 26 Nov 2025 22:05:02 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 4/9] dt-bindings: thermal: r9a09g047-tsu: document RZ/T2H and RZ/N2H Date: Wed, 26 Nov 2025 15:03:51 +0200 Message-ID: <20251126130356.2768625-5-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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. Compared to the previously supported RZ/G3E, the RZ/T2H and RZ/N2H SoCs do not have a reset for the TSU peripheral, and the OTP data is exposed via ARM SMC, as opposed to a system register. Signed-off-by: Cosmin Tanislav Acked-by: Conor Dooley --- V3: * add more details about the differences in the commit message * rebase on top of [1] * conditionally add `resets: false` and `renesas,tsu-trim: false` for renesas,r9a09g077-tsu compatibles [1]: https://patchwork.kernel.org/project/linux-pm/cover/20251020143107.139= 74-1-ovidiu.panait.rb@renesas.com/ V2: * merge two items into a single enum .../thermal/renesas,r9a09g047-tsu.yaml | 30 +++++++++++++++++-- 1 file changed, 27 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 befdc8b7a082..a04e5048eadf 100644 --- a/Documentation/devicetree/bindings/thermal/renesas,r9a09g047-tsu.yaml +++ b/Documentation/devicetree/bindings/thermal/renesas,r9a09g047-tsu.yaml @@ -17,10 +17,15 @@ description: properties: compatible: oneOf: - - const: renesas,r9a09g047-tsu # RZ/G3E + - enum: + - renesas,r9a09g047-tsu # RZ/G3E + - renesas,r9a09g077-tsu # RZ/T2H - items: - const: renesas,r9a09g057-tsu # RZ/V2H - const: renesas,r9a09g047-tsu # RZ/G3E + - items: + - const: renesas,r9a09g087-tsu # RZ/N2H + - const: renesas,r9a09g077-tsu # RZ/T2H =20 reg: maxItems: 1 @@ -63,12 +68,31 @@ 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 + + - if: + properties: + compatible: + contains: + const: renesas,r9a09g077-tsu + then: + properties: + resets: false + renesas,tsu-trim: false =20 additionalProperties: false =20 --=20 2.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A3EC22756A; Wed, 26 Nov 2025 13:05:13 +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=1764162316; cv=none; b=sV/rA7R2Am5UXUAWMKuq0gBER5Rs5XBgzT1D+9HHYUaucb0VXl5Icem3AeO0EG3Efg+2LoTSLp538HG2QhxZITKUJ1CTaOGFE/dLVKhGkE0LaR9ekJzOxPUN6Y/E1yQ0DWoDDJUVt+BQWR+pFn0Y3HUWSwWYRq/SqhKKG5JU1+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162316; c=relaxed/simple; bh=PzzgNjocYWBzraToDPR4zbqXDV0pQkODpfP6ELH+LE8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AJw80IGmmuzW1J7JKUWBSwmN33Mr60Va7nnwWvPWq+Yu8sVmFSqlOE1l6fAG5jCV0i1XST0jSbRfEk5bWiGkKml0RI/ObBk60eResPR7OLkGiFJg0sM0i2bugXu1wyPkh4ACIyVEpNeFalUmQO7eT9uArir+cZswmfOx0bdKKy4= 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: W+NTOzuJSo6GRuNP26fJ5A== X-CSE-MsgGUID: ZW4Npv/TS0K8wWfVgDVUGw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 26 Nov 2025 22:05:13 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id A00E4400EF6C; Wed, 26 Nov 2025 22:05:08 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 5/9] thermal: renesas: rzg3e: add support for RZ/T2H and RZ/N2H Date: Wed, 26 Nov 2025 15:03:52 +0200 Message-ID: <20251126130356.2768625-6-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 490451DF254; Wed, 26 Nov 2025 13:05: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=1764162324; cv=none; b=SWnogxR9u2Sz86X84Aw62S+LlYxXBoFW/qxHviNi0wE92T+2jAwUxeZw45DCdRBjYRqS1pqOjgh81peBY83oDt8Mjqdwml71uOFPYh1kz6hBmkCleYV6ZOGh52455DcMT3QetUNfIs+lZ3cxheshDlJb0EXAgAQCqEmXeYapWOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162324; c=relaxed/simple; bh=dCxGVXgrNmiUWIIRS4W+ffmBeZIJ0fnk2b4Rdl0mECg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CRjj2ro8wB+d2hJxSkDyCcb3bTypk2vZt8UYfwwfAjStiHhEOmj8dBKjx4DxDD1K6P0FwD9cZ46lZABYuAm1Ujn9vgC1+KRNx934a2G1j0cYqwi2wVphE3sNnJlfDQSdSGEJ5/jBlU4Y2MoPC0YdoyECwZcRtG/7sNtEikks0iI= 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: hf+NBYPLT+ixOgXFVZVW2A== X-CSE-MsgGUID: h9KrqPrcREqIf+5DXkXDGg== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 26 Nov 2025 22:05:21 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8EEF6400EF74; Wed, 26 Nov 2025 22:05:16 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 6/9] arm64: dts: renesas: r9a09g077: add OPP table Date: Wed, 26 Nov 2025 15:03:53 +0200 Message-ID: <20251126130356.2768625-7-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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 f5fa6ca06409..ca61f7846c5e 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.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F3FA217F24; Wed, 26 Nov 2025 13:05:28 +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=1764162330; cv=none; b=XK+nPmJT89JoFSeYCnZ+F64j7/nn5U146eWHE+SXdcfDGGIni0CEc43jSdHjq6BgLSVsVf0bh8R2xg0rcYWGsdSsFf+l0bsqdHTdDoNesVnU/lq01OrTn4jE9BrNaoARMsTNnkTjjitMmkM/fQSjb/JNerjZyntPP+sS0ZDx/lY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162330; c=relaxed/simple; bh=rrFI/6SQ4gjFWmrzXqY+z1JGHxTP/OgjGv+jDhqEdic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dNvQQdT9d0Y5Pp+9+K69X/KNkrh15Vw2O+rYRQdhTvrIC5CUoBU22Bb9NKfkxxrDdBC6HUO1fOgmHTzPc7uJamAy82IdJ/GVlNQkIC90ePA0+QNBlPViqXJxxK2WhjxW2C/UDg9MAnBxGXdNyKc2aqDBRbplg/M0l4tGMpZOwbw= 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: XS2zVqcDRtKbasHqBPjhFA== X-CSE-MsgGUID: lBc0ILzjSpe5CPE0/8HwtQ== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 26 Nov 2025 22:05:27 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 825B7400EF74; Wed, 26 Nov 2025 22:05:22 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 7/9] arm64: dts: renesas: r9a09g087: add OPP table Date: Wed, 26 Nov 2025 15:03:54 +0200 Message-ID: <20251126130356.2768625-8-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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 361a9235f00d..64a7f94ab316 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.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 492F8217F24; Wed, 26 Nov 2025 13:05:33 +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=1764162335; cv=none; b=ecAGpJPCrZ1Fg/9o6XyMgGVSw5O/L8fM5MQFEEjX18MdyGdl7V1I6FubreRYwEXnNtfNnXrSq6vQnKX0mviL4vpffsw3ABrKYHOQd7QwdJIdFog/aBhpWLuH6y7skFQFbkoObVV+BgSg7jzEsgY8VYm6e+sKG6a8QxPzGzdJvBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162335; c=relaxed/simple; bh=7L7JOzyPcvDo9Od/8Tjg3cCu2Fr61nW5NsWYbOOzMQM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MI1HN5dlX4pFmmcstufM5mHnMzRWqpxHIF2FctJ0l4JZw37/pXL9s4MlfH2KmzM+3MjbcJcU63vAOVDNYI0ZcgGkMLk4+JsWuFN182fK3l0YLSmONQxE+VwtlladqICVTE5UjTL/AmoB7UkcIA5MyeYd/vcXjfmSNSRgwEE5/YM= 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: r6ppf+1DQA+z5G+d0g4vjw== X-CSE-MsgGUID: cpbLmtScS9azLzf7tQX3bQ== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 26 Nov 2025 22:05:33 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4B157400EF74; Wed, 26 Nov 2025 22:05:28 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 8/9] arm64: dts: renesas: r9a09g077: add TSU and thermal zones support Date: Wed, 26 Nov 2025 15:03:55 +0200 Message-ID: <20251126130356.2768625-9-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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 ca61f7846c5e..d59f70d9f8a9 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>; @@ -952,6 +967,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.52.0 From nobody Mon Dec 1 22:37:25 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A69FB1E7C18; Wed, 26 Nov 2025 13:05:39 +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=1764162341; cv=none; b=Y8mcgxVXcseTdqnpw+OkNel5kiW2FjDXAspfF5o9wgrruPD1CIp6F+QEFe9daJBQtLu357zOIhIwq4NrlxPFuFn2dukhubUO9VcC7x5OImfD3WpPqdjg3a0Gmb69Zjh8RBuPBYZ+qbW7FyOkZ/itnGtc74feeyX7quRFNOEGBHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764162341; c=relaxed/simple; bh=jdkjTDSMIvrVjOQiMzFRPocg2EyqFCWXQ33dCZzd9zQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aYNu6gXwFUNbcgjMJVtMOuUglYd4xQti/RNVahWNEUDctWkqlDnKaDBtqvGNmUshErVhMryiRLA2EZFV2Yo0vgmVcMYXDeNEOFbce9yhyjn8bCs8zFsVekOG6mr93d3DY3GpInGCWATUX25Ms1wahP/i1U6dDCYvVubI6XVr/HM= 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: nkQIcIctR+uYSCql+k2lyg== X-CSE-MsgGUID: 6nifkSgFRT+5l4F0asJwNw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 26 Nov 2025 22:05:39 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.98]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id AAB85400EF6C; Wed, 26 Nov 2025 22:05:34 +0900 (JST) From: Cosmin Tanislav To: John Madieu , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v3 9/9] arm64: dts: renesas: r9a09g087: add TSU and thermal zones support Date: Wed, 26 Nov 2025 15:03:56 +0200 Message-ID: <20251126130356.2768625-10-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251126130356.2768625-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251126130356.2768625-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 --- V3: * no changes V2: * no changes 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 64a7f94ab316..c742a67663cc 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>; @@ -955,6 +970,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.52.0