[Bug 221071] NCT6779D - implement support for sensor readings

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jul 31 18:07:49 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221071

--- Comment #5 from Nils Beyer <nbe at renzel.net> ---
(In reply to Andriy Gapon from comment #4)

okay, so the value that "superiotool -de" spits out already is the current
temperature in °C. Got it.

What about VCORE voltage. This is the logic:
----------------------------------------------------------------------------
#define RFACT_NONE      10000

+

        {
                .desc = "VCore",
                .type = ENVSYS_SVOLTS_DC,
                .bank = 4,
                .reg = 0x80,
                .refresh = lm_refresh_volt,
                .rfact = RFACT_NONE / 2
        },

+

        data = (*sc->lm_readreg)(sc, sc->lm_sensors[n].reg);
        if (data == 0xff) {
                sc->sensors[n].state = ENVSYS_SINVALID;
        } else {
                sc->sensors[n].value_cur = (data << 4);
                if (sc->sensors[n].rfact) {
                        sc->sensors[n].value_cur *= sc->sensors[n].rfact;
                        sc->sensors[n].value_cur /= 10;
                } else {
                        sc->sensors[n].value_cur *= sc->lm_sensors[n].rfact;
                        sc->sensors[n].value_cur /= 10;
                        sc->sensors[n].rfact = sc->lm_sensors[n].rfact;
                }
                sc->sensors[n].state = ENVSYS_SVALID;
        }
----------------------------------------------------------------------------

bank 4, register 0x80 reads: 0x42 -> 66

1) it's not 0xff, so go on
2) shift left by 4 -> 1056 (I'll keep decimal for now)
3) "rfact" is set (I think), so multiply that with "rfact" (5000) -> 5280000
4) divide that with 10 -> 528000

So my CPU is running with 528000V or (if millivolts: 528V). Lovely, hard to
cool it, though...

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list