mainboard/asus/kgpe-d16: Use I/O PCI access in bootblock
The existing code incorrectly used standard PCI access
calls in the bootblock. Use the I/O PCI access calls
as the normal PCI access mechanisms have not yet been
set up.
Also ensure the recovery jumper GPIO has been set to
input mode before reading it.
Change-Id: Id626d01526427004b2404e4d9b44d7c987d172d1
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: https://review.coreboot.org/12651
Tested-by: build bot (Jenkins)
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/mainboard/asus/kgpe-d16/bootblock.c b/src/mainboard/asus/kgpe-d16/bootblock.c
index 0289f08..6f2c0a1 100644
--- a/src/mainboard/asus/kgpe-d16/bootblock.c
+++ b/src/mainboard/asus/kgpe-d16/bootblock.c
@@ -15,6 +15,7 @@
* GNU General Public License for more details.
*/
+#include <arch/io.h>
#include <pc80/mc146818rtc.h>
void bootblock_mainboard_init(void)
@@ -27,7 +28,10 @@
bootblock_southbridge_init();
/* Recovery jumper is connected to SP5100 GPIO61, and clears the GPIO when placed in the Recovery position */
- recovery_enabled = (!(pci_read_config8(PCI_DEV(0, 0x14, 0), 0x57) & 0x1));
+ byte = pci_io_read_config8(PCI_DEV(0, 0x14, 0), 0x56);
+ byte |= 0x1 << 4; /* Set GPIO61 to input mode */
+ pci_io_write_config8(PCI_DEV(0, 0x14, 0), 0x56, byte);
+ recovery_enabled = (!(pci_io_read_config8(PCI_DEV(0, 0x14, 0), 0x57) & 0x1));
if (recovery_enabled) {
#if CONFIG_USE_OPTION_TABLE
/* Clear NVRAM checksum */
@@ -45,4 +49,4 @@
*/
#endif
}
-}
\ No newline at end of file
+}