Skip to contentSkip to conversation

ACPI driver support for pata

PATCH New Alan 1 participant 1 message Feb 20, 2007 libata

lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH 1/1 ACPI driver support for pata

- Add a driver for motherboard ACPI method devices
- Link it after normal drivers so ACPI is not preferred
- Hook the AMD driver to prefer ACPI for the Nvidia devices if ACPI is active
- While we are at it fix up the simplex clear the AMD driver.

Depends upon the set_mode -> do_set_mode wrapper patch

drivers/ata/Kconfig +9 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-mm2/drivers/ata/Kconfig linux-2.6.20-mm2/drivers/ata/Kconfig
@@ -174,6 +174,15 @@
 	  You can disable this at kernel boot time by using the
 	  option libata.noacpi=1
 
+config PATA_ACPI
+	tristate "ACPI firmware driver for PATA"
+	depends on ACPI && PCI && SATA_ACPI
+	help
+	  This option enables an ACPI method driver which drives
+	  motherboard PATA controller interfaces through the ACPI
+	  firmware in the BIOS. This driver can sometimes handle
+	  otherwise unsupported hardware.
+
 config PATA_ALI
 	tristate "ALi PATA support (Experimental)"
 	depends on PCI && EXPERIMENTAL
drivers/ata/libata-acpi.c +86 -1

96 lines not on this page · raw message

drivers/ata/libata-acpi.h +47 -0

47 lines not on this page · raw message

drivers/ata/Makefile +2 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-mm2/drivers/ata/Makefile linux-2.6.20-mm2/drivers/ata/Makefile
@@ -60,6 +60,8 @@
 obj-$(CONFIG_PATA_TRIFLEX)	+= pata_triflex.o
 obj-$(CONFIG_PATA_IXP4XX_CF)	+= pata_ixp4xx_cf.o
 obj-$(CONFIG_PATA_PLATFORM)	+= pata_platform.o
+# Should be last but two libata driver
+obj-$(CONFIG_PATA_ACPI)		+= pata_acpi.o
 # Should be last but one libata driver
 obj-$(CONFIG_ATA_GENERIC)	+= ata_generic.o
 # Should be last libata driver
drivers/ata/pata_acpi.c +392 -0

392 lines not on this page · raw message

drivers/ata/pata_amd.c +8 -5
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-mm2/drivers/ata/pata_amd.c linux-2.6.20-mm2/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_amd"
-#define DRV_VERSION "0.2.7"
+#define DRV_VERSION "0.2.9"
 
 /**
  *	timing_setup		-	shared timing computation and load
@@ -642,6 +642,11 @@
 	if (type == 1 && rev > 0x7)
 		type = 2;
 
+#if defined(CONFIG_ATA_ACPI)
+	/* Prefer the ACPI driver for Nvidia hardware */
+	if (pdev->vendor == PCI_VENDOR_ID_NVIDIA && ata_pata_acpi_present(pdev))
+		return -ENODEV;
+#endif		
 	/* Check for AMD7411 */
 	if (type == 3)
 		/* FIFO is broken */
@@ -654,7 +659,7 @@
 			 pdev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
 		type = 6;	/* UDMA 100 only */
 
-	if (type < 3)
+	if (type < 7)
 		ata_pci_clear_simplex(pdev);
 
 	/* And fire it up */
@@ -673,9 +678,7 @@
 			pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
 		else
 			pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
-		if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
-		    pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
-		    	ata_pci_clear_simplex(pdev);
+	    	ata_pci_clear_simplex(pdev);
 	}
 	return ata_pci_device_resume(pdev);
 }