Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jul 2017 18:07:49 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 221071] NCT6779D - implement support for sensor readings
Message-ID:  <bug-221071-8-g4ZTYoI188@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-221071-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-221071-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221071

--- Comment #5 from Nils Beyer <nbe@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 =C2=B0C. Got it.

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

+

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

+

        data =3D (*sc->lm_readreg)(sc, sc->lm_sensors[n].reg);
        if (data =3D=3D 0xff) {
                sc->sensors[n].state =3D ENVSYS_SINVALID;
        } else {
                sc->sensors[n].value_cur =3D (data << 4);
                if (sc->sensors[n].rfact) {
                        sc->sensors[n].value_cur *=3D sc->sensors[n].rfact;
                        sc->sensors[n].value_cur /=3D 10;
                } else {
                        sc->sensors[n].value_cur *=3D sc->lm_sensors[n].rfa=
ct;
                        sc->sensors[n].value_cur /=3D 10;
                        sc->sensors[n].rfact =3D sc->lm_sensors[n].rfact;
                }
                sc->sensors[n].state =3D 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...

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-221071-8-g4ZTYoI188>