summaryrefslogtreecommitdiffstats
path: root/board_enable.c
diff options
context:
space:
mode:
authorMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>2010-02-24 00:00:21 +0000
committerMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>2010-02-24 00:00:21 +0000
commit940f861feecfcadf36892ee69b4c6bf1c118312e (patch)
tree0af9a52f1eb05e725133a3c71c3c5bdc2a1d9137 /board_enable.c
parentf0e05fc4c511a440d13eb3332a52adad5bd449de (diff)
downloadflashrom-940f861feecfcadf36892ee69b4c6bf1c118312e.zip
flashrom-940f861feecfcadf36892ee69b4c6bf1c118312e.tar.gz
Fix PIIX4 GPO set
Intel datasheet says "byte accesses only". Looks like they mean it. Also fix use of or instead of and for lowering GPOs. Corresponding to flashrom svn r910. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Luc Verhaegen <libv@skynet.be>
Diffstat (limited to 'board_enable.c')
-rw-r--r--board_enable.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/board_enable.c b/board_enable.c
index 2de5fd7..4278b6d 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -578,6 +578,7 @@ static int board_artecgroup_dbe6x(const char *name)
*/
static int intel_piix4_gpo_set(unsigned int gpo, int raise)
{
+ unsigned int gpo_byte, gpo_bit;
struct pci_dev *dev;
uint32_t tmp, base;
@@ -632,12 +633,14 @@ static int intel_piix4_gpo_set(unsigned int gpo, int raise)
/* PM IO base */
base = pci_read_long(dev, 0x40) & 0x0000FFC0;
- tmp = INL(base + 0x34); /* GPO register */
+ gpo_byte = gpo >> 3;
+ gpo_bit = gpo & 7;
+ tmp = INB(base + 0x34 + gpo_byte); /* GPO register */
if (raise)
- tmp |= 0x01 << gpo;
+ tmp |= 0x01 << gpo_bit;
else
- tmp |= ~(0x01 << gpo);
- OUTL(tmp, base + 0x34);
+ tmp &= ~(0x01 << gpo_bit);
+ OUTB(tmp, base + 0x34 + gpo_byte);
return 0;
}
OpenPOWER on IntegriCloud