This patch enables automatic fan control on the gigabyte M57sli-s4 motherboard using the environmental controller of the IT8716 superio. All fan outputs are controlled by the cpu temperature sensor for safety.
Signed-off-by: Ronald Hoogenboom hoogenboom30@zonnet.nl
Index: src/superio/ite/it8716f/superio.c =================================================================== --- src/superio/ite/it8716f/superio.c (revision 3129) +++ src/superio/ite/it8716f/superio.c (working copy) @@ -50,6 +50,9 @@ pnp_write_config(dev, 0x02, 0x02); }
+#ifdef HAVE_FANCTL +extern void init_ec(uint16_t base); +#else static void pnp_write_index(uint16_t port_base, uint8_t reg, uint8_t value) { outb(reg, port_base); @@ -62,9 +65,6 @@ return inb(port_base + 1); }
-/* #ifdef HAVE_FANCTL -extern void init_ec(uint16_t base); -#else */ static void init_ec(uint16_t base) { uint8_t value; @@ -80,8 +80,8 @@ printk_debug("FAN_CTL: reg = 0x%04x, writing value = 0x%02x\r\n", base + 0x14, value | 0x87); } -//#endif +#endif
static void it8716f_init(device_t dev) { struct superio_ite_it8716f_config *conf; Index: src/mainboard/gigabyte/m57sli/fanctl.c =================================================================== --- src/mainboard/gigabyte/m57sli/fanctl.c (revision 3129) +++ src/mainboard/gigabyte/m57sli/fanctl.c (working copy) @@ -9,38 +9,58 @@ static const struct { uint8_t index, value; } sequence[]= { + /* Make sure we can monitor, and enable SMI# interrupt output */ + { 0x00, 0x13}, + /* Disable fan interrupt status bits for SMI# */ + { 0x04, 0x37}, + /* Disable VIN interrupt status bits for SMI# */ + { 0x05, 0xff}, + /* Disable fan interrupt status bits for IRQ */ + { 0x07, 0x37}, + /* Disable VIN interrupt status bits for IRQ */ + { 0x08, 0xff}, + /* Disable external sensor interrupt */ + { 0x09, 0x87}, + /* Enable 16 bit counter divisors */ + { 0x0c, 0x07}, /* Set FAN_CTL control register (0x14) polarity to high, and activate fans 1, 2 and 3. */ - { 0x14, 0x87}, + { 0x14, 0xd7}, /* set the correct sensor types 1,2 thermistor; 3 diode */ { 0x51, 0x1c}, - /* set the 'zero' voltage for diode type sensor */ + /* set the 'zero' voltage for diode type sensors, 1-3 */ { 0x5c, 0x80}, -// { 0x56, 0xe5}, -// { 0x57, 0xe5}, - { 0x59, 0xe5}, + { 0x59, 0xec}, { 0x5c, 0x00}, /* fan1 (controlled by temp3) control parameters */ /* fan off limit */ { 0x60, 0xff}, /* fan start limit */ { 0x61, 0x14}, - /* ???? */ -// { 0x62, 0x00}, /* start PWM */ { 0x63, 0x27}, /* smooth and slope PWM */ { 0x64, 0x90}, /* direct-down and interval */ { 0x65, 0x03}, + /* temperature limit of fan stop for fan3 (automatic) */ + { 0x70, 0xff}, + /* temperature limit of fan start for fan3 (automatic) */ + { 0x71, 0x14}, + /* Set PWM start & slope for fan3 */ + { 0x73, 0x20}, + /* Initialize PWM automatic mode slope values for fan3 */ + { 0x74, 0x90}, + /* set smartguardian temperature interval for fan3 */ + { 0x75, 0x03}, /* fan1 auto controlled by temp3 */ { 0x15, 0x82}, - /* fan2 soft controlled, max speed */ - { 0x16, 0x7f}, - /* fan3 soft controlled, 75% speed */ - { 0x17, 0x60}, + /* fan2 auto controlled by temp3 */ + { 0x16, 0x82}, + /* fan3 auto controlled by temp3 */ + { 0x17, 0x82}, /* all fans enable, fan1 ctl smart */ - { 0x13, 0x71} + { 0x13, 0x75} };
#define ARRAYSIZE(x) sizeof x/sizeof *x
Hi Ronald,
On Tue, Jun 10, 2008 at 11:31:12PM +0200, Ronald Hoogenboom wrote:
This patch enables automatic fan control on the gigabyte M57sli-s4 motherboard using the environmental controller of the IT8716 superio. All fan outputs are controlled by the cpu temperature sensor for safety.
I've made a few small modifications:
* put fan2 and 3 under hardware control ('smart' mode) * updated for the current SVN tree
Thanks, Ward.
Hi Ward,
I finally got round to test the 'final' patch and it looks fine on my V2 board. What's the deal now? Do I do a signed-off-by and you do an ack? Or is my previous signed-off sufficient.
Ronald.
On Sat, 2008-06-14 at 15:37 -0400, Ward Vandewege wrote:
Hi Ronald,
On Tue, Jun 10, 2008 at 11:31:12PM +0200, Ronald Hoogenboom wrote:
This patch enables automatic fan control on the gigabyte M57sli-s4 motherboard using the environmental controller of the IT8716 superio. All fan outputs are controlled by the cpu temperature sensor for safety.
I've made a few small modifications:
- put fan2 and 3 under hardware control ('smart' mode)
- updated for the current SVN tree
Thanks, Ward.
Hi Ronald,
On Sun, Jun 22, 2008 at 12:05:30PM +0200, Ronald Hoogenboom wrote:
I finally got round to test the 'final' patch and it looks fine on my V2 board. What's the deal now? Do I do a signed-off-by and you do an ack? Or is my previous signed-off sufficient.
I think in this case you can probably do both a signed-off-by and an acked-by, and I'll do the same, since we both worked on the patch and both tested it.
Then I'll be very glad to commit it :)
Thanks! Ward.
Finally automatic fan control for the gigabyte m57sli-s4 mainboard.
Signed-off-by: Ronald Hoogenboom hoogenboom30@zonnet.nl Acked-by: Ronald Hoogenboom hoogenboom30@zonnet.nl
On Sun, Jun 22, 2008 at 04:26:21PM +0200, Ronald Hoogenboom wrote:
Finally automatic fan control for the gigabyte m57sli-s4 mainboard.
Signed-off-by: Ronald Hoogenboom hoogenboom30@zonnet.nl Acked-by: Ronald Hoogenboom hoogenboom30@zonnet.nl
r3381
Thanks, Ward.