Zheng Bao | 9db833b | 2009-12-28 09:59:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2000 AG Electronics Ltd. |
| 5 | * Copyright (C) 2003-2004 Linux Networx |
| 6 | * Copyright (C) 2004 Tyan |
| 7 | * |
| 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. |
| 12 | * |
| 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. |
Zheng Bao | 9db833b | 2009-12-28 09:59:44 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 19 | static void lpc47b397_gpio_offset_out(u16 iobase, u16 offset, u8 value) |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 20 | { |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 21 | outb(value, iobase + offset); |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 22 | } |
Myles Watson | cee9438 | 2008-10-02 19:21:30 +0000 | [diff] [blame] | 23 | |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 24 | static u8 lpc47b397_gpio_offset_in(u16 iobase, u16 offset) |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 25 | { |
Myles Watson | cee9438 | 2008-10-02 19:21:30 +0000 | [diff] [blame] | 26 | return inb(iobase+offset); |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 27 | } |
| 28 | |
Stefan Reinauer | d4f5373 | 2010-04-09 14:46:51 +0000 | [diff] [blame] | 29 | #if 0 |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 30 | /* For GP60-GP64, GP66-GP85. */ |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 31 | #define LPC47B397_GPIO_CNTL_INDEX 0x70 |
| 32 | #define LPC47B397_GPIO_CNTL_DATA 0x71 |
| 33 | |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 34 | static void lpc47b397_gpio_index_out(u16 iobase, u8 index, u8 value) |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 35 | { |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 36 | outb(index, iobase + LPC47B397_GPIO_CNTL_INDEX); |
| 37 | outb(value, iobase + LPC47B397_GPIO_CNTL_DATA); |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 38 | } |
Myles Watson | cee9438 | 2008-10-02 19:21:30 +0000 | [diff] [blame] | 39 | |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 40 | static u8 lpc47b397_gpio_index_in(u16 iobase, u8 index) |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 41 | { |
Uwe Hermann | a69d978 | 2010-11-15 19:35:14 +0000 | [diff] [blame] | 42 | outb(index, iobase + LPC47B397_GPIO_CNTL_INDEX); |
| 43 | return inb(iobase + LPC47B397_GPIO_CNTL_DATA); |
arch import user (historical) | 98d0d30 | 2005-07-06 17:13:46 +0000 | [diff] [blame] | 44 | } |
Stefan Reinauer | d4f5373 | 2010-04-09 14:46:51 +0000 | [diff] [blame] | 45 | #endif |