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
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 static void lpc47b397_gpio_offset_out(u16 iobase, u16 offset, u8 value)
25 outb(value, iobase + offset);
28 static u8 lpc47b397_gpio_offset_in(u16 iobase, u16 offset)
30 return inb(iobase+offset);
34 /* For GP60-GP64, GP66-GP85. */
35 #define LPC47B397_GPIO_CNTL_INDEX 0x70
36 #define LPC47B397_GPIO_CNTL_DATA 0x71
38 static void lpc47b397_gpio_index_out(u16 iobase, u8 index, u8 value)
40 outb(index, iobase + LPC47B397_GPIO_CNTL_INDEX);
41 outb(value, iobase + LPC47B397_GPIO_CNTL_DATA);
44 static u8 lpc47b397_gpio_index_in(u16 iobase, u8 index)
46 outb(index, iobase + LPC47B397_GPIO_CNTL_INDEX);
47 return inb(iobase + LPC47B397_GPIO_CNTL_DATA);