On Wed, Jan 7, 2015 at 5:49 PM, Mark Kettenis <[email protected]> wrote:
>> From: sven falempin <[email protected]>
>> Date: Wed, 7 Jan 2015 13:59:12 -0500
>>
>> Dear Tech,
>>
>> As you may know I am activating the watchdog function of a chip in
>> my mainboard.  I encouter a little problem as the current is using a
>> undersize 8bit ID.
>>
>> Meanwhile i read about LM as it is the next logical step.
>>
>> In <lm_wbsio_match> in lm78_isa.c device are 'probed' again, but the function
>> received the <struct isa_attach_args> as an argument thus having a way
>> to identfy the chip (in my case)
>>
>> Given the comment i really wonder why the ia_aux field is not used here.
>
> The ID of the SuperIO chip is seperate from the ID of the Hardware
> Monitoring component that's on the chip.  I believe there are some
> cases where the ID of the SuperIO chip is the same, but the ID of the
> Hardware Monitoring component is different and vice versa.  The fact
> that we use the Harware Monitoring component ID as the "primary" ID is
> somewhat historical, but makes some sense since lm(4) can also
> directly attach to the isa(4) bus or even the iic(4) bus.  And in that
> case the SuperIO chip ID is absent.
>
>> Index: dev/ic/lm78var.h
>> ===================================================================
>> RCS file: /cvs/src/sys/dev/ic/lm78var.h,v
>> retrieving revision 1.17
>> diff -u -p -r1.17 lm78var.h
>> --- dev/ic/lm78var.h    6 Dec 2011 16:06:07 -0000       1.17
>> +++ dev/ic/lm78var.h    7 Jan 2015 18:56:14 -0000
>> @@ -97,6 +97,7 @@
>>  /* Vendor IDs */
>>  #define WB_VENDID_WINBOND      0x5ca3  /* Winbond */
>> +#define WB_VENDID_NUVOTON 0x1414  /* Nuvoton NCT */
>>  #define WB_VENDID_ASUS         0x12c3  /* ASUS */
>>  /* Chip IDs */
>> Index: dev/isa/lm78_isa.c
>> ===================================================================
>> RCS file: /cvs/src/sys/dev/isa/lm78_isa.c,v
>> retrieving revision 1.7
>> diff -u -p -r1.7 lm78_isa.c
>> --- dev/isa/lm78_isa.c  6 Dec 2011 16:06:07 -0000       1.7
>> +++ dev/isa/lm78_isa.c  7 Jan 2015 18:56:14 -0000
>> @@ -99,8 +99,14 @@ lm_wbsio_match(struct device *parent, vo
>>         bus_space_unmap(iot, ioh, 8);
>> -       if (vendid != WB_VENDID_WINBOND)
>> +       printf("%s: Probe for Winbond chips %p\n", __func__, ia->ia_aux);
>> +
>> +       //WHY not using ia_aux ?
>> +       if (vendid != WB_VENDID_WINBOND && vendid != WB_VENDID_NUVOTON) {
>> +               DPRINTF(("%s: WB_VENDID_WINBOND %08X\n", __func__,vendid));
>>                 return (0);
>> +  }
>>         ia->ipa_nio = 1;
>>         ia->ipa_io[0].length = 8;
>>
>>
>> --
>> ---------------------------------------------------------------------------------------------------------------------
>> () ascii ribbon campaign - against html e-mail
>> /\
>>
>>

So in the doc there is :

Value RAM  Index 00h ~ 6Fh (Bank 0)

00h CPUVCORE reading
01h VIN0 reading
02h AVSB reading
03h 3VCC reading
04h VIN1 reading
05h VIN2 reading
06h RESERVED
07h 3VSB reading.
08h VBAT reading
09h V10 reading

18h System fan control temperature reading
19h CPU fan control temperature reading
1Ah AUX fan control temperature reading

30h Syatem fan RPM value reading high byte
31h Syatem fan RPM value reading low  byte
32h CPU fan RPM value reading high byte
33h CPU fan RPM value reading low  byte
34h AUX fan RPM value reading high byte
35h AUX fan RPM value reading low  byte

I guess it translate to :


struct lm_sensor nct6106d_sensors[] = {
 /* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x00, lm_refresh_volt, RFACT_NONE / 2 },
//{ "+12V", SENSOR_VOLTS_DC, 0, 0x21, lm_refresh_volt, RFACT(56, 10) / 2 },
{ "+3.3V", SENSOR_VOLTS_DC, 0, 0x03, lm_refresh_volt, RFACT(34, 34) / 2 },
{ "+3.3V", SENSOR_VOLTS_DC, 0, 0x07, lm_refresh_volt, RFACT(34, 34) / 2 },
//{ "-12V", SENSOR_VOLTS_DC, 0, 0x24, wb_w83627ehf_refresh_nvolt },
//{ "", SENSOR_VOLTS_DC, 0, 0x25, lm_refresh_volt, RFACT_NONE / 2 },
//{ "", SENSOR_VOLTS_DC, 0, 0x26, lm_refresh_volt, RFACT_NONE / 2 },
{ "3.3VSB", SENSOR_VOLTS_DC, 5, 0x07, lm_refresh_volt, RFACT(34, 34) / 2 },
{ "VBAT", SENSOR_VOLTS_DC, 5, 0x08, lm_refresh_volt, RFACT_NONE / 2 },
/* Temperature */
{ "", SENSOR_TEMP, 0, 0x18, lm_refresh_temp },
{ "", SENSOR_TEMP, 1, 0x19, wb_refresh_temp },
{ "", SENSOR_TEMP, 2, 0x1a, wb_refresh_temp },

/* Fans */
{ "", SENSOR_FANRPM, 6, 0x30, wb_nct6776f_refresh_fanrpm },
{ "", SENSOR_FANRPM, 6, 0x32, wb_nct6776f_refresh_fanrpm },
{ "", SENSOR_FANRPM, 6, 0x34, wb_nct6776f_refresh_fanrpm },
{ NULL }

};

Could someone help me fill in the blank ??


-- 
---------------------------------------------------------------------------------------------------------------------
() ascii ribbon campaign - against html e-mail
/\

Reply via email to