Thread (12 messages) 12 messages, 4 authors, 2025-08-19

RE: [PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu

From: Jacky Bai <ping.bai@nxp.com>
Date: 2025-08-19 02:01:55
Also in: imx, linux-devicetree, linux-pm

Subject: Re: [PATCH v3 3/4] thermal: qoriq: workaround unexpected
temperature readings from tmu
...
quoted
+	/*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.
quoted
+			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)
quoted
 	regmap_write(data->regmap, REGS_TIER, TIER_DISABLE);

 	/* Set update_interval */
-
uncessary change.
OK.
quoted
 	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)
quoted
 		regmap_write(data->regmap, REGS_V2_TEUMR(0),
GET_TEUMR0(data->drvdata));
quoted
 	}

+	/* 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
quoted
+
+	}
 	/* Disable monitoring */
 	regmap_write(data->regmap, REGS_TMR, TMR_DISABLE);  } @@
-389,6
quoted
+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
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help