IMX8MM imx_tmu

Tim Harvey tharvey at gateworks.com
Wed Oct 14 01:39:05 CEST 2020


On Mon, Oct 12, 2020 at 1:54 PM Tim Harvey <tharvey at gateworks.com> wrote:
>
> Greetings,
>
> I'm finding that the IMX8MM TMU is not reporting valid data (valid is
> never true). I've added the tmu node into the device-tree. Is there
> any other reason you can think of for the IMX8MM tmu driver to not be
> working? I did notice the driver is quite a bit different than the
> Linux version.
>

Peng,

I see the IMX_TMU driver was added in 2cd7f47983: thermal: Add thermal
driver for i.MX8M

The commit message says users need to provide the tmu node and sensors
node in DTB - can you please provide an example? I've added the tmu
node and thermal-zones from mainline Linux (see
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=11699fd5ca3264e36dd1f5763810209412b0924d)
and the driver does not work.

I don't understand the concept of the 'zone_node' in this driver. It's
a flag that is always unconditionally enabled when bound and it seems
to me that half of the driver is dead code because of this. I find
that when zone_node is enabled 'imx_tmu_enable_msite()' never gets
called and thus monitoring never gets enabled and it is becuase of
this the temperature is never valid.

If I add a call to imx_tmu_enable_msite() as such:
@@ -442,6 +451,7 @@ static int imx_tmu_probe(struct udevice *dev)
        if (pdata->zone_node) {
                imx_tmu_init(dev);
                imx_tmu_calibration(dev);
+               imx_tmu_enable_msite(dev);
        } else {
                imx_tmu_enable_msite(dev);
        }

Now I get a valid temperature reading on my IMX8MM but get stuck in
and endless cooling loop as such:

U-Boot 2020.10-00684-gfd17cf7-dirty (Oct 13 2020 - 16:17:25 -0700)

CPU:   Freescale i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C)CPU Temperature
(37000C) has beyond alert (0C), close to critical (0C) waiting...
CPU Temperature (37000C) has beyond alert (0C), close to critical (0C)
waiting...
CPU Temperature (38000C) has beyond alert (0C), close to critical (0C)
waiting...
CPU Temperature (38000C) has beyond alert (0C), close to critical (0C)
waiting...
CPU Temperature (38000C) has beyond alert (0C), close to critical (0C)
waiting...
CPU Temperature (38000C) has beyond alert (0C), close to critical (0C)
waiting...

This would be because the device-tree was never parsed in
imx_tmu_parse_fdt() because.... zone_mode is set which skips this.

Again, I don't understand what this zone_node is about but if I
comment out the skipping of dt parsing I find that
dev_read_phandle_wiht_args(dev, "thermal-sensors",
"#thermal-sensor-cells", 0, 0, &args) returns -ENOENT meaning
'thermal-sensors' could not be found so perhaps there is still
something wrong with my dts.

Best Regards,

Tim


More information about the U-Boot mailing list