thermal/drivers/imx: Add support for loading calibration data from OCOTP
authorMarek Vasut <marex@denx.de>
Fri, 2 Dec 2022 16:23:53 +0000 (17:23 +0100)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Wed, 14 Dec 2022 14:25:40 +0000 (15:25 +0100)
commit403291648823f819f7baaccd47589fcf87187c32
tree0770723c1bb9abebdf6d25bf94b2e0a97da1aa4b
parent8848c0d7a0782c263a7827697d5acfcc09a19a5f
thermal/drivers/imx: Add support for loading calibration data from OCOTP

The TMU TASR, TCALIVn, TRIM registers must be explicitly programmed with
calibration values in OCOTP. Add support for reading the OCOTP calibration
data and programming those into the TMU hardware.

The MX8MM/MX8MN TMUv1 uses only one OCOTP cell, while MX8MP TMUv2 uses 4,
the programming differs in each case.

Based on U-Boot commits:
70487ff386c ("imx8mm: Load fuse for TMU TCALIV and TASR")
ebb9aab318b ("imx: load calibration parameters from fuse for i.MX8MP")

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
drivers/thermal/imx8mm_thermal.c