Anonymous avatar Anonymous committed 06a95ce

Revert rev 1.195 forcing Intel SATA controllers in compat mode into AHCI mode.

This does not work and causes systems to come up without seeing any hard disk(s).

The Intel documentation states that the OS should not be trying to do this, only
the BIOS.

ok dlg@

Comments (0)

Files changed (1)

sys/dev/pci/ahci_pci.c

-/*	$OpenBSD: ahci_pci.c,v 1.1 2013/01/21 11:17:48 patrick Exp $ */
+/*	$OpenBSD: ahci_pci.c,v 1.2 2013/02/19 15:29:27 brad Exp $ */
 
 /*
  * Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
 #define AHCI_PCI_ATI_SB600_LOCKED	0x01
 #define AHCI_PCI_INTERFACE	0x01
 
-#define AHCI_PCI_INTEL_MAP		0x90
-#define AHCI_PCI_INTEL_MAP_SC_4P	0x00
-#define AHCI_PCI_INTEL_MAP_SC_6P	0x20
-#define AHCI_PCI_INTEL_MAP_SMS_IDE	0x00
-#define AHCI_PCI_INTEL_MAP_SMS_AHCI	0x40
-#define AHCI_PCI_INTEL_MAP_SMS_RAID	0x80
-
 struct ahci_pci_softc {
 	struct ahci_softc	psc_ahci;
 
 	    NULL,		ahci_intel_attach },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_EP80579_AHCI,
 	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_3400_SATA_1,
-	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_3400_SATA_2,
-	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_3400_SATA_4,
-	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_3400_SATA_6,
-	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_6SERIES_SATA_1,
-	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_6SERIES_SATA_2,
-	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_7SERIES_SATA_1,
-	    NULL,		ahci_intel_attach },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_7SERIES_SATA_2,
-	    NULL,		ahci_intel_attach },
 
 	{ PCI_VENDOR_VIATECH,	PCI_PRODUCT_VIATECH_VT8251_SATA,
 	  ahci_no_match,	ahci_vt8251_attach }
 int
 ahci_intel_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
 {
-	/* switch from pciide(4) to ahci(4) mode */
-	if (PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_MASS_STORAGE_IDE) {
-		pcireg_t	reg;
-
-		reg = pci_conf_read(pa->pa_pc, pa->pa_tag,
-		    AHCI_PCI_INTEL_MAP);
-		pci_conf_write(pa->pa_pc, pa->pa_tag, AHCI_PCI_INTEL_MAP,
-		    reg | AHCI_PCI_INTEL_MAP_SMS_AHCI |
-		    AHCI_PCI_INTEL_MAP_SC_6P);
-		/* clear BAR since it keeps the old IO value */
-		pci_conf_write(pa->pa_pc, pa->pa_tag,
-		    AHCI_PCI_BAR, 0);
-	}
 	sc->sc_flags |= AHCI_F_NO_PMP;
 	return (0);
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.