Commit 00242ec8 authored by Tejun Heo's avatar Tejun Heo

ata_piix: reorganize controller IDs

Move piix_pata_mwdma to top, rename ich9_2port_sata to ich8_2port_sata
for consistency and use automatically incremented values instead of
assigning fixed values to ease adding new controller IDs.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent 1f71d067
...@@ -119,18 +119,18 @@ enum { ...@@ -119,18 +119,18 @@ enum {
PIIX_80C_SEC = (1 << 7) | (1 << 6), PIIX_80C_SEC = (1 << 7) | (1 << 6),
/* controller IDs */ /* controller IDs */
piix_pata_33 = 0, /* PIIX4 at 33Mhz */ piix_pata_mwdma = 0, /* PIIX3 MWDMA only */
ich_pata_33 = 1, /* ICH up to UDMA 33 only */ piix_pata_33, /* PIIX4 at 33Mhz */
ich_pata_66 = 2, /* ICH up to 66 Mhz */ ich_pata_33, /* ICH up to UDMA 33 only */
ich_pata_100 = 3, /* ICH up to UDMA 100 */ ich_pata_66, /* ICH up to 66 Mhz */
ich5_sata = 5, ich_pata_100, /* ICH up to UDMA 100 */
ich6_sata = 6, ich5_sata,
ich6_sata_ahci = 7, ich6_sata,
ich6m_sata_ahci = 8, ich6_sata_ahci,
ich8_sata_ahci = 9, ich6m_sata_ahci,
piix_pata_mwdma = 10, /* PIIX3 MWDMA only */ ich8_sata_ahci,
tolapai_sata_ahci = 11, ich8_2port_sata,
ich9_2port_sata = 12, tolapai_sata_ahci,
/* constants for mapping table */ /* constants for mapping table */
P0 = 0, /* port 0 */ P0 = 0, /* port 0 */
...@@ -239,19 +239,19 @@ static const struct pci_device_id piix_pci_tbl[] = { ...@@ -239,19 +239,19 @@ static const struct pci_device_id piix_pci_tbl[] = {
/* SATA Controller 1 IDE (ICH8) */ /* SATA Controller 1 IDE (ICH8) */
{ 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller 2 IDE (ICH8) */ /* SATA Controller 2 IDE (ICH8) */
{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata }, { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* Mobile SATA Controller IDE (ICH8M) */ /* Mobile SATA Controller IDE (ICH8M) */
{ 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller IDE (ICH9) */ /* SATA Controller IDE (ICH9) */
{ 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, { 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller IDE (ICH9) */ /* SATA Controller IDE (ICH9) */
{ 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata }, { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9) */ /* SATA Controller IDE (ICH9) */
{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata }, { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9M) */ /* SATA Controller IDE (ICH9M) */
{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata }, { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9M) */ /* SATA Controller IDE (ICH9M) */
{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata }, { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9M) */ /* SATA Controller IDE (ICH9M) */
{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller IDE (Tolapai) */ /* SATA Controller IDE (Tolapai) */
...@@ -437,7 +437,7 @@ static const struct piix_map_db ich8_map_db = { ...@@ -437,7 +437,7 @@ static const struct piix_map_db ich8_map_db = {
}, },
}; };
static const struct piix_map_db tolapai_map_db = { static const struct piix_map_db ich8_2port_map_db = {
.mask = 0x3, .mask = 0x3,
.port_enable = 0x3, .port_enable = 0x3,
.map = { .map = {
...@@ -449,7 +449,7 @@ static const struct piix_map_db tolapai_map_db = { ...@@ -449,7 +449,7 @@ static const struct piix_map_db tolapai_map_db = {
}, },
}; };
static const struct piix_map_db ich9_2port_map_db = { static const struct piix_map_db tolapai_map_db = {
.mask = 0x3, .mask = 0x3,
.port_enable = 0x3, .port_enable = 0x3,
.map = { .map = {
...@@ -467,11 +467,20 @@ static const struct piix_map_db *piix_map_db_table[] = { ...@@ -467,11 +467,20 @@ static const struct piix_map_db *piix_map_db_table[] = {
[ich6_sata_ahci] = &ich6_map_db, [ich6_sata_ahci] = &ich6_map_db,
[ich6m_sata_ahci] = &ich6m_map_db, [ich6m_sata_ahci] = &ich6m_map_db,
[ich8_sata_ahci] = &ich8_map_db, [ich8_sata_ahci] = &ich8_map_db,
[ich8_2port_sata] = &ich8_2port_map_db,
[tolapai_sata_ahci] = &tolapai_map_db, [tolapai_sata_ahci] = &tolapai_map_db,
[ich9_2port_sata] = &ich9_2port_map_db,
}; };
static struct ata_port_info piix_port_info[] = { static struct ata_port_info piix_port_info[] = {
[piix_pata_mwdma] = /* PIIX3 MWDMA only */
{
.sht = &piix_sht,
.flags = PIIX_PATA_FLAGS,
.pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
.port_ops = &piix_pata_ops,
},
[piix_pata_33] = /* PIIX4 at 33MHz */ [piix_pata_33] = /* PIIX4 at 33MHz */
{ {
.sht = &piix_sht, .sht = &piix_sht,
...@@ -565,16 +574,7 @@ static struct ata_port_info piix_port_info[] = { ...@@ -565,16 +574,7 @@ static struct ata_port_info piix_port_info[] = {
.port_ops = &piix_sata_ops, .port_ops = &piix_sata_ops,
}, },
[piix_pata_mwdma] = /* PIIX3 MWDMA only */ [ich8_2port_sata] =
{
.sht = &piix_sht,
.flags = PIIX_PATA_FLAGS,
.pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
.port_ops = &piix_pata_ops,
},
[tolapai_sata_ahci] =
{ {
.sht = &piix_sht, .sht = &piix_sht,
.flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
...@@ -585,7 +585,7 @@ static struct ata_port_info piix_port_info[] = { ...@@ -585,7 +585,7 @@ static struct ata_port_info piix_port_info[] = {
.port_ops = &piix_sata_ops, .port_ops = &piix_sata_ops,
}, },
[ich9_2port_sata] = [tolapai_sata_ahci] =
{ {
.sht = &piix_sht, .sht = &piix_sht,
.flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment