aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ata_piix.c
diff options
context:
space:
mode:
authorJason Gaston <jason.d.gaston@intel.com>2007-10-11 19:05:15 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-15 15:44:20 -0400
commit8f73a6880183dd11b97d70e738cf82d15931d98b (patch)
tree6cf36f9db1b38478e7b80f289e0d5d7ff11983a7 /drivers/ata/ata_piix.c
parent3957df6160c90955979229b230cb5202e6a5ee2b (diff)
ata_piix: SATA 2port controller port map fix
This patch adds a port map for ICH9 and ICH8 SATA controllers that have only 2 ports available in that mode. Signed-off-by: Jason Gaston <jason.d.gaston@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/ata_piix.c')
-rw-r--r--drivers/ata/ata_piix.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 9ce4aa9c2f25..3c6f43e381f4 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -130,6 +130,7 @@ enum {
130 ich8_sata_ahci = 9, 130 ich8_sata_ahci = 9,
131 piix_pata_mwdma = 10, /* PIIX3 MWDMA only */ 131 piix_pata_mwdma = 10, /* PIIX3 MWDMA only */
132 tolapai_sata_ahci = 11, 132 tolapai_sata_ahci = 11,
133 ich9_2port_sata = 12,
133 134
134 /* constants for mapping table */ 135 /* constants for mapping table */
135 P0 = 0, /* port 0 */ 136 P0 = 0, /* port 0 */
@@ -238,19 +239,19 @@ static const struct pci_device_id piix_pci_tbl[] = {
238 /* SATA Controller 1 IDE (ICH8) */ 239 /* SATA Controller 1 IDE (ICH8) */
239 { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 240 { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
240 /* SATA Controller 2 IDE (ICH8) */ 241 /* SATA Controller 2 IDE (ICH8) */
241 { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 242 { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
242 /* Mobile SATA Controller IDE (ICH8M) */ 243 /* Mobile SATA Controller IDE (ICH8M) */
243 { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 244 { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
244 /* SATA Controller IDE (ICH9) */ 245 /* SATA Controller IDE (ICH9) */
245 { 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 246 { 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
246 /* SATA Controller IDE (ICH9) */ 247 /* SATA Controller IDE (ICH9) */
247 { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 248 { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
248 /* SATA Controller IDE (ICH9) */ 249 /* SATA Controller IDE (ICH9) */
249 { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 250 { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
250 /* SATA Controller IDE (ICH9M) */ 251 /* SATA Controller IDE (ICH9M) */
251 { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 252 { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
252 /* SATA Controller IDE (ICH9M) */ 253 /* SATA Controller IDE (ICH9M) */
253 { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 254 { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
254 /* SATA Controller IDE (ICH9M) */ 255 /* SATA Controller IDE (ICH9M) */
255 { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 256 { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
256 /* SATA Controller IDE (Tolapai) */ 257 /* SATA Controller IDE (Tolapai) */
@@ -448,6 +449,18 @@ static const struct piix_map_db tolapai_map_db = {
448 }, 449 },
449}; 450};
450 451
452static const struct piix_map_db ich9_2port_map_db = {
453 .mask = 0x3,
454 .port_enable = 0x3,
455 .map = {
456 /* PM PS SM SS MAP */
457 { P0, NA, P1, NA }, /* 00b */
458 { RV, RV, RV, RV }, /* 01b */
459 { RV, RV, RV, RV }, /* 10b */
460 { RV, RV, RV, RV },
461 },
462};
463
451static const struct piix_map_db *piix_map_db_table[] = { 464static const struct piix_map_db *piix_map_db_table[] = {
452 [ich5_sata] = &ich5_map_db, 465 [ich5_sata] = &ich5_map_db,
453 [ich6_sata] = &ich6_map_db, 466 [ich6_sata] = &ich6_map_db,
@@ -455,6 +468,7 @@ static const struct piix_map_db *piix_map_db_table[] = {
455 [ich6m_sata_ahci] = &ich6m_map_db, 468 [ich6m_sata_ahci] = &ich6m_map_db,
456 [ich8_sata_ahci] = &ich8_map_db, 469 [ich8_sata_ahci] = &ich8_map_db,
457 [tolapai_sata_ahci] = &tolapai_map_db, 470 [tolapai_sata_ahci] = &tolapai_map_db,
471 [ich9_2port_sata] = &ich9_2port_map_db,
458}; 472};
459 473
460static struct ata_port_info piix_port_info[] = { 474static struct ata_port_info piix_port_info[] = {
@@ -570,6 +584,17 @@ static struct ata_port_info piix_port_info[] = {
570 .udma_mask = ATA_UDMA6, 584 .udma_mask = ATA_UDMA6,
571 .port_ops = &piix_sata_ops, 585 .port_ops = &piix_sata_ops,
572 }, 586 },
587
588 [ich9_2port_sata] =
589 {
590 .sht = &piix_sht,
591 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
592 PIIX_FLAG_AHCI,
593 .pio_mask = 0x1f, /* pio0-4 */
594 .mwdma_mask = 0x07, /* mwdma0-2 */
595 .udma_mask = ATA_UDMA6,
596 .port_ops = &piix_sata_ops,
597 },
573}; 598};
574 599
575static struct pci_bits piix_enable_bits[] = { 600static struct pci_bits piix_enable_bits[] = {