Author: mkarcher
Date: Wed Feb 24 01:00:21 2010
New Revision: 910
URL: http://flashrom.org/trac/coreboot/changeset/910

Log:
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.

Signed-off-by: Michael Karcher <[email protected]>
Acked-by: Luc Verhaegen <[email protected]>

Modified:
   trunk/board_enable.c

Modified: trunk/board_enable.c
==============================================================================
--- trunk/board_enable.c        Mon Feb 22 16:52:57 2010        (r909)
+++ trunk/board_enable.c        Wed Feb 24 01:00:21 2010        (r910)
@@ -578,6 +578,7 @@
  */
 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 @@
        /* 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;
 }

_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to