Re: [NCT6775] Additional temperature sensors on nct6791d

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2016-01-24 4:27 GMT+02:00 Guenter Roeck <linux@xxxxxxxxxxxx>:
> On 01/23/2016 02:52 PM, Ville Aakko wrote:
>>
>> Hi,
>>
>> After all this time I've made a small discovery by chance: changing
>> the BIOS to control a fan (CASE fan 2) via the additional sensor
>> (T_SENSOR1), will expose the sensor at 0x77 in bank 0:
>>
>>       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
>> 00: 04 ff 04 4e 00 ff ff ff ff ff ff ff ff ff ff ff
>> 10: 04 00 04 61 04 ff 03 ff 40 7f 00 64 00 00 00 00
>> 20: 74 7e d2 d2 7e f7 00 28 ff ff ff da 00 83 77 e3
>> 30: ba e3 ba 83 77 ff ea 51 00 37 32 ff ff ff ff ff
>> 40: 03 1e 07 ff df 00 1e ff 2d ff ff 10 00 55 00 a3
>> 50: 05 ff ff ff ff ff ff ff c1 ff ff ff ff 01 00 ff
>> 60: 00 00 ff ff ff 01 00 ff ff ff ff ff ff ff ff ff
>> 70: 00 0a 00 2d 00 2d 00 16 00 2d 00 74 80 ff ff ff
>> 80: ff 7f 3f bf ff 05 05 05 00 00 00 00 00 00 00 00
>> 90: 0a 00 00 00 00 fd fd fd 0a 95 ef 80 ff 40 46 c4
>> a0: 0e ff 00 00 ff 00 00 ff 00 00 80 66 06 06 01 00
>> b0: 00 00 00 00 00 00 3b 00 04 00 00 09 2c 40 04 00
>> c0: ff ff ff ff ff ff ff ff ff 03 02 05 ff ff ff ff
>> d0: 05 05 05 05 00 00 00 00 00 00 00 00 fd fd fd fd
>> e0: 55 80 00 00 00 ff ff ff ff ff 00 00 16 00 00 00
>> f0: 00 00 00 00 00 00 00 00 00 00 00 00 6f ff ff ff
>>
>> Here, the sensor is in my room which is 0x16=22 (°C). Verified by
>> trying a hot cup of water and ice water (1-77°C).
>>
>> It occured to me that maybe BIOS has written to bank 3 at 0x0. It
>> seems it reads out 0x10 if the control is CPU and 0x1f if the control
>> is set to the additional sensor. However, writing 0x1f to bank3 0x0
>> will only mess up the BIOS fan control until reboot, and I can not
>> find the temperature in the bank 0.
>>
>> So, BIOS is doing something else here (and, in your previous message
>> you said 0x1f = virtual temp, which is not explained in detail).
>>
>
> Try writing a value into register 0xec and check if that makes a difference.
> Its definition is "AUX0FAN Virtual Temperature Register". Maybe it
> provides the values for register 0x77, and maybe it is updated (?)
> by the BIOS.

