Re: [PATCH v8 3/3] thermal/drivers/imx: Add calibration offset support
From: CHENG Haoning (BCSC/ENG1)
Date: Tue Jul 21 2026 - 21:44:26 EST
On 2026-07-20 10:27:33+02:00, Frieder Schrempf wrote:
> On 20.07.26 04:10, CHENG Haoning (BCSC/ENG1) wrote:
>
> > [Sie erhalten nicht h?ufig E-Mails von haoning.cheng@xxxxxxxxxxxx. Weitere Informationen, warum dies wichtig ist, finden Sie unter https://aka.ms/LearnAboutSenderIdentification ]
> >
> > On 2026-07-17 06:23:44+00:00, CHENG Haoning (BCSC/ENG1) wrote:
> > Hi Frieder,
> >
> > I need to correct my previous reply. After further discussion with our hardware team, the offset does NOT convert die temperature to package-surface temperature.
> >
> > Their thermal characterization shows that the raw TEMPMON sensor reading itself deviates from the theoretical junction temperature - this deviation exists even at the die level, before any board or package influence. The offset corrects the sensor reading toward the actual junction temperature, so it is a genuine sensor calibration.
> >
> > Board-level effects may contribute additionally, but they are not the primary reason for this feature. I apologize for the confusion - my earlier description was inaccurate. The v10 series reflects this corrected understanding.
>
> Thanks for the update. If that is the case, then I would still be
> interested to know:
>
> 1. How is the value for fsl,temp-calibration-offset-millicelsius
> determined, if it is not provided by the SoC vendor.
>
> 2. Why do we need an additional offset, if there is already a
> calibration using the value that NXP stores in the OTPs.
>
> 3. Who is supposed to set this property and where does it belong? The
> SoC dtsi, the board dts?
>
> Thanks
> Frieder
Hi Frieder,
On 1: The offset was determined during product-level thermal characterization by comparing TEMPMON readings against the junction temperature, as estimated from calibrated external measurements and a validated thermal model. A repeatable residual bias was observed. This offset compensates for that bias and does not replace the NXP factory OTP calibration.
On 2: After applying the NXP factory calibration data and vendor-provided conversion formula, a repeatable residual error remains. The offset compensates for this residual error. This correction is particularly important in the high-temperature range, where accurate trip points are most critical.
The correction must be applied consistently in the kernel to both temperature reporting and hardware alarm programming. imx_set_alarm_temp() converts a thermal trip temperature into the raw threshold value programmed into the TEMPMON hardware comparator. If the correction were applied only in userspace, the hardware IRQ threshold would not correspond to the corrected temperature scale used by the thermal framework.
On 3: The offset was determined and validated by the product integrator's hardware team during development, based on thermal characterization of representative devices. The resulting value is specified in the board DTS because it was derived and validated for this specific board/product configuration. It should not be treated as a generic correction for all i.MX6UL devices.
Thanks,
Haoning