2 * This file is part of the coreboot project.
4 * Copyright (C) 2000 AG Electronics Ltd.
5 * Copyright (C) 2003-2004 Linux Networx
6 * Copyright (C) 2004 Tyan By LYH change from PC87360
7 * Copyright (C) 2010 Win Enterprises (anishp@win-ent.com)
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <arch/romcc_io.h>
27 static inline void pnp_enter_ext_func_mode(device_t dev)
29 unsigned port = dev>>8;
34 static void pnp_exit_ext_func_mode(device_t dev)
36 unsigned port = dev>>8;
40 static void w83627hf_enable_serial(device_t dev, unsigned iobase)
42 pnp_enter_ext_func_mode(dev);
43 pnp_set_logical_device(dev);
44 pnp_set_enable(dev, 0);
45 pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
46 pnp_set_enable(dev, 1);
47 pnp_exit_ext_func_mode(dev);
50 static inline void w83627hf_set_clksel_48(device_t dev)
52 unsigned port = dev >> 8;
53 pnp_enter_ext_func_mode(dev);
55 /* Set CLKSEL (clock input on pin 1) to 48MHz. */
56 outb(inb(port + 1) | (1 << 6), port + 1);
57 pnp_exit_ext_func_mode(dev);