summaryrefslogtreecommitdiff
path: root/src/southbridge/intel/i82801ax/i82801ax_ide.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2010-10-08 19:24:56 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2010-10-08 19:24:56 +0000
commitab06fb0caea2469fdf212a7655517a836a8dede6 (patch)
treeb218e0f043178726b4ac3cabdfe4ff78c2e6f65d /src/southbridge/intel/i82801ax/i82801ax_ide.c
parent3b8db813809f3485ceaa77bf91595e64cc588d92 (diff)
downloadcoreboot-ab06fb0caea2469fdf212a7655517a836a8dede6.tar.xz
Round 2 of i82801AX fixes to get it into a usable shape.
- Remove left-overs from more generic code in i82801xx times, and fix register names as needed. - Simplify IDE init code (and save some ROM space too). - Simplify PIRQ code. - Use u8 et al instead of uint8_t everywhere. - Random other fixes. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5925 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/intel/i82801ax/i82801ax_ide.c')
-rw-r--r--src/southbridge/intel/i82801ax/i82801ax_ide.c46
1 files changed, 18 insertions, 28 deletions
diff --git a/src/southbridge/intel/i82801ax/i82801ax_ide.c b/src/southbridge/intel/i82801ax/i82801ax_ide.c
index 04a7a12a48..98bc542d07 100644
--- a/src/southbridge/intel/i82801ax/i82801ax_ide.c
+++ b/src/southbridge/intel/i82801ax/i82801ax_ide.c
@@ -31,33 +31,24 @@ typedef struct southbridge_intel_i82801ax_config config_t;
static void ide_init(struct device *dev)
{
- /* Get the chip configuration */
- config_t *config = dev->chip_info;
+ u16 reg16;
+ config_t *conf = dev->chip_info;
- /* Enable IDE devices so the Linux IDE driver will work. */
- uint16_t ideTimingConfig;
+ reg16 = pci_read_config16(dev, IDE_TIM_PRI);
+ reg16 &= ~IDE_DECODE_ENABLE;
+ if (!conf || conf->ide0_enable)
+ reg16 |= IDE_DECODE_ENABLE;
+ printk(BIOS_DEBUG, "IDE: %s: %s\n", "Primary IDE interface",
+ conf->ide0_enable ? "on" : "off");
+ pci_write_config16(dev, IDE_TIM_PRI, reg16);
- ideTimingConfig = pci_read_config16(dev, IDE_TIM_PRI);
- ideTimingConfig &= ~IDE_DECODE_ENABLE;
- if (!config || config->ide0_enable) {
- /* Enable primary IDE interface. */
- ideTimingConfig |= IDE_DECODE_ENABLE;
- printk(BIOS_DEBUG, "IDE0: Primary IDE interface is enabled\n");
- } else {
- printk(BIOS_INFO, "IDE0: Primary IDE interface is disabled\n");
- }
- pci_write_config16(dev, IDE_TIM_PRI, ideTimingConfig);
-
- ideTimingConfig = pci_read_config16(dev, IDE_TIM_SEC);
- ideTimingConfig &= ~IDE_DECODE_ENABLE;
- if (!config || config->ide1_enable) {
- /* Enable secondary IDE interface. */
- ideTimingConfig |= IDE_DECODE_ENABLE;
- printk(BIOS_DEBUG, "IDE1: Secondary IDE interface is enabled\n");
- } else {
- printk(BIOS_INFO, "IDE1: Secondary IDE interface is disabled\n");
- }
- pci_write_config16(dev, IDE_TIM_SEC, ideTimingConfig);
+ reg16 = pci_read_config16(dev, IDE_TIM_SEC);
+ reg16 &= ~IDE_DECODE_ENABLE;
+ if (!conf || conf->ide1_enable)
+ reg16 |= IDE_DECODE_ENABLE;
+ printk(BIOS_DEBUG, "IDE: %s: %s\n", "Primary IDE interface",
+ conf->ide0_enable ? "on" : "off");
+ pci_write_config16(dev, IDE_TIM_SEC, reg16);
}
static struct device_operations ide_ops = {
@@ -69,17 +60,16 @@ static struct device_operations ide_ops = {
.enable = i82801ax_enable,
};
-/* 82801AA */
+/* 82801AA (ICH) */
static const struct pci_driver i82801aa_ide __pci_driver = {
.ops = &ide_ops,
.vendor = PCI_VENDOR_ID_INTEL,
.device = 0x2411,
};
-/* 82801AB */
+/* 82801AB (ICH0) */
static const struct pci_driver i82801ab_ide __pci_driver = {
.ops = &ide_ops,
.vendor = PCI_VENDOR_ID_INTEL,
.device = 0x2421,
};
-