Lm-sensors support


(Frank W.) #1

Hi, is lm-sensors supported? which chip can be used to get lm-sensors data?

regards Frank


(Frank W.) #2

Did i need to add a i2c-config to dts like here?

which bus has the sensors attached? Any additional Kernel-modules?


(Frank W.) #3

added only I2C_CHARDEV-option to kernel and got this:

Linux bpi-r2 4.14.0-00004-gbeba822 #1 SMP Tue Dec 12 12:13:30 CET 2017 armv7l
root@bpi-r2:~# sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# Kernel: 4.14.0-00004-gbeba822 armv7l
# Processor: ARMv7 Processor rev 3 (v7l) (//)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): 
modprobe: FATAL: Module cpuid not found in directory /lib/modules/4.14.0-00004-2
Failed to load module cpuid.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): 
Sorry, no supported PCI bus adapters found.
Module i2c-dev loaded successfully.

Next adapter: i2c-mt65xx (i2c-0)
Do you want to scan it? (YES/no/selectively): 

Next adapter: i2c-mt65xx (i2c-1)
Do you want to scan it? (YES/no/selectively): 

Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
http://www.lm-sensors.org/wiki/Devices for driver status.

do i need a separate driver for mt65xx? or miss i something in dts?


(dorabmon) #4

Which i2c device you used here on your board ?


(Frank W.) #5

no external device, want to read internal sensors, or are there none?

i2c-0 and i2c-1 seems to be the i2c-busses on gpio, right?


(dorabmon) #6

There i2c-mt65xx is bus driver, so they have to be used along with external devices.


(dorabmon) #7

Only sensor available on bpi-r2 as I knew is thermal sensor for cpu which is being accessed through on-chip bus called auxadc, you could find this in dts files to know more.


(Frank W.) #8

found it in mt7623.dtsi, but how to access it?

	auxadc: adc@11001000 {
		compatible = "mediatek,mt7623-auxadc",
			     "mediatek,mt2701-auxadc";
		reg = <0 0x11001000 0 0x1000>;
		clocks = <&pericfg CLK_PERI_AUXADC>;
		clock-names = "main";
		#io-channel-cells = <1>;
};

seems that it is enabled by default (no status=disabled), nothing found in bananapi.dts


(Frank W.) #9

Maybe this is related: http://lists.infradead.org/pipermail/linux-mediatek/2016-August/006638.html

thermal-block in dts is existing,but how to read the values?

It seems that also a driver must be activated in kernel (mtk_thermal):

http://elixir.free-electrons.com/linux/v4.14.6/source/drivers/thermal/Makefile


(Frank W.) #10

added module MTK_TERMAL, but no success…

root@bpi-r2:~# modprobe mtk-thermal                                             
root@bpi-r2:~# lsmod                                                            
Module                  Size  Used by                                           
i2c_dev                20480  0                                                 
mt76x2e                61440  0                                                 
mt76                   32768  1 mt76x2e                                         
mtk_thermal            16384  0                                                 
thermal_sys            61440  1 mtk_thermal                                     
pwm_mediatek           16384  0                                                 
ip_tables              24576  0                                                 
x_tables               28672  1 ip_tables                                       
ipv6                  409600  18                                                
root@bpi-r2:~# sensors-detect                                                   
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)                      
# Kernel: 4.14.11-00002-ga352d6b armv7l                                         
# Processor: ARMv7 Processor rev 3 (v7l) (//)                                   
                                                                                
This program will help you determine which kernel modules you need              
to load to use lm_sensors most effectively. It is generally safe                
and recommended to accept the default answers to all questions,                 
unless you know what you're doing.                                              
                                                                                
Some south bridges, CPUs or memory controllers contain embedded sensors.        
Do you want to scan for them? This is totally safe. (YES/no):                   
modprobe: FATAL: Module cpuid not found in directory /lib/modules/4.14.11-00002b
Failed to load module cpuid.                                                    
Silicon Integrated Systems SIS5595...                       No                  
VIA VT82C686 Integrated Sensors...                          No                  
VIA VT8231 Integrated Sensors...                            No                  
AMD K8 thermal sensors...                                   No                  
AMD Family 10h thermal sensors...                           No                  
AMD Family 11h thermal sensors...                           No                  
AMD Family 12h and 14h thermal sensors...                   No                  
AMD Family 15h thermal sensors...                           No                  
AMD Family 16h thermal sensors...                           No                  
AMD Family 15h power sensors...                             No                  
AMD Family 16h power sensors...                             No                  
Intel digital thermal sensor...                             No                  
Intel AMB FB-DIMM thermal sensor...                         No                  
Intel 5500/5520/X58 thermal sensor...                       No                  
VIA C7 thermal sensor...                                    No                  
VIA Nano thermal sensor...                                  No                  
                                                                                