I can write to 0xec, which seems to also contain the temperature
(didn't notice that before!). This written value will be copied into
0x77, but only momentarily until BIOS updates it again (<1 second).

A few other things I've noticed after posting:

* The temperature is also reported in bank4, at 0x9b (again: only if
case fan 2 is controlled by this sensor).

* The temperature value shifts in the registers, if I change which
fan(s) is controlled by it, like this:

   Chassis fan 1, temperature in bank 0: 0x73, 0xea; bank4: 0x99
   Chassis fan 2, temperature in bank 0: 0x77, 0xec; bank4: 0x9b
   Chassis fan 3, temperature in bank 0: 0x79, 0xed; bank4: 0x9c

I presume this is so that BIOS can control as many fans as I like via
this sensor, and indeed it is reported in all of the above registers
if all fans are set accordingly. See dumps at the end of this post, in
case I've made an error.

 - Ville

Here for these dumps I have temporarily sed all chassis fans
controlled by T_SENSOR1 in BIOS - i.e. chassis fans 1-3.

Btw. the temperature for CPU fan seems to be in bank 0, 0x75 and
bank4, 0x9a - i.e. between temperature controlling Chassis fans 1&2.

$ sudo isadump -y 0x295 0x296 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
10: 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff ff
20: ff ff ff 96 64 96 64 e1 96 00 ff ff ff ff ff ff
30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
40: ff ff 00 00 ff ff ff ff ff ff 00 00 00 00 04 ff
50: 00 73 ff ff 00 00 00 ff ff 00 12 00 09 00 ff ff
60: ff 01 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
80: 74 7e d2 d2 7e f7 00 d6 ce 7f 00 64 00 00 00 00
90: 29 29 80 80 25 7f 00 3b c0 15 29 15 15 80 02 80
a0: ff 29 ff ff ff ff 33 35 4f 4f 00 00 00 00 00 00
b0: ff 1f 48 0f ff 1f ff 1f ff 1f ff 1f 00 00 ff ff
c0: 00 00 02 46 00 00 00 00 00 00 00 00 ff ff ff ff
d0: 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff
e0: 00 35 00 00 ff ff ff ff ff ff ff ff ff ff ff ff
f0: 2e 80 00 00 29 00 fb 00 50 00 51 00 00 00 00 ff

$ sudo isadump -y 0x295 0x296 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 04 00 04 35 00 ff ff ff ff ff ff ff ff ff ff ff
10: 04 00 04 00 04 ff 03 ff 40 7f 00 64 00 00 00 00
20: 74 7e d2 d2 7e f7 00 2a ff ff ff da 00 83 77 e3
30: ba e3 ba 83 77 ff ea 51 00 37 32 ff ff ff ff ff
40: 03 00 00 ff df 00 1e ff 2d ff ff 10 00 55 00 a3
50: 05 ff ff ff ff ff ff ff c1 ff ff ff ff 01 00 ff
60: 00 00 ff ff ff 01 00 ff ff ff ff ff ff ff ff ff
70: 00 0a 00 15 00 29 80 15 00 15 00 71 80 ff ff ff
80: ff 7f 3f bf ff 05 05 05 00 00 00 00 00 00 00 00
90: 0a 00 00 00 00 fd fd fd 0a 95 ef 80 ff 40 46 c4
a0: 0e ff 00 00 ff 00 00 ff 00 00 80 66 06 06 01 00
b0: 00 00 00 00 00 00 3c 00 04 00 00 34 28 40 04 00
c0: ff ff ff ff ff ff ff ff ff 1d 06 05 ff ff ff ff
d0: 05 05 05 05 00 00 00 00 00 00 00 00 fd fd fd fd
e0: 55 80 00 00 00 ff ff ff ff ff 15 00 15 15 00 00

p.s. It seems I sent this first to Guenter only, sorry for spamming your inbox

> Guenter
>
>
>> I can provide the dumps of the registers in case that helps, in both
>> BIOS configurations.
>>
>> Cheers!
>>
>> 2015-04-19 11:37 GMT+03:00 Ville Aakko <ville.aakko@xxxxxxxxx>:
>>>
>>> Hi again,
>>>
>>> Sorry for a late reply - I apprecieate your help. I had other duties
>>> (and then I had a flu), to do so I didin't have time to look into this
>>> and reply before.
>>>
>>> But, I believe I've had no luck so far. Maybe the additional sensor is
>>> not handled trough the nct6791d after all? Details inline:
>>>
>>> 2015-04-12 18:40 GMT+03:00 Guenter Roeck <linux@xxxxxxxxxxxx>:
>>>>
>>>> On 04/12/2015 06:37 AM, Ville Aakko wrote:
>>>>>
>>>>> 2015-04-11 5:12 GMT+03:00 Guenter Roeck <linux@xxxxxxxxxxxx>:
>>>
>>> [SNIP]
>>>>>>
>>>>>> Additional temperature registers:
>>>>>>
>>>>>> Bank 0:
>>>>>>           0x27            SMIOVT1
>>>>>>
>>>>>> The temperature source for this register is set in bank 6, register
>>>>>> 0x21.
>>>>>>
>>>>>>           0x73, 0x74      Monitor Temperature Register 1
>>>>>> (0x73=fraction,
>>>>>> 0x74=Integer)
>>>>>>           0x75, 0x76      Reg 2
>>>>>>           0x77, 0x78      Reg 3
>>>>>>           0x79, 0x7a      Reg 4
>>>>>>           0x7b, 0x7c      Reg 5
>>>>>
>>>>>
>>>>>
>>>>> However, if I've understod your information correctly, SMIOVT1 is
>>>>> always shoving 0x24 or 0x25, and SMIOVT2 seems to be 0x33. The select
>>>>> registers are set to 01 and 02, (and reg 0x0, bank 0xa to 0x03), which
>>>>> does not make sense? They should be set to 0x73 to 0x7c to provide
>>>>> anything meaningful? See below:
>>>>>
>>>> I hope I did not say that ;-). The source select registers always
>>>> have the same definition, and that definition is further below.
>>>> 0x01 is SYSTIN, 0x02 is CPUTIN.
>>>
>>>
>>> Yes, I was confused about the bank in question since I haven't fiddled
>>> with this kind of things before =). But I think I understand now what
>>> you meant.
>>>
>>>>> Should I try to write to registers (0x0 in bank 1, 2, 3, 8 or 9 to
>>>>> anything ranging from 0x0 to 0x20 and the corresponding set registers)
>>>>> with isaset? I'm not sure exactly what I should input, and the isaset
>>>>> man page does not actually encourage tinkering if one is not totally
>>>>> sure what he/she is doing =). How to select bank with isaset? I'll be
>>>>> responsible of course if I will blow up my computer with isaset, but
>>>>> I'd still like to know if that is the right thing to do before I try
>>>>> it.
>>>>>
>>>> You could try that with bank 8. The PCH temperatures as well as
>>>> BYTE_TEMP
>>>> are also reported in bank 4, registers 0x00 to 0x1a (two registers per
>>>> temperature). Those all report 0 per your log above.
>>>>
>>>> The only unreported temperatures are therefore the temperatures
>>>> reported through the SMBUs master sources. So you could set register
>>>> 0x00 of bank 8 to 0x08 .. 0x0f and see if that makes a difference
>>>> for the temperature reported at 0x79 / 0x7a.
>>>>
>>>> The bank register is at register 0x4e in every page. You would set
>>>> the bank first with isaset, followed by the actual isaset command.
>>>>
>>>> sudo isaset -y 0x295 0x296 0x4e 8
>>>> sudo isaset -y 0x295 0x296 0x0 0x08 [0x09, 0x0a, ... , 0x0f]
>>>> sudo isadump -y 0x295 0x296 0
>>>>
>>>> If 0x79 / 0x7a reports anything but 0, we may have found your sensor.
>>>> You might want to unload the nct6775 driver before doing those tests.
>>>
>>>
>>> I did this. At first I need to load (after a reboot) the nct6775
>>> driver - otherwise, all the registers would report all 0xff's when I
>>> tried to dump them with isadump. So something is initialized by the
>>> driver, is this normal? But after modprobe I removed the driver and
>>> tried the commands. I even did it again after a fresh reboot, in case
>>> the chip was in some odd state because I could have mad a mistake /
>>> after I had been running lm_sensors initialization script (I disabled
>>> the script / service to make sure nothing has been done to the
>>> registers).
>>>
>>> In 0x79 I usually had 0xfd, but I had seen anything from 0xfe to 0xff
>>> without any apparent pattern. 0x7a is always 00.
>>>
>>> I also dumped bank 8 to check 0x00 that it was written corretly - and
>>> it was. I also wrote the value for PCH and SYSTIN in the select
>>> register, since I know what PCH and SYSTIN should approximately show,
>>> and the right values seemed to appear in bank 0 / 0x79-0x7a.
>>>
>>> So, any other ideas?
>>>
>>> If you are running out of ideas, I was thinking about contacting ASUS
>>> support, maybe they'd like to share some information on this (where
>>> the additional sensor is actually handled and if they'd like to
>>> disclose any information). Hearing / reading about their reputation
>>> earlier on Linux support, I'd doubt that would help, but I guess it
>>> couldn't hurt either to ask.
>>>
>>> (I can provide the dumps from isadump if you wish, but I didn't notice
>>> anything peculiar in them)
>>>
>>>> I am wondering - when you do all your tests in the BIOS, do you
>>>> see the temperature (changes) reported there correctly ?
>>>
>>>
>>> Yes. I tried it (in real time while watching the figure) in room
>>> temperature (21-22°C), glass of (fresh / really cold and full of ice)
>>> water (0°C) and my graphics card heat sink (44°C, though I don't have
>>> a reference measurement for the heat sink).
>>>
>>> Thanks for your help!
>>>
>>> --
>>> --
>>> Ville Aakko - ville.aakko@xxxxxxxxx
>>
>>
>>
>>
>



-- 
--
Ville Aakko - ville.aakko@xxxxxxxxx

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux