Date: Sun, 12 Oct 2003 20:50:48 -0700 (PDT) From: Alex Vasylenko <lxv@omut.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Kazushi NAKAMURA <kaz@kobe1995.net> Subject: ports/57930: [patch] sysutils/xmbmon: enable ADM9240 h/w monitor Message-ID: <200310130350.h9D3omkd068640@mix.omut.org> Resent-Message-ID: <200310130400.h9D40aTb090978@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 57930 >Category: ports >Synopsis: [patch] sysutils/xmbmon: enable ADM9240 h/w monitor >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 12 21:00:35 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Alex Vasylenko >Release: FreeBSD 5.1-RELEASE-p10 i386 >Organization: >Environment: System: FreeBSD 5.1-RELEASE-p10 on Intel ISP1100 >Description: Intel ISP1100 comes with an ADM9240 hardware monitor, however the chip remains in standby mode and must be enabled before any measured values can be read. Please see the patch below. The second part of the patch improves the precision of temperature readings from ADM9240. >How-To-Repeat: Execute mbmon on a system with a ADM9240 hardware monitor execute: cd /usr/ports/sysutils/xmbmon && make install clean && mbmon All values come back as 0. >Fix: --- sens_winbond.c.orig Sat Jul 5 07:56:47 2003 +++ sens_winbond.c Sun Oct 12 20:17:01 2003 @@ -86,6 +86,7 @@ #define WINBD_FANDIV 0x47 #define WINBD_REGPIN 0x4B #define ASUSM_FANDIV 0xA1 +#define ANADM_TEMPCFG 0x4B #define WINBD_DIOSEL 0x59 #define WINBD_VMCTRL 0x5D @@ -299,6 +300,12 @@ goto ret1; } + if (wbdchipid == ADM9240) { + temp1_flag = temp2_flag = 1; /* disable! */ + method->Write(WINBD_CONFIG, 0x01); /* init. chip */ + goto ret1; + } + if (method == &method_isa && wbdchipid >= LM78) { temp1_flag = temp2_flag = 1; /* disable! */ goto ret1; @@ -364,9 +371,15 @@ (wbdchipid == W83783S || wbdchipid == W83697HF || wbdchipid == ASM58)) return 0xFFFF; - if (no == 0) - return (float) method->Read(WINBD_TEMP0); - else if (no == 1) { + if (no == 0) { + f = (float) method->Read(WINBD_TEMP0); + if (wbdchipid == ADM9240) { + n = method->Read(ANADM_TEMPCFG); + if (n & 0x80) + f += 0.5; + } + return f; + } else if (no == 1) { if (wbdchipid == ASB100) return (float) method->Read(ASUSB_TEMP4); if (wbdchipid == ASM58) @@ -518,5 +531,5 @@ return 0xFFFF; } - return 1350000 / (r * (1 << div[no])); + return 22500 * 60 / (r * (1 << div[no])); } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310130350.h9D3omkd068640>