Lines Matching refs:ap
185 static void scc_set_piomode (struct ata_port *ap, struct ata_device *adev) in scc_set_piomode() argument
188 void __iomem *ctrl_base = ap->host->iomap[SCC_CTRL_BAR]; in scc_set_piomode()
218 static void scc_set_dmamode (struct ata_port *ap, struct ata_device *adev) in scc_set_dmamode() argument
223 void __iomem *ctrl_base = ap->host->iomap[SCC_CTRL_BAR]; in scc_set_dmamode()
277 static void scc_tf_load (struct ata_port *ap, const struct ata_taskfile *tf) in scc_tf_load() argument
279 struct ata_ioports *ioaddr = &ap->ioaddr; in scc_tf_load()
282 if (tf->ctl != ap->last_ctl) { in scc_tf_load()
284 ap->last_ctl = tf->ctl; in scc_tf_load()
285 ata_wait_idle(ap); in scc_tf_load()
321 ata_wait_idle(ap); in scc_tf_load()
331 static u8 scc_check_status (struct ata_port *ap) in scc_check_status() argument
333 return in_be32(ap->ioaddr.status_addr); in scc_check_status()
344 static void scc_tf_read (struct ata_port *ap, struct ata_taskfile *tf) in scc_tf_read() argument
346 struct ata_ioports *ioaddr = &ap->ioaddr; in scc_tf_read()
348 tf->command = scc_check_status(ap); in scc_tf_read()
364 ap->last_ctl = tf->ctl; in scc_tf_read()
376 static void scc_exec_command (struct ata_port *ap, in scc_exec_command() argument
379 DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); in scc_exec_command()
381 out_be32(ap->ioaddr.command_addr, tf->command); in scc_exec_command()
382 ata_sff_pause(ap); in scc_exec_command()
390 static u8 scc_check_altstatus (struct ata_port *ap) in scc_check_altstatus() argument
392 return in_be32(ap->ioaddr.altstatus_addr); in scc_check_altstatus()
403 static void scc_dev_select (struct ata_port *ap, unsigned int device) in scc_dev_select() argument
412 out_be32(ap->ioaddr.device_addr, tmp); in scc_dev_select()
413 ata_sff_pause(ap); in scc_dev_select()
422 static void scc_set_devctl(struct ata_port *ap, u8 ctl) in scc_set_devctl() argument
424 out_be32(ap->ioaddr.ctl_addr, ctl); in scc_set_devctl()
436 struct ata_port *ap = qc->ap; in scc_bmdma_setup() local
439 void __iomem *mmio = ap->ioaddr.bmdma_addr; in scc_bmdma_setup()
442 out_be32(mmio + SCC_DMA_TABLE_OFS, ap->bmdma_prd_dma); in scc_bmdma_setup()
452 ap->ops->sff_exec_command(ap, &qc->tf); in scc_bmdma_setup()
464 struct ata_port *ap = qc->ap; in scc_bmdma_start() local
466 void __iomem *mmio = ap->ioaddr.bmdma_addr; in scc_bmdma_start()
481 static unsigned int scc_devchk (struct ata_port *ap, in scc_devchk() argument
484 struct ata_ioports *ioaddr = &ap->ioaddr; in scc_devchk()
487 ap->ops->sff_dev_select(ap, device); in scc_devchk()
516 struct ata_port *ap = link->ap; in scc_wait_after_reset() local
517 struct ata_ioports *ioaddr = &ap->ioaddr; in scc_wait_after_reset()
532 ata_msleep(ap, 150); in scc_wait_after_reset()
548 ap->ops->sff_dev_select(ap, 1); in scc_wait_after_reset()
561 ata_msleep(ap, 50); /* give drive a breather */ in scc_wait_after_reset()
573 ap->ops->sff_dev_select(ap, 0); in scc_wait_after_reset()
575 ap->ops->sff_dev_select(ap, 1); in scc_wait_after_reset()
577 ap->ops->sff_dev_select(ap, 0); in scc_wait_after_reset()
588 static int scc_bus_softreset(struct ata_port *ap, unsigned int devmask, in scc_bus_softreset() argument
591 struct ata_ioports *ioaddr = &ap->ioaddr; in scc_bus_softreset()
593 DPRINTK("ata%u: bus reset via SRST\n", ap->print_id); in scc_bus_softreset()
596 out_be32(ioaddr->ctl_addr, ap->ctl); in scc_bus_softreset()
598 out_be32(ioaddr->ctl_addr, ap->ctl | ATA_SRST); in scc_bus_softreset()
600 out_be32(ioaddr->ctl_addr, ap->ctl); in scc_bus_softreset()
602 return scc_wait_after_reset(&ap->link, devmask, deadline); in scc_bus_softreset()
617 struct ata_port *ap = link->ap; in scc_softreset() local
618 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; in scc_softreset()
626 if (scc_devchk(ap, 0)) in scc_softreset()
628 if (slave_possible && scc_devchk(ap, 1)) in scc_softreset()
632 ap->ops->sff_dev_select(ap, 0); in scc_softreset()
636 rc = scc_bus_softreset(ap, devmask, deadline); in scc_softreset()
638 ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", rc); in scc_softreset()
643 classes[0] = ata_sff_dev_classify(&ap->link.device[0], in scc_softreset()
646 classes[1] = ata_sff_dev_classify(&ap->link.device[1], in scc_softreset()
660 struct ata_port *ap = qc->ap; in scc_bmdma_stop() local
661 void __iomem *ctrl_base = ap->host->iomap[SCC_CTRL_BAR]; in scc_bmdma_stop()
662 void __iomem *bmid_base = ap->host->iomap[SCC_BMID_BAR]; in scc_bmdma_stop()
709 scc_softreset(&ap->link, &classes, deadline); in scc_bmdma_stop()
735 ata_sff_dma_pause(ap); /* dummy read */ in scc_bmdma_stop()
743 static u8 scc_bmdma_status (struct ata_port *ap) in scc_bmdma_status() argument
745 void __iomem *mmio = ap->ioaddr.bmdma_addr; in scc_bmdma_status()
748 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); in scc_bmdma_status()
756 if ((scc_check_altstatus(ap) & ATA_ERR) in scc_bmdma_status()
769 ap->print_id); in scc_bmdma_status()
772 ap->udma_mask &= ~(1 << qc->dev->xfer_mode); in scc_bmdma_status()
794 struct ata_port *ap = dev->link->ap; in scc_data_xfer() local
798 void __iomem *mmio = ap->ioaddr.data_addr; in scc_data_xfer()
836 struct ata_port *ap = link->ap; in scc_postreset() local
842 ap->ops->sff_dev_select(ap, 1); in scc_postreset()
844 ap->ops->sff_dev_select(ap, 0); in scc_postreset()
853 out_be32(ap->ioaddr.ctl_addr, ap->ctl); in scc_postreset()
865 static void scc_irq_clear (struct ata_port *ap) in scc_irq_clear() argument
867 void __iomem *mmio = ap->ioaddr.bmdma_addr; in scc_irq_clear()
883 static int scc_port_start (struct ata_port *ap) in scc_port_start() argument
885 void __iomem *mmio = ap->ioaddr.bmdma_addr; in scc_port_start()
888 rc = ata_bmdma_port_start(ap); in scc_port_start()
892 out_be32(mmio + SCC_DMA_PTERADD, ap->bmdma_prd_dma); in scc_port_start()
903 static void scc_port_stop (struct ata_port *ap) in scc_port_stop() argument
905 void __iomem *mmio = ap->ioaddr.bmdma_addr; in scc_port_stop()