summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Zumbiehl <florz@florz.de>2011-11-01 20:17:13 +0100
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-11-02 16:50:04 +0100
commitf8ed90332c5c51f04e4f7a06a5af3ecd58ffa39c (patch)
treee465411bcbc2a49989f0e17a81932d57eabdd2ec /src
parent1200ec5a532220b3349d97de1b91f860ae2d2de2 (diff)
downloadcoreboot-f8ed90332c5c51f04e4f7a06a5af3ecd58ffa39c.tar.xz
simplify IDE cable detection for Asus M2V
Change-Id: If8e4dcf405e24b744ac34f581c5609fcce96fd07 Signed-off-by: Florian Zumbiehl <florz@florz.de> Reviewed-on: http://review.coreboot.org/371 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/asus/m2v/mainboard.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mainboard/asus/m2v/mainboard.c b/src/mainboard/asus/m2v/mainboard.c
index 76d3cf6c7a..2f20fe0bed 100644
--- a/src/mainboard/asus/m2v/mainboard.c
+++ b/src/mainboard/asus/m2v/mainboard.c
@@ -37,10 +37,9 @@ u32 vt8237_ide_80pin_detect(struct device *dev)
if (!lpc_dev)
return 0;
- acpi_io_base = pci_read_config16(lpc_dev, 0x88);
- if (!acpi_io_base || (acpi_io_base & ~1) == 0)
+ acpi_io_base = pci_read_config16(lpc_dev, 0x88) & ~1;
+ if (!acpi_io_base)
return 0;
- acpi_io_base &= ~1;
gpio_in = inl(acpi_io_base + 0x48);
/* bit 9 for primary port, clear if unconnected or 80-pin cable */
@@ -49,9 +48,9 @@ u32 vt8237_ide_80pin_detect(struct device *dev)
res |= gpio_in & (1<<4) ? 0 : VT8237R_IDE1_80PIN_CABLE;
printk(BIOS_INFO, "Cable on %s PATA port: %d pin\n", "primary",
- gpio_in & (1<<9) ? 40 : 80);
+ res & VT8237R_IDE0_80PIN_CABLE ? 80 : 40);
printk(BIOS_INFO, "Cable on %s PATA port: %d pin\n", "secondary",
- gpio_in & (1<<4) ? 40 : 80);
+ res & VT8237R_IDE1_80PIN_CABLE ? 80 : 40);
return res;
}