aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_sx4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_sx4.c')
-rw-r--r--drivers/ata/sata_sx4.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 0da83cba5c12..091867e10ea3 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -160,7 +160,7 @@ static void pdc_port_stop(struct ata_port *ap);
160static void pdc20621_qc_prep(struct ata_queued_cmd *qc); 160static void pdc20621_qc_prep(struct ata_queued_cmd *qc);
161static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf); 161static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
162static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf); 162static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
163static void pdc20621_host_stop(struct ata_host_set *host_set); 163static void pdc20621_host_stop(struct ata_host *host);
164static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe); 164static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe);
165static int pdc20621_detect_dimm(struct ata_probe_ent *pe); 165static int pdc20621_detect_dimm(struct ata_probe_ent *pe);
166static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, 166static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe,
@@ -218,7 +218,7 @@ static const struct ata_port_info pdc_port_info[] = {
218 /* board_20621 */ 218 /* board_20621 */
219 { 219 {
220 .sht = &pdc_sata_sht, 220 .sht = &pdc_sata_sht,
221 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 221 .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
222 ATA_FLAG_SRST | ATA_FLAG_MMIO | 222 ATA_FLAG_SRST | ATA_FLAG_MMIO |
223 ATA_FLAG_NO_ATAPI | ATA_FLAG_PIO_POLLING, 223 ATA_FLAG_NO_ATAPI | ATA_FLAG_PIO_POLLING,
224 .pio_mask = 0x1f, /* pio0-4 */ 224 .pio_mask = 0x1f, /* pio0-4 */
@@ -244,21 +244,21 @@ static struct pci_driver pdc_sata_pci_driver = {
244}; 244};
245 245
246 246
247static void pdc20621_host_stop(struct ata_host_set *host_set) 247static void pdc20621_host_stop(struct ata_host *host)
248{ 248{
249 struct pci_dev *pdev = to_pci_dev(host_set->dev); 249 struct pci_dev *pdev = to_pci_dev(host->dev);
250 struct pdc_host_priv *hpriv = host_set->private_data; 250 struct pdc_host_priv *hpriv = host->private_data;
251 void __iomem *dimm_mmio = hpriv->dimm_mmio; 251 void __iomem *dimm_mmio = hpriv->dimm_mmio;
252 252
253 pci_iounmap(pdev, dimm_mmio); 253 pci_iounmap(pdev, dimm_mmio);
254 kfree(hpriv); 254 kfree(hpriv);
255 255
256 pci_iounmap(pdev, host_set->mmio_base); 256 pci_iounmap(pdev, host->mmio_base);
257} 257}
258 258
259static int pdc_port_start(struct ata_port *ap) 259static int pdc_port_start(struct ata_port *ap)
260{ 260{
261 struct device *dev = ap->host_set->dev; 261 struct device *dev = ap->host->dev;
262 struct pdc_port_priv *pp; 262 struct pdc_port_priv *pp;
263 int rc; 263 int rc;
264 264
@@ -293,7 +293,7 @@ err_out:
293 293
294static void pdc_port_stop(struct ata_port *ap) 294static void pdc_port_stop(struct ata_port *ap)
295{ 295{
296 struct device *dev = ap->host_set->dev; 296 struct device *dev = ap->host->dev;
297 struct pdc_port_priv *pp = ap->private_data; 297 struct pdc_port_priv *pp = ap->private_data;
298 298
299 ap->private_data = NULL; 299 ap->private_data = NULL;
@@ -453,8 +453,8 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc)
453 struct scatterlist *sg; 453 struct scatterlist *sg;
454 struct ata_port *ap = qc->ap; 454 struct ata_port *ap = qc->ap;
455 struct pdc_port_priv *pp = ap->private_data; 455 struct pdc_port_priv *pp = ap->private_data;
456 void __iomem *mmio = ap->host_set->mmio_base; 456 void __iomem *mmio = ap->host->mmio_base;
457 struct pdc_host_priv *hpriv = ap->host_set->private_data; 457 struct pdc_host_priv *hpriv = ap->host->private_data;
458 void __iomem *dimm_mmio = hpriv->dimm_mmio; 458 void __iomem *dimm_mmio = hpriv->dimm_mmio;
459 unsigned int portno = ap->port_no; 459 unsigned int portno = ap->port_no;
460 unsigned int i, idx, total_len = 0, sgt_len; 460 unsigned int i, idx, total_len = 0, sgt_len;
@@ -514,8 +514,8 @@ static void pdc20621_nodata_prep(struct ata_queued_cmd *qc)
514{ 514{
515 struct ata_port *ap = qc->ap; 515 struct ata_port *ap = qc->ap;
516 struct pdc_port_priv *pp = ap->private_data; 516 struct pdc_port_priv *pp = ap->private_data;
517 void __iomem *mmio = ap->host_set->mmio_base; 517 void __iomem *mmio = ap->host->mmio_base;
518 struct pdc_host_priv *hpriv = ap->host_set->private_data; 518 struct pdc_host_priv *hpriv = ap->host->private_data;
519 void __iomem *dimm_mmio = hpriv->dimm_mmio; 519 void __iomem *dimm_mmio = hpriv->dimm_mmio;
520 unsigned int portno = ap->port_no; 520 unsigned int portno = ap->port_no;
521 unsigned int i; 521 unsigned int i;
@@ -565,8 +565,8 @@ static void __pdc20621_push_hdma(struct ata_queued_cmd *qc,
565 u32 pkt_ofs) 565 u32 pkt_ofs)
566{ 566{
567 struct ata_port *ap = qc->ap; 567 struct ata_port *ap = qc->ap;
568 struct ata_host_set *host_set = ap->host_set; 568 struct ata_host *host = ap->host;
569 void __iomem *mmio = host_set->mmio_base; 569 void __iomem *mmio = host->mmio_base;
570 570
571 /* hard-code chip #0 */ 571 /* hard-code chip #0 */
572 mmio += PDC_CHIP0_OFS; 572 mmio += PDC_CHIP0_OFS;
@@ -583,7 +583,7 @@ static void pdc20621_push_hdma(struct ata_queued_cmd *qc,
583 u32 pkt_ofs) 583 u32 pkt_ofs)
584{ 584{
585 struct ata_port *ap = qc->ap; 585 struct ata_port *ap = qc->ap;
586 struct pdc_host_priv *pp = ap->host_set->private_data; 586 struct pdc_host_priv *pp = ap->host->private_data;
587 unsigned int idx = pp->hdma_prod & PDC_HDMA_Q_MASK; 587 unsigned int idx = pp->hdma_prod & PDC_HDMA_Q_MASK;
588 588
589 if (!pp->doing_hdma) { 589 if (!pp->doing_hdma) {
@@ -601,7 +601,7 @@ static void pdc20621_push_hdma(struct ata_queued_cmd *qc,
601static void pdc20621_pop_hdma(struct ata_queued_cmd *qc) 601static void pdc20621_pop_hdma(struct ata_queued_cmd *qc)
602{ 602{
603 struct ata_port *ap = qc->ap; 603 struct ata_port *ap = qc->ap;
604 struct pdc_host_priv *pp = ap->host_set->private_data; 604 struct pdc_host_priv *pp = ap->host->private_data;
605 unsigned int idx = pp->hdma_cons & PDC_HDMA_Q_MASK; 605 unsigned int idx = pp->hdma_cons & PDC_HDMA_Q_MASK;
606 606
607 /* if nothing on queue, we're done */ 607 /* if nothing on queue, we're done */
@@ -620,7 +620,7 @@ static void pdc20621_dump_hdma(struct ata_queued_cmd *qc)
620{ 620{
621 struct ata_port *ap = qc->ap; 621 struct ata_port *ap = qc->ap;
622 unsigned int port_no = ap->port_no; 622 unsigned int port_no = ap->port_no;
623 struct pdc_host_priv *hpriv = ap->host_set->private_data; 623 struct pdc_host_priv *hpriv = ap->host->private_data;
624 void *dimm_mmio = hpriv->dimm_mmio; 624 void *dimm_mmio = hpriv->dimm_mmio;
625 625
626 dimm_mmio += (port_no * PDC_DIMM_WINDOW_STEP); 626 dimm_mmio += (port_no * PDC_DIMM_WINDOW_STEP);
@@ -638,9 +638,9 @@ static inline void pdc20621_dump_hdma(struct ata_queued_cmd *qc) { }
638static void pdc20621_packet_start(struct ata_queued_cmd *qc) 638static void pdc20621_packet_start(struct ata_queued_cmd *qc)
639{ 639{
640 struct ata_port *ap = qc->ap; 640 struct ata_port *ap = qc->ap;
641 struct ata_host_set *host_set = ap->host_set; 641 struct ata_host *host = ap->host;
642 unsigned int port_no = ap->port_no; 642 unsigned int port_no = ap->port_no;
643 void __iomem *mmio = host_set->mmio_base; 643 void __iomem *mmio = host->mmio_base;
644 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); 644 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
645 u8 seq = (u8) (port_no + 1); 645 u8 seq = (u8) (port_no + 1);
646 unsigned int port_ofs; 646 unsigned int port_ofs;
@@ -781,8 +781,8 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
781 781
782static void pdc20621_irq_clear(struct ata_port *ap) 782static void pdc20621_irq_clear(struct ata_port *ap)
783{ 783{
784 struct ata_host_set *host_set = ap->host_set; 784 struct ata_host *host = ap->host;
785 void __iomem *mmio = host_set->mmio_base; 785 void __iomem *mmio = host->mmio_base;
786 786
787 mmio += PDC_CHIP0_OFS; 787 mmio += PDC_CHIP0_OFS;
788 788
@@ -791,7 +791,7 @@ static void pdc20621_irq_clear(struct ata_port *ap)
791 791
792static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_regs *regs) 792static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
793{ 793{
794 struct ata_host_set *host_set = dev_instance; 794 struct ata_host *host = dev_instance;
795 struct ata_port *ap; 795 struct ata_port *ap;
796 u32 mask = 0; 796 u32 mask = 0;
797 unsigned int i, tmp, port_no; 797 unsigned int i, tmp, port_no;
@@ -800,12 +800,12 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_re
800 800
801 VPRINTK("ENTER\n"); 801 VPRINTK("ENTER\n");
802 802
803 if (!host_set || !host_set->mmio_base) { 803 if (!host || !host->mmio_base) {
804 VPRINTK("QUICK EXIT\n"); 804 VPRINTK("QUICK EXIT\n");
805 return IRQ_NONE; 805 return IRQ_NONE;
806 } 806 }
807 807
808 mmio_base = host_set->mmio_base; 808 mmio_base = host->mmio_base;
809 809
810 /* reading should also clear interrupts */ 810 /* reading should also clear interrupts */
811 mmio_base += PDC_CHIP0_OFS; 811 mmio_base += PDC_CHIP0_OFS;
@@ -822,16 +822,16 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_re
822 return IRQ_NONE; 822 return IRQ_NONE;
823 } 823 }
824 824
825 spin_lock(&host_set->lock); 825 spin_lock(&host->lock);
826 826
827 for (i = 1; i < 9; i++) { 827 for (i = 1; i < 9; i++) {
828 port_no = i - 1; 828 port_no = i - 1;
829 if (port_no > 3) 829 if (port_no > 3)
830 port_no -= 4; 830 port_no -= 4;
831 if (port_no >= host_set->n_ports) 831 if (port_no >= host->n_ports)
832 ap = NULL; 832 ap = NULL;
833 else 833 else
834 ap = host_set->ports[port_no]; 834 ap = host->ports[port_no];
835 tmp = mask & (1 << i); 835 tmp = mask & (1 << i);
836 VPRINTK("seq %u, port_no %u, ap %p, tmp %x\n", i, port_no, ap, tmp); 836 VPRINTK("seq %u, port_no %u, ap %p, tmp %x\n", i, port_no, ap, tmp);
837 if (tmp && ap && 837 if (tmp && ap &&
@@ -845,7 +845,7 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_re
845 } 845 }
846 } 846 }
847 847
848 spin_unlock(&host_set->lock); 848 spin_unlock(&host->lock);
849 849
850 VPRINTK("mask == 0x%x\n", mask); 850 VPRINTK("mask == 0x%x\n", mask);
851 851
@@ -857,13 +857,13 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_re
857static void pdc_eng_timeout(struct ata_port *ap) 857static void pdc_eng_timeout(struct ata_port *ap)
858{ 858{
859 u8 drv_stat; 859 u8 drv_stat;
860 struct ata_host_set *host_set = ap->host_set; 860 struct ata_host *host = ap->host;
861 struct ata_queued_cmd *qc; 861 struct ata_queued_cmd *qc;
862 unsigned long flags; 862 unsigned long flags;
863 863
864 DPRINTK("ENTER\n"); 864 DPRINTK("ENTER\n");
865 865
866 spin_lock_irqsave(&host_set->lock, flags); 866 spin_lock_irqsave(&host->lock, flags);
867 867
868 qc = ata_qc_from_tag(ap, ap->active_tag); 868 qc = ata_qc_from_tag(ap, ap->active_tag);
869 869
@@ -885,7 +885,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
885 break; 885 break;
886 } 886 }
887 887
888 spin_unlock_irqrestore(&host_set->lock, flags); 888 spin_unlock_irqrestore(&host->lock, flags);
889 ata_eh_qc_complete(qc); 889 ata_eh_qc_complete(qc);
890 DPRINTK("EXIT\n"); 890 DPRINTK("EXIT\n");
891} 891}
@@ -1429,7 +1429,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
1429 hpriv->dimm_mmio = dimm_mmio; 1429 hpriv->dimm_mmio = dimm_mmio;
1430 1430
1431 probe_ent->sht = pdc_port_info[board_idx].sht; 1431 probe_ent->sht = pdc_port_info[board_idx].sht;
1432 probe_ent->host_flags = pdc_port_info[board_idx].host_flags; 1432 probe_ent->port_flags = pdc_port_info[board_idx].flags;
1433 probe_ent->pio_mask = pdc_port_info[board_idx].pio_mask; 1433 probe_ent->pio_mask = pdc_port_info[board_idx].pio_mask;
1434 probe_ent->mwdma_mask = pdc_port_info[board_idx].mwdma_mask; 1434 probe_ent->mwdma_mask = pdc_port_info[board_idx].mwdma_mask;
1435 probe_ent->udma_mask = pdc_port_info[board_idx].udma_mask; 1435 probe_ent->udma_mask = pdc_port_info[board_idx].udma_mask;