2 * This file is part of the coreboot project.
4 * Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * The ASUS M2N-E has 6 different fans, connected to two different chips:
23 * - ITE IT8716F: fan1 = CPU_FAN, fan2 = CHA_FAN1, fan3 = PWR_FAN1
24 * - Analog Devices ADT7475: fan1 = CHA_FAN4, fan2 = CHA_FAN2, fan3 = CHA_FAN3
29 #include <superio/ite/it8716f/it8716f.h>
31 static void write_index(u16 port, u8 reg, u8 value)
34 outb(value, port + 1);
41 /* Enable startup of monitoring operations. */
43 /* Polarity active-high, PWM frequency 23.43KHz, activate fans 1-3. */
45 /* Set the correct sensor types. TMPIN1: diode, TMPIN2/3: resistor. */
47 /* Fan1 (CPU_FAN) is software-controlled. */
49 /* Fan2 (CHA_FAN1) is software-controlled. */
51 /* Fan3 (PWR_FAN1) is software-controlled. */
53 /* Enable fan1/2/3, select "on/off mode" for all of them. */
57 /* Called from src/ite/it8716f/superio.c. */
58 void init_ec(u16 base)
62 for (i = 0; i < ARRAY_SIZE(sequence); i++)
63 write_index(base, sequence[i].index, sequence[i].value);