Lastly, we can probe the I2C/SMBus adapters for connected hardware              
monitoring devices. This is the most risky part, and while it works             
reasonably well on most systems, it has been reported to cause trouble          
on some systems.                             

i’ve found no config-option for CPUID, only CPUIDLE for different platforms…

searched also through sysfs and tried that which seems also not correct:

root@bpi-r2:~# cat /sys/class/thermal/thermal_zone0/temp                        
0 

maybe it needs this:

Symbol: CPU_THERMAL [=n]
Prompt: generic cpu cooling support 

?


(Frank W.) #11

any Idea how to read out CPU-Temp?


(Frank W.) #12

had included and loaded now thermal_sys, mtk_thermal and mt6577_auxadc but sensors-detect does not find anything

anyone knows how to get at least the CPU-Temp?


(Andrzej) #13

Any success to read CPU temp?


(Frank W.) #14

I still have no clue how to read from auxadc :pensive:


Temperature Sensors on SOC or board?
(xbgmsharp) #15

On kernel 4.9, i can retrieved temp value, not sure the value is valid neither the unit. I have mtk_thermal and thermal_sys modules loaded.

# lsmod | grep ther
mtk_thermal             5385  0
thermal_sys            53003  1 mtk_thermal
# cat /sys/class/thermal/thermal_zone0/*temp
56934
47000
67000
87000
107000

(Frank W.) #16

cat *temp in that dir is not the right way:

see here:

[17:59] root@bpi-r2:~# cat /sys/class/thermal/thermal_zone0/*temp                                                                                                              
cat: /sys/class/thermal/thermal_zone0/temp: Invalid argument                                                                                                                   
47000                                                                                                                                                                          
67000                                                                                                                                                                          
87000                                                                                                                                                                          
107000                                                                                                                                                                         
[18:00] root@bpi-r2:~# ls /sys/class/thermal/thermal_zone0/                                                                                                                    
available_policies  offset             trip_point_0_hyst  trip_point_2_temp                                                                                                    
integral_cutoff     policy             trip_point_0_temp  trip_point_2_type                                                                                                    
k_d                 power              trip_point_0_type  trip_point_3_hyst                                                                                                    
k_i                 slope              trip_point_1_hyst  trip_point_3_temp                                                                                                    
k_po                subsystem          trip_point_1_temp  trip_point_3_type                                                                                                    
k_pu                sustainable_power  trip_point_1_type  type                                                                                                                 
mode                temp               trip_point_2_hyst  uevent     

first you don’t know which “file” do you cat, second there are not only temperature-sensors there

kernel i used: 4.14.44-main


(xbgmsharp) #17

I take the same example as you in a previous post.

# cat /sys/class/thermal/thermal_zone0/temp 
56465

(Frank W.) #18

can you compare dts(i) and (def)config between 4.9 and 4.14?

thermal-node and auxadc


(xbgmsharp) #19

I can retrieved a value, not sure the value is valid neither of the unit. If it is degrees Celsius it is high.

$ grep -i thermal .config | grep -v '#'
CONFIG_THERMAL=m
CONFIG_THERMAL_OF=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
CONFIG_THERMAL_GOV_STEP_WISE=y
CONFIG_MTK_THERMAL=m

The thermal zone are describe in the arch/arm/boot/dts/mt7623.dtsi

Seems like Module i2c-dev and cpuid are need. sensors-detect is unable to find any sensors.


(Frank W.) #20

It is milli (1/1000) degrees celcius…

Cpuid is not available on arm-systems, i have tried with i2c-dev too, but no success

config is (nearly) same im 4.14:

$ grep -i thermal .config | grep -v '#'
CONFIG_THERMAL=m
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
CONFIG_THERMAL_OF=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
CONFIG_THERMAL_GOV_STEP_WISE=y
CONFIG_MTK_THERMAL=m

@linkerosa have you an idea whats the Problem?