From 77f3425ba39931e21723c1e933aaea6782d970ac Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 1 Jul 2009 10:36:05 -0700 Subject: [PATCH] AHCI - Move some intel-specific magic writes to intel-specific code. It is unclear if these are needed at all but in any case they only apply to certain Intel chipsets anyway. --- sys/dev/disk/ahci/ahci_attach.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/sys/dev/disk/ahci/ahci_attach.c b/sys/dev/disk/ahci/ahci_attach.c index 7d2ee5c3bb..21b3ca7d95 100644 --- a/sys/dev/disk/ahci/ahci_attach.c +++ b/sys/dev/disk/ahci/ahci_attach.c @@ -54,6 +54,7 @@ static int ahci_vt8251_attach(device_t); static int ahci_ati_sb600_attach(device_t); static int ahci_nvidia_mcp_attach(device_t); +static int ahci_intel_attach(device_t dev); static int ahci_pci_attach(device_t); static int ahci_pci_detach(device_t); @@ -68,6 +69,18 @@ static const struct ahci_device ahci_devices[] = { ahci_nvidia_mcp_attach, ahci_pci_detach, "NVidia-MCP67-SATA" }, { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_5, ahci_nvidia_mcp_attach, ahci_pci_detach, "NVidia-MCP77-SATA" }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GB_S1, + ahci_intel_attach, ahci_pci_detach, "Intel ICH7 82801GB-S1" }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GB_AH, + ahci_intel_attach, ahci_pci_detach, "Intel ICH7 82801GB-AH" }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GB_R1, + ahci_intel_attach, ahci_pci_detach, "Intel ICH7 82801GB-R1" }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GBM_S1, + ahci_intel_attach, ahci_pci_detach, "Intel ICH7 82801GBM-S1" }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GBM_AH, + ahci_intel_attach, ahci_pci_detach, "Intel ICH7 82801GBM-AH" }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GBM_R1, + ahci_intel_attach, ahci_pci_detach, "Intel ICH7 82801GBM-R1" }, { 0, 0, ahci_pci_attach, ahci_pci_detach, "AHCI-PCI-SATA" } }; @@ -148,13 +161,17 @@ ahci_nvidia_mcp_attach(device_t dev) return (ahci_pci_attach(dev)); } -#if 0 +/* + * Do some hocus pocus. Probably more then just the Intel ICH7 parts need + * this. It depends on whether the BIOS sets the chip up properly for + * AHCI operation. + */ static int ahci_intel_attach(device_t dev) { pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0F, 2); + return (ahci_pci_attach(dev)); } -#endif static int ahci_pci_attach(device_t dev) @@ -169,11 +186,11 @@ ahci_pci_attach(device_t dev) const char *revision; if (pci_read_config(dev, PCIR_COMMAND, 2) & 0x0400) { - device_printf(dev, "BIOS disabled PCI interrupt, re-enabling\n"); + device_printf(dev, "BIOS disabled PCI interrupt, " + "re-enabling\n"); pci_write_config(dev, PCIR_COMMAND, pci_read_config(dev, PCIR_COMMAND, 2) & ~0x0400, 2); } - pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0F, 2); /* -- 2.41.0