diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-29 13:48:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-29 13:48:21 -0400 |
commit | f73b0a08eae0e28c50db5dd5ab8245546918bfb6 (patch) | |
tree | eddc8c063acc7c70a975a0dadf26655159704b22 /drivers/pci | |
parent | 6b06d2cc6d52830e3e0c001006b26255f47184dd (diff) | |
parent | 225036314e768bbfe8331ea9b0e91ca101afe427 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (86 commits)
SPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c
drivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n
pata_hpt37x: Further small fixes
pata_hpt3x2n: Add HPT371N support and other bits
ata: printk warning fixes
libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET
ahci: consolidate common port flags
ata_timing: ensure t->cycle is always correct
libata: add missing call to ->cable_detect() in new EH path
pata_amd: remove contamination added during cable_detect conversion
libata: Handle drives that require a spin-up command before first access
libata: HPA support
libata: kill probe_ent and related helpers
libata: convert the remaining PATA drivers to new init model
libata: convert the remaining SATA drivers to new init model
libata: convert ata_pci_init_native_mode() users to new init model
libata: convert drivers with combined SATA/PATA ports to new init model
libata: add init helpers including ata_pci_prepare_native_host()
libata: convert native PCI host handling to new init model
libata: convert legacy PCI host handling to new init model
...
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/quirks.c | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 65d6f23ead41..3411483240cd 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1303,119 +1303,6 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev) | |||
1303 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); | 1303 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); |
1304 | #endif | 1304 | #endif |
1305 | 1305 | ||
1306 | enum ide_combined_type { COMBINED = 0, IDE = 1, LIBATA = 2 }; | ||
1307 | /* Defaults to combined */ | ||
1308 | static enum ide_combined_type combined_mode; | ||
1309 | |||
1310 | static int __init combined_setup(char *str) | ||
1311 | { | ||
1312 | if (!strncmp(str, "ide", 3)) | ||
1313 | combined_mode = IDE; | ||
1314 | else if (!strncmp(str, "libata", 6)) | ||
1315 | combined_mode = LIBATA; | ||
1316 | else /* "combined" or anything else defaults to old behavior */ | ||
1317 | combined_mode = COMBINED; | ||
1318 | |||
1319 | return 1; | ||
1320 | } | ||
1321 | __setup("combined_mode=", combined_setup); | ||
1322 | |||
1323 | #ifdef CONFIG_SATA_INTEL_COMBINED | ||
1324 | static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev) | ||
1325 | { | ||
1326 | u8 prog, comb, tmp; | ||
1327 | int ich = 0; | ||
1328 | |||
1329 | /* | ||
1330 | * Narrow down to Intel SATA PCI devices. | ||
1331 | */ | ||
1332 | switch (pdev->device) { | ||
1333 | /* PCI ids taken from drivers/scsi/ata_piix.c */ | ||
1334 | case 0x24d1: | ||
1335 | case 0x24df: | ||
1336 | case 0x25a3: | ||
1337 | case 0x25b0: | ||
1338 | ich = 5; | ||
1339 | break; | ||
1340 | case 0x2651: | ||
1341 | case 0x2652: | ||
1342 | case 0x2653: | ||
1343 | case 0x2680: /* ESB2 */ | ||
1344 | ich = 6; | ||
1345 | break; | ||
1346 | case 0x27c0: | ||
1347 | case 0x27c4: | ||
1348 | ich = 7; | ||
1349 | break; | ||
1350 | case 0x2828: /* ICH8M */ | ||
1351 | ich = 8; | ||
1352 | break; | ||
1353 | default: | ||
1354 | /* we do not handle this PCI device */ | ||
1355 | return; | ||
1356 | } | ||
1357 | |||
1358 | /* | ||
1359 | * Read combined mode register. | ||
1360 | */ | ||
1361 | pci_read_config_byte(pdev, 0x90, &tmp); /* combined mode reg */ | ||
1362 | |||
1363 | if (ich == 5) { | ||
1364 | tmp &= 0x6; /* interesting bits 2:1, PATA primary/secondary */ | ||
1365 | if (tmp == 0x4) /* bits 10x */ | ||
1366 | comb = (1 << 0); /* SATA port 0, PATA port 1 */ | ||
1367 | else if (tmp == 0x6) /* bits 11x */ | ||
1368 | comb = (1 << 2); /* PATA port 0, SATA port 1 */ | ||
1369 | else | ||
1370 | return; /* not in combined mode */ | ||
1371 | } else { | ||
1372 | WARN_ON((ich != 6) && (ich != 7) && (ich != 8)); | ||
1373 | tmp &= 0x3; /* interesting bits 1:0 */ | ||
1374 | if (tmp & (1 << 0)) | ||
1375 | comb = (1 << 2); /* PATA port 0, SATA port 1 */ | ||
1376 | else if (tmp & (1 << 1)) | ||
1377 | comb = (1 << 0); /* SATA port 0, PATA port 1 */ | ||
1378 | else | ||
1379 | return; /* not in combined mode */ | ||
1380 | } | ||
1381 | |||
1382 | /* | ||
1383 | * Read programming interface register. | ||
1384 | * (Tells us if it's legacy or native mode) | ||
1385 | */ | ||
1386 | pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog); | ||
1387 | |||
1388 | /* if SATA port is in native mode, we're ok. */ | ||
1389 | if (prog & comb) | ||
1390 | return; | ||
1391 | |||
1392 | /* Don't reserve any so the IDE driver can get them (but only if | ||
1393 | * combined_mode=ide). | ||
1394 | */ | ||
1395 | if (combined_mode == IDE) | ||
1396 | return; | ||
1397 | |||
1398 | /* Grab them both for libata if combined_mode=libata. */ | ||
1399 | if (combined_mode == LIBATA) { | ||
1400 | request_region(0x1f0, 8, "libata"); /* port 0 */ | ||
1401 | request_region(0x170, 8, "libata"); /* port 1 */ | ||
1402 | return; | ||
1403 | } | ||
1404 | |||
1405 | /* SATA port is in legacy mode. Reserve port so that | ||
1406 | * IDE driver does not attempt to use it. If request_region | ||
1407 | * fails, it will be obvious at boot time, so we don't bother | ||
1408 | * checking return values. | ||
1409 | */ | ||
1410 | if (comb == (1 << 0)) | ||
1411 | request_region(0x1f0, 8, "libata"); /* port 0 */ | ||
1412 | else | ||
1413 | request_region(0x170, 8, "libata"); /* port 1 */ | ||
1414 | } | ||
1415 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_intel_ide_combined ); | ||
1416 | #endif /* CONFIG_SATA_INTEL_COMBINED */ | ||
1417 | |||
1418 | |||
1419 | int pcie_mch_quirk; | 1306 | int pcie_mch_quirk; |
1420 | EXPORT_SYMBOL(pcie_mch_quirk); | 1307 | EXPORT_SYMBOL(pcie_mch_quirk); |
1421 | 1308 | ||