2 * This file is part of the coreboot project.
4 * Copyright (C) 2008 Arastra, Inc.
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
21 #include <arch/romcc_io.h>
24 static void i3100_sio_write(u8 port, u8 ldn, u8 index, u8 value)
29 outb(value, port + 1);
32 static void i3100_enable_serial(u8 port, u8 ldn, u16 iobase)
34 /* Enter configuration state. */
38 /* Enable serial port. */
39 i3100_sio_write(port, ldn, 0x30, 0x01);
41 /* Set serial port I/O region. */
42 i3100_sio_write(port, ldn, 0x60, (iobase >> 8) & 0xff);
43 i3100_sio_write(port, ldn, 0x61, iobase & 0xff);
45 /* Enable device interrupts, set UART_CLK predivide to 26. */
46 i3100_sio_write(port, 0x00, 0x29, 0x0b);
48 /* Exit configuration state. */