public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Add Legacy IDE mode support for SB600 SATA
@ 2006-11-03 18:54 Luugi Marsan
  2006-11-03 19:30 ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Luugi Marsan @ 2006-11-03 18:54 UTC (permalink / raw)
  To: linux-kernel

From: conke.hu@amd.com

ATI SB600 SATA controller supports 4 modes: Legacy IDE, Native IDE, AHCI and RAID.IDE modes are used for compatibility with some old OS without AHCI driver,but now they are not necessary for Linux since the kernel has supported AHCI.Some BIOS set Legacy IDE as SB600 SATA's default mode, but the AHCI driver cannot run in Legacy IDE.So, we should set the controller back to AHCI mode if it has been set as IDE by BIOS.

Signed-off-by:  Luugi Marsan <luugi.marsan@amd.com>

--- linux-2.6.19-rc4-git5/drivers/pci/quirks.c.orig     2006-11-04 03:50:25.000000000 +0800
+++ linux-2.6.19-rc4-git5/drivers/pci/quirks.c  2006-11-04 03:53:56.000000000 +0800
@@ -796,6 +796,35 @@ static void __init quirk_mediagx_master(
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CYRIX,   PCI_DEVICE_ID_CYRIX_PCI_MASTER, quirk_mediagx_master );
 
+
+/*
+ * ATI SB600 SATA controller supports 4 modes: Legacy IDE, Native IDE, AHCI
+ * and RAID.
+ * IDE modes are used for compatibility with some old OS without AHCI driver,
+ * but now they are not necessary for Linux since the kernel has supported
+ * AHCI.
+ * Some BIOS set Legacy IDE as SB600 SATA's default mode, but the AHCI driver
+ * cannot run in Legacy IDE.
+ * So, we should set the controller back to AHCI mode if it has been set as IDE
+ * by BIOS.
+ */
+static void __devinit quirk_sb600_sata(struct pci_dev *pdev)
+{
+       if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE)
+       {
+               u8 tmp;
+
+               pci_read_config_byte(pdev, 0x40, &tmp);
+               pci_write_config_byte(pdev, 0x40, tmp|1);
+               pci_write_config_byte(pdev, 0x9, 1);
+               pci_write_config_byte(pdev, 0xa, 6);
+               pci_write_config_byte(pdev, 0x40, tmp);
+              
+               pdev->class = 0x010601;
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata);
+
 /*
  * As per PCI spec, ignore base address registers 0-3 of the IDE controllers
  * running in Compatible mode (bits 0 and 2 in the ProgIf for primary and 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-11-05 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-03 18:54 [PATCH 1/2] Add Legacy IDE mode support for SB600 SATA Luugi Marsan
2006-11-03 19:30 ` Alan Cox
2006-11-05 12:17   ` Conke Hu
2006-11-05 12:45     ` Alan Cox
2006-11-05 13:38       ` Conke Hu
2006-11-05 15:08         ` Alan Cox
2006-11-05 13:10     ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox