aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-08-22 21:15:18 -0400
committerJeff Garzik <jeff@garzik.org>2007-08-31 04:27:47 -0400
commit43a98f05d99205687ddf74089e79a8312c8c5f90 (patch)
treeeeec0745b94e50fbd99baa045b77adfcbc85175a /drivers/ata
parent16c55b038033d8f6f7601996dfae44399666d9ab (diff)
ata_piix: implement IOCFG bit18 quirk
Some notebooks need bit18 of IOCFG to be cleared for the drive bay to work even though the bit is NOOP according to the datasheet. This patch implement IOCFG bit18 quirk and apply it to Clevo M570U. http://bugzilla.kernel.org/show_bug.cgi?id=8051 Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: D. Angelis <dangelis@beta-cae.gr> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ata_piix.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 22752e46b34f..0ff96a06374e 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1173,6 +1173,39 @@ static void __devinit piix_init_sata_map(struct pci_dev *pdev,
1173 hpriv->map = map; 1173 hpriv->map = map;
1174} 1174}
1175 1175
1176static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
1177{
1178 static struct dmi_system_id sysids[] = {
1179 {
1180 /* Clevo M570U sets IOCFG bit 18 if the cdrom
1181 * isn't used to boot the system which
1182 * disables the channel.
1183 */
1184 .ident = "M570U",
1185 .matches = {
1186 DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."),
1187 DMI_MATCH(DMI_PRODUCT_NAME, "M570U"),
1188 },
1189 },
1190 };
1191 u32 iocfg;
1192
1193 if (!dmi_check_system(sysids))
1194 return;
1195
1196 /* The datasheet says that bit 18 is NOOP but certain systems
1197 * seem to use it to disable a channel. Clear the bit on the
1198 * affected systems.
1199 */
1200 pci_read_config_dword(pdev, PIIX_IOCFG, &iocfg);
1201 if (iocfg & (1 << 18)) {
1202 dev_printk(KERN_INFO, &pdev->dev,
1203 "applying IOCFG bit18 quirk\n");
1204 iocfg &= ~(1 << 18);
1205 pci_write_config_dword(pdev, PIIX_IOCFG, iocfg);
1206 }
1207}
1208
1176/** 1209/**
1177 * piix_init_one - Register PIIX ATA PCI device with kernel services 1210 * piix_init_one - Register PIIX ATA PCI device with kernel services
1178 * @pdev: PCI device to register 1211 * @pdev: PCI device to register
@@ -1234,6 +1267,9 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1234 piix_map_db_table[ent->driver_data]); 1267 piix_map_db_table[ent->driver_data]);
1235 } 1268 }
1236 1269
1270 /* apply IOCFG bit18 quirk */
1271 piix_iocfg_bit18_quirk(pdev);
1272
1237 /* On ICH5, some BIOSen disable the interrupt using the 1273 /* On ICH5, some BIOSen disable the interrupt using the
1238 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3. 1274 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3.
1239 * On ICH6, this bit has the same effect, but only when 1275 * On ICH6, this bit has the same effect, but only when