diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2010-12-13 13:44:33 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2010-12-13 13:44:33 +0000 |
commit | 29c7dfcadc49262271dba95697dab841ea076d17 (patch) | |
tree | cf62961c1f4db7493ac98bbd8f6f5f89a841eb2e /src/mainboard/asus/m2n-e/fanctl.c | |
parent | cb6c9e09422e4f9a2419997d6e49ab3a7a18690c (diff) |
Add support for the ASUS M2N-E board.
This is an AMD K8 + NVIDIA MCP55 + ITE IT8716F mainboard.
It has a working hda_verb.h file for HD audio, and a fanctl.c file is
used to enable the CPU fan (among others) so that we don't kill the
CPU due to excessive heat.
Even though some TODOs remain of course, it works good enough to
successfully boot Linux (e.g. via SeaBIOS).
The full status report is available at:
http://www.coreboot.org/ASUS_M2N-E
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6170 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/mainboard/asus/m2n-e/fanctl.c')
-rw-r--r-- | src/mainboard/asus/m2n-e/fanctl.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/mainboard/asus/m2n-e/fanctl.c b/src/mainboard/asus/m2n-e/fanctl.c new file mode 100644 index 0000000000..c5eb25e68b --- /dev/null +++ b/src/mainboard/asus/m2n-e/fanctl.c @@ -0,0 +1,64 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * The ASUS M2N-E has 6 different fans, connected to two different chips: + * - ITE IT8716F: fan1 = CPU_FAN, fan2 = CHA_FAN1, fan3 = PWR_FAN1 + * - Analog Devices ADT7475: fan1 = CHA_FAN4, fan2 = CHA_FAN2, fan3 = CHA_FAN3 + */ + +#include <arch/io.h> +#include <stdlib.h> +#include <superio/ite/it8716f/it8716f.h> + +static void write_index(u16 port, u8 reg, u8 value) +{ + outb(reg, port); + outb(value, port + 1); +} + +static const struct { + u8 index; + u8 value; +} sequence[] = { + /* Enable startup of monitoring operations. */ + { 0x00, 0x11}, + /* Polarity active-high, PWM frequency 23.43KHz, activate fans 1-3. */ + { 0x14, 0xd7}, + /* Set the correct sensor types. TMPIN1: diode, TMPIN2/3: resistor. */ + { 0x51, 0x31}, + /* Fan1 (CPU_FAN) is software-controlled. */ + { 0x15, 0x7f}, + /* Fan2 (CHA_FAN1) is software-controlled. */ + { 0x16, 0x7f}, + /* Fan3 (PWR_FAN1) is software-controlled. */ + { 0x17, 0x7f}, + /* Enable fan1/2/3, select "on/off mode" for all of them. */ + { 0x13, 0x70}, +}; + +/* Called from src/ite/it8716f/superio.c. */ +void init_ec(u16 base) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(sequence); i++) + write_index(base, sequence[i].index, sequence[i].value); +} |