* [PATCH v3 0/4] Update the thermal support for imx93
@ 2025-08-18 9:33 Jacky Bai
2025-08-18 9:33 ` [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string " Jacky Bai
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Jacky Bai @ 2025-08-18 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team
Cc: linux-pm, devicetree, imx, linux-arm-kernel, Jacky Bai, Alice Guo,
Peng Fan
The TMU (Thermal Monitoring Unit) on the i.MX93 requires specific
configurations and workarounds that differ from previous implementations.
So, using the 'fsl,qoriq-tmu' compatible string is not appropriate.
To address this, a dedicated compatible string and corresponding driver
changes need to be introduced to properly support the i.MX93 TMU.
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
---
Jacky Bai (4):
dt-bindings: thermal: qoriq: Add compatible string for imx93
thermal: qoriq: add i.MX93 tmu support
thermal: qoriq: workaround unexpected temperature readings from tmu
arm64: dts: imx93: update the tmu compatible string
.../devicetree/bindings/thermal/qoriq-thermal.yaml | 1 +
arch/arm64/boot/dts/freescale/imx93.dtsi | 2 +-
drivers/thermal/qoriq_thermal.c | 60 ++++++++++++++++++++--
3 files changed, 59 insertions(+), 4 deletions(-)
---
base-commit: b9ddaa95fd283bce7041550ddbbe7e764c477110
change-id: 20250804-imx93_tmu-7888c85d176e
Best regards,
--
Jacky Bai <ping.bai@nxp.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string for imx93
2025-08-18 9:33 [PATCH v3 0/4] Update the thermal support for imx93 Jacky Bai
@ 2025-08-18 9:33 ` Jacky Bai
2025-08-18 15:45 ` Frank Li
2025-08-18 17:01 ` Conor Dooley
2025-08-18 9:33 ` [PATCH v3 2/4] thermal: qoriq: add i.MX93 tmu support Jacky Bai
` (2 subsequent siblings)
3 siblings, 2 replies; 12+ messages in thread
From: Jacky Bai @ 2025-08-18 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team
Cc: linux-pm, devicetree, imx, linux-arm-kernel, Jacky Bai
Add i.MX93 compatible string 'fsl,imx93-tmu' because Thermal monitor
unit(TMU) on i.MX93 has differences with QorIQ platform and not fully
compatible with existing Platform, such as fsl,qoriq-tmu.
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
---
- v3 changes:
- refine the commit log
- drop the compatible fallback support
- v2 changes:
- keep the enum
- refine the commit log to use i.MX93 and QorIQ name
---
Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml b/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml
index aa756dae512a2c6e3f0b6bb1ab4a65c01e373ea7..f3b136f5e1cba1fff7e90678d7e3d7ec3ddd25c1 100644
--- a/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml
+++ b/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml
@@ -25,6 +25,7 @@ properties:
enum:
- fsl,qoriq-tmu
- fsl,imx8mq-tmu
+ - fsl,imx93-tmu
reg:
maxItems: 1
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/4] thermal: qoriq: add i.MX93 tmu support
2025-08-18 9:33 [PATCH v3 0/4] Update the thermal support for imx93 Jacky Bai
2025-08-18 9:33 ` [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string " Jacky Bai
@ 2025-08-18 9:33 ` Jacky Bai
2025-08-18 15:48 ` Frank Li
2025-08-18 9:33 ` [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu Jacky Bai
2025-08-18 9:33 ` [PATCH v3 4/4] arm64: dts: imx93: update the tmu compatible string Jacky Bai
3 siblings, 1 reply; 12+ messages in thread
From: Jacky Bai @ 2025-08-18 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team
Cc: linux-pm, devicetree, imx, linux-arm-kernel, Jacky Bai, Alice Guo
For Thermal monitor unit(TMU) used on i.MX93, the HW revision info read
from the ID register is the same the one used on some of the QorIQ
platform, but the config has some slight differance. Add i.MX93 compatible
string and corresponding code for it.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
---
- v3 changes:
- use the drv data struct for match data and refine the code
- update the copyright
- v2 changes:
- use the compatible match data to identify the i.MX93 TMU variant
---
drivers/thermal/qoriq_thermal.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 01b58be0dcc64d14ca5e4bba654eed8f15e827fc..b2e634547271dcf512c714907baa162921d2d527 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
//
// Copyright 2016 Freescale Semiconductor, Inc.
+// Copyright 2025 NXP
#include <linux/clk.h>
#include <linux/err.h>
@@ -24,6 +25,7 @@
#define TMTMIR_DEFAULT 0x0000000f
#define TIER_DISABLE 0x0
#define TEUMR0_V2 0x51009c00
+#define TEUMR0_V21 0x55000c00
#define TMSARA_V2 0xe
#define TMU_VER1 0x1
#define TMU_VER2 0x2
@@ -66,6 +68,8 @@
*/
#define REGS_V2_TEUMR(n) (0xf00 + 4 * (n))
+#define GET_TEUMR0(drvdata) (drvdata && drvdata->teumr0 ? drvdata->teumr0 : TEUMR0_V2)
+
/*
* Thermal zone data
*/
@@ -73,12 +77,17 @@ struct qoriq_sensor {
int id;
};
+struct tmu_drvdata {
+ u32 teumr0;
+};
+
struct qoriq_tmu_data {
int ver;
u32 ttrcr[NUM_TTRCR_MAX];
struct regmap *regmap;
struct clk *clk;
struct qoriq_sensor sensor[SITES_MAX];
+ const struct tmu_drvdata *drvdata;
};
static struct qoriq_tmu_data *qoriq_sensor_to_data(struct qoriq_sensor *s)
@@ -234,7 +243,7 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
regmap_write(data->regmap, REGS_TMTMIR, TMTMIR_DEFAULT);
} else {
regmap_write(data->regmap, REGS_V2_TMTMIR, TMTMIR_DEFAULT);
- regmap_write(data->regmap, REGS_V2_TEUMR(0), TEUMR0_V2);
+ regmap_write(data->regmap, REGS_V2_TEUMR(0), GET_TEUMR0(data->drvdata));
}
/* Disable monitoring */
@@ -319,6 +328,8 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
data->ver = (ver >> 8) & 0xff;
+ data->drvdata = of_device_get_match_data(&pdev->dev);
+
qoriq_tmu_init_device(data); /* TMU initialization */
ret = qoriq_tmu_calibration(dev, data); /* TMU calibration */
@@ -376,9 +387,14 @@ static int qoriq_tmu_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
qoriq_tmu_suspend, qoriq_tmu_resume);
+static const struct tmu_drvdata imx93_data = {
+ .teumr0 = TEUMR0_V21,
+};
+
static const struct of_device_id qoriq_tmu_match[] = {
{ .compatible = "fsl,qoriq-tmu", },
{ .compatible = "fsl,imx8mq-tmu", },
+ { .compatible = "fsl,imx93-tmu", .data = &imx93_data },
{},
};
MODULE_DEVICE_TABLE(of, qoriq_tmu_match);
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu
2025-08-18 9:33 [PATCH v3 0/4] Update the thermal support for imx93 Jacky Bai
2025-08-18 9:33 ` [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string " Jacky Bai
2025-08-18 9:33 ` [PATCH v3 2/4] thermal: qoriq: add i.MX93 tmu support Jacky Bai
@ 2025-08-18 9:33 ` Jacky Bai
2025-08-18 15:51 ` Frank Li
2025-08-19 4:38 ` kernel test robot
2025-08-18 9:33 ` [PATCH v3 4/4] arm64: dts: imx93: update the tmu compatible string Jacky Bai
3 siblings, 2 replies; 12+ messages in thread
From: Jacky Bai @ 2025-08-18 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team
Cc: linux-pm, devicetree, imx, linux-arm-kernel, Jacky Bai
Invalid temperature measurements may be observed across the temperature
range specified in the device data sheet. The invalid temperature can be
read from any remote site and from any capture or report registers. The
invalid change in temperature can be positive or negative and the resulting
temperature can be outside the calibrated range, in which case the TSR[ORL]
or TSR[ORH] bit will be set.
Workaround:
Use the raising/falling edge threshold to filter out the invalid temp.
Check the TIDR register to make sure no jump happens When reading the temp.
i.MX93 ERR052243:
(https://www.nxp.com/webapp/Download?colCode=IMX93_2P87F&appType=license)
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
---
- v3 changes:
- refine the code with FIELD_PREP macro
- add errata doc url link and refine the commit log
- v2 changes:
- no
---
drivers/thermal/qoriq_thermal.c | 42 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index b2e634547271dcf512c714907baa162921d2d527..134a63abb482d44b5cc78e672e6312fbdce5ba31 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -30,6 +30,9 @@
#define TMU_VER1 0x1
#define TMU_VER2 0x2
+/* errata ID info define */
+#define TMU_ERR052243 BIT(0)
+
#define REGS_TMR 0x000 /* Mode Register */
#define TMR_DISABLE 0x0
#define TMR_ME 0x80000000
@@ -45,6 +48,13 @@
#define REGS_TIER 0x020 /* Interrupt Enable Register */
#define TIER_DISABLE 0x0
+#define REGS_TIDR 0x24
+#define TMRTRCTR 0x70
+#define TMRTRCTR_EN BIT(31)
+#define TMRTRCTR_TEMP_MASK GENMASK(7, 0)
+#define TMFTRCTR 0x74
+#define TMFTRCTR_EN BIT(31)
+#define TMFTRCTR_TEMP_MASK GENMASK(7, 0)
#define REGS_TTCFGR 0x080 /* Temperature Configuration Register */
#define REGS_TSCFGR 0x084 /* Sensor Configuration Register */
@@ -69,6 +79,7 @@
#define REGS_V2_TEUMR(n) (0xf00 + 4 * (n))
#define GET_TEUMR0(drvdata) (drvdata && drvdata->teumr0 ? drvdata->teumr0 : TEUMR0_V2)
+#define CHECK_ERRATA_FLAG(drvdata, flag) (drvdata ? drvdata->tmu_errata & (flag) : 0)
/*
* Thermal zone data
@@ -79,6 +90,7 @@ struct qoriq_sensor {
struct tmu_drvdata {
u32 teumr0;
+ u32 tmu_errata;
};
struct qoriq_tmu_data {
@@ -99,7 +111,7 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
{
struct qoriq_sensor *qsensor = thermal_zone_device_priv(tz);
struct qoriq_tmu_data *qdata = qoriq_sensor_to_data(qsensor);
- u32 val;
+ u32 val, tidr;
/*
* REGS_TRITSR(id) has the following layout:
*
@@ -124,6 +136,15 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
if (!(val & TMR_ME))
return -EAGAIN;
+ /* ERR052243: If a raising or falling edge happens, try later */
+ if (CHECK_ERRATA_FLAG(qdata->drvdata, TMU_ERR052243)) {
+ regmap_read(qdata->regmap, REGS_TIDR, &tidr);
+ if (tidr & GENMASK(25, 24)) {
+ regmap_write(qdata->regmap, REGS_TIDR, GENMASK(25, 24));
+ return -EAGAIN;
+ }
+ }
+
if (regmap_read_poll_timeout(qdata->regmap,
REGS_TRITSR(qsensor->id),
val,
@@ -132,6 +153,15 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
10 * USEC_PER_MSEC))
return -ENODATA;
+ /*ERR052243: If a raising or falling edge happens, try later */
+ if (CHECK_ERRATA_FLAG(qdata->drvdata, TMU_ERR052243)) {
+ regmap_read(qdata->regmap, REGS_TIDR, &tidr);
+ if (tidr & GENMASK(25, 24)) {
+ regmap_write(qdata->regmap, REGS_TIDR, GENMASK(25, 24));
+ return -EAGAIN;
+ }
+ }
+
if (qdata->ver == TMU_VER1) {
*temp = (val & GENMASK(7, 0)) * MILLIDEGREE_PER_DEGREE;
} else {
@@ -238,7 +268,6 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
regmap_write(data->regmap, REGS_TIER, TIER_DISABLE);
/* Set update_interval */
-
if (data->ver == TMU_VER1) {
regmap_write(data->regmap, REGS_TMTMIR, TMTMIR_DEFAULT);
} else {
@@ -246,6 +275,14 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
regmap_write(data->regmap, REGS_V2_TEUMR(0), GET_TEUMR0(data->drvdata));
}
+ /* ERR052243: Set the raising & falling edge monitor */
+ if (CHECK_ERRATA_FLAG(data->drvdata, TMU_ERR052243)) {
+ regmap_write(data->regmap, TMRTRCTR, TMRTRCTR_EN |
+ FIELD_PREP(TMRTRCTR_TEMP_MASK, 0x7));
+ regmap_write(data->regmap, TMFTRCTR, TMFTRCTR_EN |
+ FIELD_PREP(TMFTRCTR_TEMP_MASK, 0x7));
+
+ }
/* Disable monitoring */
regmap_write(data->regmap, REGS_TMR, TMR_DISABLE);
}
@@ -389,6 +426,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
static const struct tmu_drvdata imx93_data = {
.teumr0 = TEUMR0_V21,
+ .tmu_errata = TMU_ERR052243,
};
static const struct of_device_id qoriq_tmu_match[] = {
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 4/4] arm64: dts: imx93: update the tmu compatible string
2025-08-18 9:33 [PATCH v3 0/4] Update the thermal support for imx93 Jacky Bai
` (2 preceding siblings ...)
2025-08-18 9:33 ` [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu Jacky Bai
@ 2025-08-18 9:33 ` Jacky Bai
2025-08-18 15:51 ` Frank Li
3 siblings, 1 reply; 12+ messages in thread
From: Jacky Bai @ 2025-08-18 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team
Cc: linux-pm, devicetree, imx, linux-arm-kernel, Jacky Bai, Peng Fan
The i.MX93 TMU node compatible need to be updated to apply the SoC
specific configuration and TMU errata workaround.
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
- v3 changes:
- drop the qoriq compatible
- v2 changes:
- no
---
arch/arm64/boot/dts/freescale/imx93.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi
index 8a7f1cd76c766ab558acf5176022a4c42e648548..8ae9a81678bd37f394b437f1dd6ebe67cd1ce439 100644
--- a/arch/arm64/boot/dts/freescale/imx93.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx93.dtsi
@@ -544,7 +544,7 @@ clock-controller@44480000 {
};
tmu: tmu@44482000 {
- compatible = "fsl,qoriq-tmu";
+ compatible = "fsl,imx93-tmu";
reg = <0x44482000 0x1000>;
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX93_CLK_TMC_GATE>;
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string for imx93
2025-08-18 9:33 ` [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string " Jacky Bai
@ 2025-08-18 15:45 ` Frank Li
2025-08-18 17:01 ` Conor Dooley
1 sibling, 0 replies; 12+ messages in thread
From: Frank Li @ 2025-08-18 15:45 UTC (permalink / raw)
To: Jacky Bai
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team, linux-pm,
devicetree, imx, linux-arm-kernel
On Mon, Aug 18, 2025 at 05:33:11PM +0800, Jacky Bai wrote:
> Add i.MX93 compatible string 'fsl,imx93-tmu' because Thermal monitor
> unit(TMU) on i.MX93 has differences with QorIQ platform and not fully
> compatible with existing Platform, such as fsl,qoriq-tmu.
>
> Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> - v3 changes:
> - refine the commit log
> - drop the compatible fallback support
>
> - v2 changes:
> - keep the enum
> - refine the commit log to use i.MX93 and QorIQ name
> ---
> Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml b/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml
> index aa756dae512a2c6e3f0b6bb1ab4a65c01e373ea7..f3b136f5e1cba1fff7e90678d7e3d7ec3ddd25c1 100644
> --- a/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml
> +++ b/Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml
> @@ -25,6 +25,7 @@ properties:
> enum:
> - fsl,qoriq-tmu
> - fsl,imx8mq-tmu
> + - fsl,imx93-tmu
>
> reg:
> maxItems: 1
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] thermal: qoriq: add i.MX93 tmu support
2025-08-18 9:33 ` [PATCH v3 2/4] thermal: qoriq: add i.MX93 tmu support Jacky Bai
@ 2025-08-18 15:48 ` Frank Li
0 siblings, 0 replies; 12+ messages in thread
From: Frank Li @ 2025-08-18 15:48 UTC (permalink / raw)
To: Jacky Bai
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team, linux-pm,
devicetree, imx, linux-arm-kernel, Alice Guo
On Mon, Aug 18, 2025 at 05:33:12PM +0800, Jacky Bai wrote:
> For Thermal monitor unit(TMU) used on i.MX93, the HW revision info read
> from the ID register is the same the one used on some of the QorIQ
> platform, but the config has some slight differance. Add i.MX93 compatible
> string and corresponding code for it.
>
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> - v3 changes:
> - use the drv data struct for match data and refine the code
> - update the copyright
>
> - v2 changes:
> - use the compatible match data to identify the i.MX93 TMU variant
> ---
> drivers/thermal/qoriq_thermal.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
> index 01b58be0dcc64d14ca5e4bba654eed8f15e827fc..b2e634547271dcf512c714907baa162921d2d527 100644
> --- a/drivers/thermal/qoriq_thermal.c
> +++ b/drivers/thermal/qoriq_thermal.c
> @@ -1,6 +1,7 @@
> // SPDX-License-Identifier: GPL-2.0
> //
> // Copyright 2016 Freescale Semiconductor, Inc.
> +// Copyright 2025 NXP
>
> #include <linux/clk.h>
> #include <linux/err.h>
> @@ -24,6 +25,7 @@
> #define TMTMIR_DEFAULT 0x0000000f
> #define TIER_DISABLE 0x0
> #define TEUMR0_V2 0x51009c00
> +#define TEUMR0_V21 0x55000c00
> #define TMSARA_V2 0xe
> #define TMU_VER1 0x1
> #define TMU_VER2 0x2
> @@ -66,6 +68,8 @@
> */
> #define REGS_V2_TEUMR(n) (0xf00 + 4 * (n))
>
> +#define GET_TEUMR0(drvdata) (drvdata && drvdata->teumr0 ? drvdata->teumr0 : TEUMR0_V2)
> +
> /*
> * Thermal zone data
> */
> @@ -73,12 +77,17 @@ struct qoriq_sensor {
> int id;
> };
>
> +struct tmu_drvdata {
> + u32 teumr0;
> +};
> +
> struct qoriq_tmu_data {
> int ver;
> u32 ttrcr[NUM_TTRCR_MAX];
> struct regmap *regmap;
> struct clk *clk;
> struct qoriq_sensor sensor[SITES_MAX];
> + const struct tmu_drvdata *drvdata;
> };
>
> static struct qoriq_tmu_data *qoriq_sensor_to_data(struct qoriq_sensor *s)
> @@ -234,7 +243,7 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
> regmap_write(data->regmap, REGS_TMTMIR, TMTMIR_DEFAULT);
> } else {
> regmap_write(data->regmap, REGS_V2_TMTMIR, TMTMIR_DEFAULT);
> - regmap_write(data->regmap, REGS_V2_TEUMR(0), TEUMR0_V2);
> + regmap_write(data->regmap, REGS_V2_TEUMR(0), GET_TEUMR0(data->drvdata));
> }
>
> /* Disable monitoring */
> @@ -319,6 +328,8 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
>
> data->ver = (ver >> 8) & 0xff;
>
> + data->drvdata = of_device_get_match_data(&pdev->dev);
> +
> qoriq_tmu_init_device(data); /* TMU initialization */
>
> ret = qoriq_tmu_calibration(dev, data); /* TMU calibration */
> @@ -376,9 +387,14 @@ static int qoriq_tmu_resume(struct device *dev)
> static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
> qoriq_tmu_suspend, qoriq_tmu_resume);
>
> +static const struct tmu_drvdata imx93_data = {
> + .teumr0 = TEUMR0_V21,
> +};
> +
> static const struct of_device_id qoriq_tmu_match[] = {
> { .compatible = "fsl,qoriq-tmu", },
> { .compatible = "fsl,imx8mq-tmu", },
> + { .compatible = "fsl,imx93-tmu", .data = &imx93_data },
> {},
> };
> MODULE_DEVICE_TABLE(of, qoriq_tmu_match);
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu
2025-08-18 9:33 ` [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu Jacky Bai
@ 2025-08-18 15:51 ` Frank Li
2025-08-19 2:01 ` Jacky Bai
2025-08-19 4:38 ` kernel test robot
1 sibling, 1 reply; 12+ messages in thread
From: Frank Li @ 2025-08-18 15:51 UTC (permalink / raw)
To: Jacky Bai
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team, linux-pm,
devicetree, imx, linux-arm-kernel
On Mon, Aug 18, 2025 at 05:33:13PM +0800, Jacky Bai wrote:
> Invalid temperature measurements may be observed across the temperature
> range specified in the device data sheet. The invalid temperature can be
> read from any remote site and from any capture or report registers. The
> invalid change in temperature can be positive or negative and the resulting
> temperature can be outside the calibrated range, in which case the TSR[ORL]
> or TSR[ORH] bit will be set.
>
> Workaround:
> Use the raising/falling edge threshold to filter out the invalid temp.
> Check the TIDR register to make sure no jump happens When reading the temp.
>
> i.MX93 ERR052243:
> (https://www.nxp.com/webapp/Download?colCode=IMX93_2P87F&appType=license)
>
> Signed-off-by: Jacky Bai <ping.bai@nxp.com>
> ---
> - v3 changes:
> - refine the code with FIELD_PREP macro
> - add errata doc url link and refine the commit log
>
> - v2 changes:
> - no
> ---
> drivers/thermal/qoriq_thermal.c | 42 +++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 40 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
> index b2e634547271dcf512c714907baa162921d2d527..134a63abb482d44b5cc78e672e6312fbdce5ba31 100644
> --- a/drivers/thermal/qoriq_thermal.c
> +++ b/drivers/thermal/qoriq_thermal.c
> @@ -30,6 +30,9 @@
> #define TMU_VER1 0x1
> #define TMU_VER2 0x2
>
> +/* errata ID info define */
> +#define TMU_ERR052243 BIT(0)
> +
> #define REGS_TMR 0x000 /* Mode Register */
> #define TMR_DISABLE 0x0
> #define TMR_ME 0x80000000
> @@ -45,6 +48,13 @@
> #define REGS_TIER 0x020 /* Interrupt Enable Register */
> #define TIER_DISABLE 0x0
>
> +#define REGS_TIDR 0x24
> +#define TMRTRCTR 0x70
> +#define TMRTRCTR_EN BIT(31)
> +#define TMRTRCTR_TEMP_MASK GENMASK(7, 0)
> +#define TMFTRCTR 0x74
> +#define TMFTRCTR_EN BIT(31)
> +#define TMFTRCTR_TEMP_MASK GENMASK(7, 0)
>
> #define REGS_TTCFGR 0x080 /* Temperature Configuration Register */
> #define REGS_TSCFGR 0x084 /* Sensor Configuration Register */
> @@ -69,6 +79,7 @@
> #define REGS_V2_TEUMR(n) (0xf00 + 4 * (n))
>
> #define GET_TEUMR0(drvdata) (drvdata && drvdata->teumr0 ? drvdata->teumr0 : TEUMR0_V2)
> +#define CHECK_ERRATA_FLAG(drvdata, flag) (drvdata ? drvdata->tmu_errata & (flag) : 0)
>
> /*
> * Thermal zone data
> @@ -79,6 +90,7 @@ struct qoriq_sensor {
>
> struct tmu_drvdata {
> u32 teumr0;
> + u32 tmu_errata;
> };
>
> struct qoriq_tmu_data {
> @@ -99,7 +111,7 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
> {
> struct qoriq_sensor *qsensor = thermal_zone_device_priv(tz);
> struct qoriq_tmu_data *qdata = qoriq_sensor_to_data(qsensor);
> - u32 val;
> + u32 val, tidr;
> /*
> * REGS_TRITSR(id) has the following layout:
> *
> @@ -124,6 +136,15 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
> if (!(val & TMR_ME))
> return -EAGAIN;
>
> + /* ERR052243: If a raising or falling edge happens, try later */
> + if (CHECK_ERRATA_FLAG(qdata->drvdata, TMU_ERR052243)) {
> + regmap_read(qdata->regmap, REGS_TIDR, &tidr);
> + if (tidr & GENMASK(25, 24)) {
> + regmap_write(qdata->regmap, REGS_TIDR, GENMASK(25, 24));
> + return -EAGAIN;
> + }
> + }
> +
> if (regmap_read_poll_timeout(qdata->regmap,
> REGS_TRITSR(qsensor->id),
> val,
> @@ -132,6 +153,15 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
> 10 * USEC_PER_MSEC))
> return -ENODATA;
>
> + /*ERR052243: If a raising or falling edge happens, try later */
> + if (CHECK_ERRATA_FLAG(qdata->drvdata, TMU_ERR052243)) {
> + regmap_read(qdata->regmap, REGS_TIDR, &tidr);
> + if (tidr & GENMASK(25, 24)) {
you use GENMASK(25, 24) twice, define it as macro.
> + regmap_write(qdata->regmap, REGS_TIDR, GENMASK(25, 24));
> + return -EAGAIN;
> + }
> + }
> +
> if (qdata->ver == TMU_VER1) {
> *temp = (val & GENMASK(7, 0)) * MILLIDEGREE_PER_DEGREE;
> } else {
> @@ -238,7 +268,6 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
> regmap_write(data->regmap, REGS_TIER, TIER_DISABLE);
>
> /* Set update_interval */
> -
uncessary change.
> if (data->ver == TMU_VER1) {
> regmap_write(data->regmap, REGS_TMTMIR, TMTMIR_DEFAULT);
> } else {
> @@ -246,6 +275,14 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
> regmap_write(data->regmap, REGS_V2_TEUMR(0), GET_TEUMR0(data->drvdata));
> }
>
> + /* ERR052243: Set the raising & falling edge monitor */
> + if (CHECK_ERRATA_FLAG(data->drvdata, TMU_ERR052243)) {
> + regmap_write(data->regmap, TMRTRCTR, TMRTRCTR_EN |
> + FIELD_PREP(TMRTRCTR_TEMP_MASK, 0x7));
> + regmap_write(data->regmap, TMFTRCTR, TMFTRCTR_EN |
> + FIELD_PREP(TMFTRCTR_TEMP_MASK, 0x7));
the same here for 0x7
Frank
> +
> + }
> /* Disable monitoring */
> regmap_write(data->regmap, REGS_TMR, TMR_DISABLE);
> }
> @@ -389,6 +426,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
>
> static const struct tmu_drvdata imx93_data = {
> .teumr0 = TEUMR0_V21,
> + .tmu_errata = TMU_ERR052243,
> };
>
> static const struct of_device_id qoriq_tmu_match[] = {
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 4/4] arm64: dts: imx93: update the tmu compatible string
2025-08-18 9:33 ` [PATCH v3 4/4] arm64: dts: imx93: update the tmu compatible string Jacky Bai
@ 2025-08-18 15:51 ` Frank Li
0 siblings, 0 replies; 12+ messages in thread
From: Frank Li @ 2025-08-18 15:51 UTC (permalink / raw)
To: Jacky Bai
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team, linux-pm,
devicetree, imx, linux-arm-kernel, Peng Fan
On Mon, Aug 18, 2025 at 05:33:14PM +0800, Jacky Bai wrote:
> The i.MX93 TMU node compatible need to be updated to apply the SoC
> specific configuration and TMU errata workaround.
>
> Signed-off-by: Jacky Bai <ping.bai@nxp.com>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> - v3 changes:
> - drop the qoriq compatible
>
> - v2 changes:
> - no
> ---
> arch/arm64/boot/dts/freescale/imx93.dtsi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi
> index 8a7f1cd76c766ab558acf5176022a4c42e648548..8ae9a81678bd37f394b437f1dd6ebe67cd1ce439 100644
> --- a/arch/arm64/boot/dts/freescale/imx93.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx93.dtsi
> @@ -544,7 +544,7 @@ clock-controller@44480000 {
> };
>
> tmu: tmu@44482000 {
> - compatible = "fsl,qoriq-tmu";
> + compatible = "fsl,imx93-tmu";
> reg = <0x44482000 0x1000>;
> interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&clk IMX93_CLK_TMC_GATE>;
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string for imx93
2025-08-18 9:33 ` [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string " Jacky Bai
2025-08-18 15:45 ` Frank Li
@ 2025-08-18 17:01 ` Conor Dooley
1 sibling, 0 replies; 12+ messages in thread
From: Conor Dooley @ 2025-08-18 17:01 UTC (permalink / raw)
To: Jacky Bai
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team, linux-pm,
devicetree, imx, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 53 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu
2025-08-18 15:51 ` Frank Li
@ 2025-08-19 2:01 ` Jacky Bai
0 siblings, 0 replies; 12+ messages in thread
From: Jacky Bai @ 2025-08-19 2:01 UTC (permalink / raw)
To: Frank Li
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH v3 3/4] thermal: qoriq: workaround unexpected
> temperature readings from tmu
>
...
> >
> > + /*ERR052243: If a raising or falling edge happens, try later */
> > + if (CHECK_ERRATA_FLAG(qdata->drvdata, TMU_ERR052243)) {
> > + regmap_read(qdata->regmap, REGS_TIDR, &tidr);
> > + if (tidr & GENMASK(25, 24)) {
>
> you use GENMASK(25, 24) twice, define it as macro.
OK.
>
> > + regmap_write(qdata->regmap, REGS_TIDR, GENMASK(25, 24));
> > + return -EAGAIN;
> > + }
> > + }
> > +
> > if (qdata->ver == TMU_VER1) {
> > *temp = (val & GENMASK(7, 0)) * MILLIDEGREE_PER_DEGREE;
> > } else {
> > @@ -238,7 +268,6 @@ static void qoriq_tmu_init_device(struct
> qoriq_tmu_data *data)
> > regmap_write(data->regmap, REGS_TIER, TIER_DISABLE);
> >
> > /* Set update_interval */
> > -
>
> uncessary change.
OK.
>
> > if (data->ver == TMU_VER1) {
> > regmap_write(data->regmap, REGS_TMTMIR, TMTMIR_DEFAULT);
> > } else {
> > @@ -246,6 +275,14 @@ static void qoriq_tmu_init_device(struct
> qoriq_tmu_data *data)
> > regmap_write(data->regmap, REGS_V2_TEUMR(0),
> GET_TEUMR0(data->drvdata));
> > }
> >
> > + /* ERR052243: Set the raising & falling edge monitor */
> > + if (CHECK_ERRATA_FLAG(data->drvdata, TMU_ERR052243)) {
> > + regmap_write(data->regmap, TMRTRCTR, TMRTRCTR_EN |
> > + FIELD_PREP(TMRTRCTR_TEMP_MASK, 0x7));
> > + regmap_write(data->regmap, TMFTRCTR, TMFTRCTR_EN |
> > + FIELD_PREP(TMFTRCTR_TEMP_MASK, 0x7));
>
> the same here for 0x7
>
OK, will define it as a macro.
BR
> Frank
> > +
> > + }
> > /* Disable monitoring */
> > regmap_write(data->regmap, REGS_TMR, TMR_DISABLE); } @@
> -389,6
> > +426,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
> >
> > static const struct tmu_drvdata imx93_data = {
> > .teumr0 = TEUMR0_V21,
> > + .tmu_errata = TMU_ERR052243,
> > };
> >
> > static const struct of_device_id qoriq_tmu_match[] = {
> >
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu
2025-08-18 9:33 ` [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu Jacky Bai
2025-08-18 15:51 ` Frank Li
@ 2025-08-19 4:38 ` kernel test robot
1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2025-08-19 4:38 UTC (permalink / raw)
To: Jacky Bai, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Fabio Estevam, Pengutronix Kernel Team
Cc: llvm, oe-kbuild-all, linux-pm, devicetree, imx, linux-arm-kernel,
Jacky Bai
Hi Jacky,
kernel test robot noticed the following build errors:
[auto build test ERROR on b9ddaa95fd283bce7041550ddbbe7e764c477110]
url: https://github.com/intel-lab-lkp/linux/commits/Jacky-Bai/dt-bindings-thermal-qoriq-Add-compatible-string-for-imx93/20250818-173822
base: b9ddaa95fd283bce7041550ddbbe7e764c477110
patch link: https://lore.kernel.org/r/20250818-imx93_tmu-v3-3-35f79a86c072%40nxp.com
patch subject: [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu
config: riscv-randconfig-001-20250819 (https://download.01.org/0day-ci/archive/20250819/202508191258.tYXB63eu-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 93d24b6b7b148c47a2fa228a4ef31524fa1d9f3f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250819/202508191258.tYXB63eu-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508191258.tYXB63eu-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/thermal/qoriq_thermal.c:8:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:804:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
804 | insb(addr, buffer, count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:104:53: note: expanded from macro 'insb'
104 | #define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count)
| ~~~~~~~~~~ ^
In file included from drivers/thermal/qoriq_thermal.c:8:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:812:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
812 | insw(addr, buffer, count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:105:53: note: expanded from macro 'insw'
105 | #define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count)
| ~~~~~~~~~~ ^
In file included from drivers/thermal/qoriq_thermal.c:8:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:820:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
820 | insl(addr, buffer, count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl'
106 | #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
| ~~~~~~~~~~ ^
In file included from drivers/thermal/qoriq_thermal.c:8:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:829:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
829 | outsb(addr, buffer, count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:118:55: note: expanded from macro 'outsb'
118 | #define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count)
| ~~~~~~~~~~ ^
In file included from drivers/thermal/qoriq_thermal.c:8:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:838:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
838 | outsw(addr, buffer, count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:119:55: note: expanded from macro 'outsw'
119 | #define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count)
| ~~~~~~~~~~ ^
In file included from drivers/thermal/qoriq_thermal.c:8:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:847:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
847 | outsl(addr, buffer, count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl'
120 | #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)
| ~~~~~~~~~~ ^
In file included from drivers/thermal/qoriq_thermal.c:8:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:1175:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1175 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^
>> drivers/thermal/qoriq_thermal.c:281:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
281 | FIELD_PREP(TMRTRCTR_TEMP_MASK, 0x7));
| ^
7 warnings and 1 error generated.
vim +/FIELD_PREP +281 drivers/thermal/qoriq_thermal.c
264
265 static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
266 {
267 /* Disable interrupt, using polling instead */
268 regmap_write(data->regmap, REGS_TIER, TIER_DISABLE);
269
270 /* Set update_interval */
271 if (data->ver == TMU_VER1) {
272 regmap_write(data->regmap, REGS_TMTMIR, TMTMIR_DEFAULT);
273 } else {
274 regmap_write(data->regmap, REGS_V2_TMTMIR, TMTMIR_DEFAULT);
275 regmap_write(data->regmap, REGS_V2_TEUMR(0), GET_TEUMR0(data->drvdata));
276 }
277
278 /* ERR052243: Set the raising & falling edge monitor */
279 if (CHECK_ERRATA_FLAG(data->drvdata, TMU_ERR052243)) {
280 regmap_write(data->regmap, TMRTRCTR, TMRTRCTR_EN |
> 281 FIELD_PREP(TMRTRCTR_TEMP_MASK, 0x7));
282 regmap_write(data->regmap, TMFTRCTR, TMFTRCTR_EN |
283 FIELD_PREP(TMFTRCTR_TEMP_MASK, 0x7));
284
285 }
286 /* Disable monitoring */
287 regmap_write(data->regmap, REGS_TMR, TMR_DISABLE);
288 }
289
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-08-19 4:38 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 9:33 [PATCH v3 0/4] Update the thermal support for imx93 Jacky Bai
2025-08-18 9:33 ` [PATCH v3 1/4] dt-bindings: thermal: qoriq: Add compatible string " Jacky Bai
2025-08-18 15:45 ` Frank Li
2025-08-18 17:01 ` Conor Dooley
2025-08-18 9:33 ` [PATCH v3 2/4] thermal: qoriq: add i.MX93 tmu support Jacky Bai
2025-08-18 15:48 ` Frank Li
2025-08-18 9:33 ` [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu Jacky Bai
2025-08-18 15:51 ` Frank Li
2025-08-19 2:01 ` Jacky Bai
2025-08-19 4:38 ` kernel test robot
2025-08-18 9:33 ` [PATCH v3 4/4] arm64: dts: imx93: update the tmu compatible string Jacky Bai
2025-08-18 15:51 ` Frank Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).