Bug 58551

Summary: [pandaboard] omap4 thermal/bandgap not working
Product: Power Management Reporter: Tobias Jakobi (liquid.acid)
Component: ThermalAssignee: Eduardo Valentin (eduardo.valentin)
Status: CLOSED INVALID    
Severity: normal CC: eduardo.valentin, lenb, nm
Priority: P1    
Hardware: ARM   
OS: Linux   
Kernel Version: 3.9.3 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg output after boot
kernel config
serial output (boot log with dtb)

Description Tobias Jakobi 2013-05-20 14:36:59 UTC
Created attachment 102071 [details]
dmesg output after boot

Hello,

the omap4 thermal/bandgap sensor code doesn't seem to work on my Pandaboard ES (OMAP4460). All necessary stuff in the kernel config should be on, but there is nothing in /sys/class/thermal/ -- also nothing about bandgap or thermal in /sys/devices/platform/

Greets,
Tobias
Comment 1 Tobias Jakobi 2013-05-20 14:37:20 UTC
Created attachment 102081 [details]
kernel config
Comment 2 Jean Delvare 2013-05-20 15:59:12 UTC
Seems to be about thermal, not hwmon, so nothing I can help with.

Rui, it would be good to have a bugzilla component created for thermal drivers.
Comment 3 Zhang Rui 2013-05-20 16:17:54 UTC
(In reply to comment #2)
> Seems to be about thermal, not hwmon, so nothing I can help with.
> 
> Rui, it would be good to have a bugzilla component created for thermal
> drivers.

yes, we have one. Power Management->Thermal.
bug re-assigned.
Comment 4 Tobias Jakobi 2013-05-20 16:34:17 UTC
Thanks for reassigning!
Comment 5 Eduardo Valentin 2013-05-20 21:09:01 UTC
Tobias,

Can you please check if you have the bandgap device on your device tree blob?

This driver is DT only.

Tks,
Comment 6 Tobias Jakobi 2013-05-20 21:24:46 UTC
How would I do that? I understand it has something to do with the bootloader?

I use u-boot git from upstream. The kernel image is created via:
make LOADADDR=0x80008000 uImage

I then just copy the image to /boot

The boot script:
fatload mmc 0 0x80300000 uImage-3.9.3
setenv bootargs ro rootfstype=ext4 elevator=noop console=ttyO2,115200n8 mem=1G@0x80000000 init=/sbin/init root=/dev/mmcblk0p2 rootwait fixrtc
bootm 80300000
Comment 7 Tobias Jakobi 2013-05-20 22:48:40 UTC
Created attachment 102131 [details]
serial output (boot log with dtb)

OK, so I build the dtb file via:
make omap4-panda-es.dtb

...and then also put it into /boot

New bootscript looks like this:
fatload mmc 0 0x80200000 uImage-3.9.3
fatload mmc 0 0x815f0000 omap4-panda-es-3.9.3.dtb
setenv bootargs ro rootfstype=ext4 elevator=noop console=ttyO2,115200n8
mem=1G@0x80000000 init=/sbin/init root=/dev/mmcblk0p2 rootwait fixrtc
bootm 0x80200000 - 0x815f0000

The board boots that way, but the process soon hangs. Also e.g. the UARTs are not detected anymore. I attached what I got via serial debug.

Really don't know if I'm going the right way.
Comment 8 Eduardo Valentin 2013-05-21 01:35:22 UTC
OK. You have to configure your u-boot to boot via DT.

There is a good reading here:
http://omappedia.org/wiki/Device_Tree


Besides, because we are at 3.9.3, you probably need to patch your DT file. This
patch is probably what you want:

https://lkml.org/lkml/2013/5/15/317
Comment 9 Tobias Jakobi 2013-05-21 09:50:37 UTC
I'm not sure, but it looks like I'm hitting this bug here (https://patchwork.kernel.org/patch/2444501/).

I'm also unsure if I should use the patch proposed there, since Peter Ujfalusi mentions that he submitted one that really fixes the issue.

Anyway, should I file a separate report for this?
Comment 10 Eduardo Valentin 2013-05-21 13:15:01 UTC
Tobias,

I believe you are mixing two thing. Lets try to clarify.

First thing to understand is that the thermal driver is DT only. There is no plan to add non-DT probing for this driver, as platform data probing is deprecated.

Then to use this driver you need to boot your device with:
1. DT support
2. Bandgap device entry in your DT blob.

Looks like you are facing troubles to pass item (1) above. For that I recommend you to continue your investigation with the patch you found. And yes, if you are facing issue with DT booting, you have to file a separated bug for this.

But for item (2), you will need the patch I pointed. The patch I pointed is already submitted and I will make sure it gets merged in upstream.



All best,
Comment 11 Tobias Jakobi 2013-05-21 19:33:07 UTC
Thanks for the explanation. Sadly I can't get the board to boot with DT, even with the patch applied. Opening a new bug for that in the next minutes. I'm coming back to this one once DT works.
Comment 12 Tobias Jakobi 2013-10-16 23:36:03 UTC
I'm now on 3.12-rc5 and booting with DT finally works. Looking at the device tree files, the bandgap device is now listed there.

However I still don't see anything in /sys/class/{thermal,hwmon}/

Also omapconf show temp gives me nothing.

@Eduardo: Any magic kernel options I have to activate?
Comment 13 Tobias Jakobi 2013-10-27 02:36:46 UTC
Hmm, I looked around a bit and noticed that while I had TI_SOC_THERMAL and OMAP4_THERMAL enabled in my config, TI_THERMAL wasn't switched on.

However TI_THERMAL depends on CPU_THERMAL, which in turn depends on CPU_FREQ. Which I've currently off, since it currently locks up the boot process (see bug #58541, comment 6).

I tried to enable CPU_FREQ, but disabling the omap cpufreq driver. I can enable TI_SOC_THERMAL then, but it doesn't load:
"Driver ti-soc-thermal requests probe deferral"

It waits for a cpufreq driver to appear. Guess this won't be fixed before 3.13-rc1
Comment 14 Tobias Jakobi 2013-11-28 23:19:05 UTC
Update with 3.13-rc1: cpufreq support can no be enabled in the kernel config, without leading to boot process lock up. Still, cpufreq doesn't get loaded, so the thermal stuff doesn't work as well. *sigh*
Comment 15 Tobias Jakobi 2014-02-07 21:36:55 UTC
Like explained in bug #58541, a thermal_zone device appears when adding the yet-to-be-merged patches there. Going to close this, once they hit mainline.
Comment 16 Nishanth Menon 2014-03-14 15:39:27 UTC
based on https://bugzilla.kernel.org/show_bug.cgi?id=58541#c13 can we close this?
Comment 17 Tobias Jakobi 2014-03-14 17:37:37 UTC
Let me check again with latest git tip. Going to report back once I've done this.
Comment 18 Tobias Jakobi 2014-04-07 15:27:36 UTC
I checked against vanilla 3.14.0, and while the thermal_zone node is created, this happens:

fragile thermal_zone0 # cat temp 
cat: temp: Invalid argument

So this bug remains open for now.
Comment 19 Tobias Jakobi 2014-05-01 11:22:03 UTC
Retested with vanilla-3.15.0-rc3 and still getting the 'Invalid argument' error.

I also noticed this message in the kernel log:
ti_dt_clocks_register: failed to lookup clock node bandgap_fclk

Looks related to me.
Comment 20 Tobias Jakobi 2014-05-03 18:41:07 UTC
I cleaned my kernel config today and noticed that I was missing the TI_THERMAL config. After adding it the thermal node now works and doing a cat on 'temp' yields reasonable results.