Commit 049a1ca4 authored by Jeff Garzik's avatar Jeff Garzik

[libata] transfer mode cleanup

Add MWDMA support, and rework pio/mwdma/udma mode setup.

In the lone test case for PATA support, ata_piix, MWDMA mode setting
does not appear to work here.  UDMA and PIO continue to work, so nobody
will really notice.  But beware.  Probably a driver problem, not
a bug in the core.

Also, doesn't bother writing to dummy timing registers on ICH5/6 SATA
anymore.
parent 2b50a905
...@@ -65,10 +65,8 @@ static int piix_init_one (struct pci_dev *pdev, ...@@ -65,10 +65,8 @@ static int piix_init_one (struct pci_dev *pdev,
static void piix_pata_phy_reset(struct ata_port *ap); static void piix_pata_phy_reset(struct ata_port *ap);
static void piix_sata_phy_reset(struct ata_port *ap); static void piix_sata_phy_reset(struct ata_port *ap);
static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev, static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev);
unsigned int pio); static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
static void piix_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma);
static unsigned int in_module_init = 1; static unsigned int in_module_init = 1;
...@@ -126,7 +124,7 @@ static Scsi_Host_Template piix_sht = { ...@@ -126,7 +124,7 @@ static Scsi_Host_Template piix_sht = {
static struct ata_port_operations piix_pata_ops = { static struct ata_port_operations piix_pata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.set_piomode = piix_set_piomode, .set_piomode = piix_set_piomode,
.set_udmamode = piix_set_udmamode, .set_dmamode = piix_set_dmamode,
.tf_load = ata_tf_load_pio, .tf_load = ata_tf_load_pio,
.tf_read = ata_tf_read_pio, .tf_read = ata_tf_read_pio,
...@@ -151,8 +149,6 @@ static struct ata_port_operations piix_pata_ops = { ...@@ -151,8 +149,6 @@ static struct ata_port_operations piix_pata_ops = {
static struct ata_port_operations piix_sata_ops = { static struct ata_port_operations piix_sata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.set_piomode = piix_set_piomode,
.set_udmamode = piix_set_udmamode,
.tf_load = ata_tf_load_pio, .tf_load = ata_tf_load_pio,
.tf_read = ata_tf_read_pio, .tf_read = ata_tf_read_pio,
...@@ -181,7 +177,12 @@ static struct ata_port_info piix_port_info[] = { ...@@ -181,7 +177,12 @@ static struct ata_port_info piix_port_info[] = {
.sht = &piix_sht, .sht = &piix_sht,
.host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST | .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST |
PIIX_FLAG_CHECKINTR, PIIX_FLAG_CHECKINTR,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
#if 0
.mwdma_mask = 0x06, /* mwdma1-2 */
#else
.mwdma_mask = 0x00, /* mwdma broken */
#endif
.udma_mask = ATA_UDMA_MASK_40C, /* FIXME: cbl det */ .udma_mask = ATA_UDMA_MASK_40C, /* FIXME: cbl det */
.port_ops = &piix_pata_ops, .port_ops = &piix_pata_ops,
}, },
...@@ -191,8 +192,9 @@ static struct ata_port_info piix_port_info[] = { ...@@ -191,8 +192,9 @@ static struct ata_port_info piix_port_info[] = {
.sht = &piix_sht, .sht = &piix_sht,
.host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST | .host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST |
PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR, PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
.udma_mask = 0x7f, /* udma0-6 ; FIXME */ .mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x7f, /* udma0-6 */
.port_ops = &piix_sata_ops, .port_ops = &piix_sata_ops,
}, },
...@@ -200,7 +202,12 @@ static struct ata_port_info piix_port_info[] = { ...@@ -200,7 +202,12 @@ static struct ata_port_info piix_port_info[] = {
{ {
.sht = &piix_sht, .sht = &piix_sht,
.host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
#if 0
.mwdma_mask = 0x06, /* mwdma1-2 */
#else
.mwdma_mask = 0x00, /* mwdma broken */
#endif
.udma_mask = ATA_UDMA_MASK_40C, /* FIXME: cbl det */ .udma_mask = ATA_UDMA_MASK_40C, /* FIXME: cbl det */
.port_ops = &piix_pata_ops, .port_ops = &piix_pata_ops,
}, },
...@@ -211,8 +218,9 @@ static struct ata_port_info piix_port_info[] = { ...@@ -211,8 +218,9 @@ static struct ata_port_info piix_port_info[] = {
.host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST | .host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST |
PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR | PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR |
ATA_FLAG_SLAVE_POSS, ATA_FLAG_SLAVE_POSS,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
.udma_mask = 0x7f, /* udma0-6 ; FIXME */ .mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x7f, /* udma0-6 */
.port_ops = &piix_sata_ops, .port_ops = &piix_sata_ops,
}, },
}; };
...@@ -368,9 +376,9 @@ static void piix_sata_phy_reset(struct ata_port *ap) ...@@ -368,9 +376,9 @@ static void piix_sata_phy_reset(struct ata_port *ap)
* None (inherited from caller). * None (inherited from caller).
*/ */
static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev, static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
unsigned int pio)
{ {
unsigned int pio = adev->pio_mode;
struct pci_dev *dev = ap->host_set->pdev; struct pci_dev *dev = ap->host_set->pdev;
unsigned int is_slave = (adev->flags & ATA_DFLAG_MASTER) ? 0 : 1; unsigned int is_slave = (adev->flags & ATA_DFLAG_MASTER) ? 0 : 1;
unsigned int master_port= ap->port_no ? 0x42 : 0x40; unsigned int master_port= ap->port_no ? 0x42 : 0x40;
...@@ -409,7 +417,7 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev, ...@@ -409,7 +417,7 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev,
} }
/** /**
* piix_set_udmamode - Initialize host controller PATA PIO timings * piix_set_dmamode - Initialize host controller PATA PIO timings
* @ap: Port whose timings we are configuring * @ap: Port whose timings we are configuring
* @adev: um * @adev: um
* @udma: udma mode, 0 - 6 * @udma: udma mode, 0 - 6
...@@ -420,9 +428,9 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev, ...@@ -420,9 +428,9 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev,
* None (inherited from caller). * None (inherited from caller).
*/ */
static void piix_set_udmamode (struct ata_port *ap, struct ata_device *adev, static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev)
unsigned int udma)
{ {
unsigned int udma = adev->dma_mode; /* FIXME: MWDMA too */
struct pci_dev *dev = ap->host_set->pdev; struct pci_dev *dev = ap->host_set->pdev;
u8 maslave = ap->port_no ? 0x42 : 0x40; u8 maslave = ap->port_no ? 0x42 : 0x40;
u8 speed = udma; u8 speed = udma;
...@@ -452,25 +460,38 @@ static void piix_set_udmamode (struct ata_port *ap, struct ata_device *adev, ...@@ -452,25 +460,38 @@ static void piix_set_udmamode (struct ata_port *ap, struct ata_device *adev,
case XFER_UDMA_3: case XFER_UDMA_3:
case XFER_UDMA_1: u_speed = 1 << (drive_dn * 4); break; case XFER_UDMA_1: u_speed = 1 << (drive_dn * 4); break;
case XFER_UDMA_0: u_speed = 0 << (drive_dn * 4); break; case XFER_UDMA_0: u_speed = 0 << (drive_dn * 4); break;
case XFER_MW_DMA_2:
case XFER_MW_DMA_1: break;
default: default:
BUG(); BUG();
return; return;
} }
if (!(reg48 & u_flag)) if (speed >= XFER_UDMA_0) {
pci_write_config_byte(dev, 0x48, reg48 | u_flag); if (!(reg48 & u_flag))
if (speed == XFER_UDMA_5) { pci_write_config_byte(dev, 0x48, reg48 | u_flag);
pci_write_config_byte(dev, 0x55, (u8) reg55|w_flag); if (speed == XFER_UDMA_5) {
pci_write_config_byte(dev, 0x55, (u8) reg55|w_flag);
} else {
pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
}
if ((reg4a & a_speed) != u_speed)
pci_write_config_word(dev, 0x4a, (reg4a & ~a_speed) | u_speed);
if (speed > XFER_UDMA_2) {
if (!(reg54 & v_flag))
pci_write_config_byte(dev, 0x54, reg54 | v_flag);
} else
pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
} else { } else {
pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); if (reg48 & u_flag)
pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
if (reg4a & a_speed)
pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);
if (reg54 & v_flag)
pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
if (reg55 & w_flag)
pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
} }
if ((reg4a & a_speed) != u_speed)
pci_write_config_word(dev, 0x4a, (reg4a & ~a_speed) | u_speed);
if (speed > XFER_UDMA_2) {
if (!(reg54 & v_flag))
pci_write_config_byte(dev, 0x54, reg54 | v_flag);
} else
pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
} }
/* move to PCI layer, integrate w/ MSI stuff */ /* move to PCI layer, integrate w/ MSI stuff */
......
This diff is collapsed.
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#define NV_PORTS 2 #define NV_PORTS 2
#define NV_PIO_MASK 0x1f #define NV_PIO_MASK 0x1f
#define NV_MWDMA_MASK 0x07
#define NV_UDMA_MASK 0x7f #define NV_UDMA_MASK 0x7f
#define NV_PORT0_BMDMA_REG_OFFSET 0x00 #define NV_PORT0_BMDMA_REG_OFFSET 0x00
#define NV_PORT1_BMDMA_REG_OFFSET 0x08 #define NV_PORT1_BMDMA_REG_OFFSET 0x08
...@@ -289,6 +290,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -289,6 +290,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
probe_ent->irq = pdev->irq; probe_ent->irq = pdev->irq;
probe_ent->irq_flags = SA_SHIRQ; probe_ent->irq_flags = SA_SHIRQ;
probe_ent->pio_mask = NV_PIO_MASK; probe_ent->pio_mask = NV_PIO_MASK;
probe_ent->mwdma_mask = NV_MWDMA_MASK;
probe_ent->udma_mask = NV_UDMA_MASK; probe_ent->udma_mask = NV_UDMA_MASK;
probe_ent->port[0].cmd_addr = pci_resource_start(pdev, 0); probe_ent->port[0].cmd_addr = pci_resource_start(pdev, 0);
......
...@@ -130,7 +130,8 @@ static struct ata_port_info pdc_port_info[] = { ...@@ -130,7 +130,8 @@ static struct ata_port_info pdc_port_info[] = {
.sht = &pdc_sata_sht, .sht = &pdc_sata_sht,
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_SRST | ATA_FLAG_MMIO, ATA_FLAG_SRST | ATA_FLAG_MMIO,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x7f, /* udma0-6 ; FIXME */ .udma_mask = 0x7f, /* udma0-6 ; FIXME */
.port_ops = &pdc_sata_ops, .port_ops = &pdc_sata_ops,
}, },
...@@ -140,7 +141,8 @@ static struct ata_port_info pdc_port_info[] = { ...@@ -140,7 +141,8 @@ static struct ata_port_info pdc_port_info[] = {
.sht = &pdc_sata_sht, .sht = &pdc_sata_sht,
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_SRST | ATA_FLAG_MMIO, ATA_FLAG_SRST | ATA_FLAG_MMIO,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x7f, /* udma0-6 ; FIXME */ .udma_mask = 0x7f, /* udma0-6 ; FIXME */
.port_ops = &pdc_sata_ops, .port_ops = &pdc_sata_ops,
}, },
...@@ -601,6 +603,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * ...@@ -601,6 +603,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
probe_ent->sht = pdc_port_info[board_idx].sht; probe_ent->sht = pdc_port_info[board_idx].sht;
probe_ent->host_flags = pdc_port_info[board_idx].host_flags; probe_ent->host_flags = pdc_port_info[board_idx].host_flags;
probe_ent->pio_mask = pdc_port_info[board_idx].pio_mask; probe_ent->pio_mask = pdc_port_info[board_idx].pio_mask;
probe_ent->mwdma_mask = pdc_port_info[board_idx].mwdma_mask;
probe_ent->udma_mask = pdc_port_info[board_idx].udma_mask; probe_ent->udma_mask = pdc_port_info[board_idx].udma_mask;
probe_ent->port_ops = pdc_port_info[board_idx].port_ops; probe_ent->port_ops = pdc_port_info[board_idx].port_ops;
......
...@@ -149,7 +149,8 @@ static struct ata_port_info sil_port_info[] = { ...@@ -149,7 +149,8 @@ static struct ata_port_info sil_port_info[] = {
.sht = &sil_sht, .sht = &sil_sht,
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_SRST | ATA_FLAG_MMIO, ATA_FLAG_SRST | ATA_FLAG_MMIO,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x3f, /* udma0-5 */ .udma_mask = 0x3f, /* udma0-5 */
.port_ops = &sil_ops, .port_ops = &sil_ops,
}, /* sil_3114 */ }, /* sil_3114 */
...@@ -157,7 +158,8 @@ static struct ata_port_info sil_port_info[] = { ...@@ -157,7 +158,8 @@ static struct ata_port_info sil_port_info[] = {
.sht = &sil_sht, .sht = &sil_sht,
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_SRST | ATA_FLAG_MMIO, ATA_FLAG_SRST | ATA_FLAG_MMIO,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x3f, /* udma0-5 */ .udma_mask = 0x3f, /* udma0-5 */
.port_ops = &sil_ops, .port_ops = &sil_ops,
}, },
...@@ -363,6 +365,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -363,6 +365,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
probe_ent->sht = sil_port_info[ent->driver_data].sht; probe_ent->sht = sil_port_info[ent->driver_data].sht;
probe_ent->n_ports = (ent->driver_data == sil_3114) ? 4 : 2; probe_ent->n_ports = (ent->driver_data == sil_3114) ? 4 : 2;
probe_ent->pio_mask = sil_port_info[ent->driver_data].pio_mask; probe_ent->pio_mask = sil_port_info[ent->driver_data].pio_mask;
probe_ent->mwdma_mask = sil_port_info[ent->driver_data].mwdma_mask;
probe_ent->udma_mask = sil_port_info[ent->driver_data].udma_mask; probe_ent->udma_mask = sil_port_info[ent->driver_data].udma_mask;
probe_ent->irq = pdev->irq; probe_ent->irq = pdev->irq;
probe_ent->irq_flags = SA_SHIRQ; probe_ent->irq_flags = SA_SHIRQ;
......
...@@ -230,7 +230,8 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -230,7 +230,8 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
probe_ent->host_flags |= SIS_FLAG_CFGSCR; probe_ent->host_flags |= SIS_FLAG_CFGSCR;
} }
probe_ent->pio_mask = 0x03; probe_ent->pio_mask = 0x1f;
probe_ent->mwdma_mask = 0x7;
probe_ent->udma_mask = 0x7f; probe_ent->udma_mask = 0x7f;
probe_ent->port_ops = &sis_ops; probe_ent->port_ops = &sis_ops;
......
...@@ -343,6 +343,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e ...@@ -343,6 +343,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
* if we don't fill these * if we don't fill these
*/ */
probe_ent->pio_mask = 0x1f; probe_ent->pio_mask = 0x1f;
probe_ent->mwdma_mask = 0x7;
probe_ent->udma_mask = 0x7f; probe_ent->udma_mask = 0x7f;
/* We have 4 ports per PCI function */ /* We have 4 ports per PCI function */
......
...@@ -217,7 +217,8 @@ static struct ata_port_info pdc_port_info[] = { ...@@ -217,7 +217,8 @@ static struct ata_port_info pdc_port_info[] = {
.sht = &pdc_sata_sht, .sht = &pdc_sata_sht,
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_SRST | ATA_FLAG_MMIO, ATA_FLAG_SRST | ATA_FLAG_MMIO,
.pio_mask = 0x03, /* pio3-4 */ .pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x7f, /* udma0-6 ; FIXME */ .udma_mask = 0x7f, /* udma0-6 ; FIXME */
.port_ops = &pdc_20621_ops, .port_ops = &pdc_20621_ops,
}, },
...@@ -1384,6 +1385,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * ...@@ -1384,6 +1385,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
probe_ent->sht = pdc_port_info[board_idx].sht; probe_ent->sht = pdc_port_info[board_idx].sht;
probe_ent->host_flags = pdc_port_info[board_idx].host_flags; probe_ent->host_flags = pdc_port_info[board_idx].host_flags;
probe_ent->pio_mask = pdc_port_info[board_idx].pio_mask; probe_ent->pio_mask = pdc_port_info[board_idx].pio_mask;
probe_ent->mwdma_mask = pdc_port_info[board_idx].mwdma_mask;
probe_ent->udma_mask = pdc_port_info[board_idx].udma_mask; probe_ent->udma_mask = pdc_port_info[board_idx].udma_mask;
probe_ent->port_ops = pdc_port_info[board_idx].port_ops; probe_ent->port_ops = pdc_port_info[board_idx].port_ops;
......
...@@ -214,6 +214,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -214,6 +214,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
probe_ent->irq = pdev->irq; probe_ent->irq = pdev->irq;
probe_ent->irq_flags = SA_SHIRQ; probe_ent->irq_flags = SA_SHIRQ;
probe_ent->pio_mask = 0x1f; probe_ent->pio_mask = 0x1f;
probe_ent->mwdma_mask = 0x07;
probe_ent->udma_mask = 0x7f; probe_ent->udma_mask = 0x7f;
probe_ent->port[0].cmd_addr = pci_resource_start(pdev, 0); probe_ent->port[0].cmd_addr = pci_resource_start(pdev, 0);
......
...@@ -320,6 +320,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d ...@@ -320,6 +320,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
* if we don't fill these * if we don't fill these
*/ */
probe_ent->pio_mask = 0x1f; probe_ent->pio_mask = 0x1f;
probe_ent->mwdma_mask = 0x07;
probe_ent->udma_mask = 0x7f; probe_ent->udma_mask = 0x7f;
/* We have 4 ports per PCI function */ /* We have 4 ports per PCI function */
......
...@@ -42,6 +42,7 @@ enum { ...@@ -42,6 +42,7 @@ enum {
ATA_ID_SERNO_OFS = 10, ATA_ID_SERNO_OFS = 10,
ATA_ID_MAJOR_VER = 80, ATA_ID_MAJOR_VER = 80,
ATA_ID_PIO_MODES = 64, ATA_ID_PIO_MODES = 64,
ATA_ID_MWDMA_MODES = 63,
ATA_ID_UDMA_MODES = 88, ATA_ID_UDMA_MODES = 88,
ATA_ID_PIO4 = (1 << 1), ATA_ID_PIO4 = (1 << 1),
...@@ -133,8 +134,14 @@ enum { ...@@ -133,8 +134,14 @@ enum {
XFER_UDMA_2 = 0x42, XFER_UDMA_2 = 0x42,
XFER_UDMA_1 = 0x41, XFER_UDMA_1 = 0x41,
XFER_UDMA_0 = 0x40, XFER_UDMA_0 = 0x40,
XFER_MW_DMA_2 = 0x22,
XFER_MW_DMA_1 = 0x21,
XFER_MW_DMA_0 = 0x20,
XFER_PIO_4 = 0x0C, XFER_PIO_4 = 0x0C,
XFER_PIO_3 = 0x0B, XFER_PIO_3 = 0x0B,
XFER_PIO_2 = 0x0A,
XFER_PIO_1 = 0x09,
XFER_PIO_0 = 0x08,
/* ATAPI stuff */ /* ATAPI stuff */
ATAPI_PKT_DMA = (1 << 0), ATAPI_PKT_DMA = (1 << 0),
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
/* /*
* compile-time options * compile-time options
*/ */
#undef ATA_FORCE_PIO /* do not configure or use DMA */
#undef ATA_DEBUG /* debugging output */ #undef ATA_DEBUG /* debugging output */
#undef ATA_VERBOSE_DEBUG /* yet more debugging output */ #undef ATA_VERBOSE_DEBUG /* yet more debugging output */
#undef ATA_IRQ_TRAP /* define to ack screaming irqs */ #undef ATA_IRQ_TRAP /* define to ack screaming irqs */
...@@ -140,6 +139,13 @@ enum { ...@@ -140,6 +139,13 @@ enum {
PORT_UNKNOWN = 0, PORT_UNKNOWN = 0,
PORT_ENABLED = 1, PORT_ENABLED = 1,
PORT_DISABLED = 2, PORT_DISABLED = 2,
/* encoding various smaller bitmaps into a single
* unsigned long bitmap
*/
ATA_SHIFT_UDMA = 0,
ATA_SHIFT_MWDMA = 8,
ATA_SHIFT_PIO = 11,
}; };
enum pio_task_states { enum pio_task_states {
...@@ -188,6 +194,7 @@ struct ata_probe_ent { ...@@ -188,6 +194,7 @@ struct ata_probe_ent {
struct ata_ioports port[ATA_MAX_PORTS]; struct ata_ioports port[ATA_MAX_PORTS];
unsigned int n_ports; unsigned int n_ports;
unsigned int pio_mask; unsigned int pio_mask;
unsigned int mwdma_mask;
unsigned int udma_mask; unsigned int udma_mask;
unsigned int legacy_mode; unsigned int legacy_mode;
unsigned long irq; unsigned long irq;
...@@ -252,7 +259,9 @@ struct ata_device { ...@@ -252,7 +259,9 @@ struct ata_device {
unsigned int devno; /* 0 or 1 */ unsigned int devno; /* 0 or 1 */
u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
unsigned int pio_mode; unsigned int pio_mode;
unsigned int udma_mode; unsigned int dma_mode;
unsigned int xfer_mode;
unsigned int xfer_shift; /* ATA_SHIFT_xxx */
/* cache info about current transfer mode */ /* cache info about current transfer mode */
u8 xfer_protocol; /* taskfile xfer protocol */ u8 xfer_protocol; /* taskfile xfer protocol */
...@@ -277,6 +286,7 @@ struct ata_port { ...@@ -277,6 +286,7 @@ struct ata_port {
unsigned int bus_state; unsigned int bus_state;
unsigned int port_state; unsigned int port_state;
unsigned int pio_mask; unsigned int pio_mask;
unsigned int mwdma_mask;
unsigned int udma_mask; unsigned int udma_mask;
unsigned int cbl; /* cable type; ATA_CBL_xxx */ unsigned int cbl; /* cable type; ATA_CBL_xxx */
...@@ -303,10 +313,8 @@ struct ata_port_operations { ...@@ -303,10 +313,8 @@ struct ata_port_operations {
void (*dev_config) (struct ata_port *, struct ata_device *); void (*dev_config) (struct ata_port *, struct ata_device *);
void (*set_piomode) (struct ata_port *, struct ata_device *, void (*set_piomode) (struct ata_port *, struct ata_device *);
unsigned int); void (*set_dmamode) (struct ata_port *, struct ata_device *);
void (*set_udmamode) (struct ata_port *, struct ata_device *,
unsigned int);
void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf);
void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
...@@ -342,6 +350,7 @@ struct ata_port_info { ...@@ -342,6 +350,7 @@ struct ata_port_info {
Scsi_Host_Template *sht; Scsi_Host_Template *sht;
unsigned long host_flags; unsigned long host_flags;
unsigned long pio_mask; unsigned long pio_mask;
unsigned long mwdma_mask;
unsigned long udma_mask; unsigned long udma_mask;
struct ata_port_operations *port_ops; struct ata_port_operations *port_ops;
}; };
......
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