Lines Matching full:ap

52 	struct ata_port *ap;  member
126 * @ap: ATA port information
129 static void octeon_cf_set_piomode(struct ata_port *ap, struct ata_device *dev) in octeon_cf_set_piomode() argument
131 struct octeon_cf_port *cf_port = ap->private_data; in octeon_cf_set_piomode()
214 static void octeon_cf_set_dmamode(struct ata_port *ap, struct ata_device *dev) in octeon_cf_set_dmamode() argument
216 struct octeon_cf_port *cf_port = ap->private_data; in octeon_cf_set_dmamode()
298 struct ata_port *ap = qc->dev->link->ap; in octeon_cf_data_xfer8() local
299 void __iomem *data_addr = ap->ioaddr.data_addr; in octeon_cf_data_xfer8()
314 ioread8(ap->ioaddr.altstatus_addr); in octeon_cf_data_xfer8()
337 struct ata_port *ap = qc->dev->link->ap; in octeon_cf_data_xfer16() local
338 void __iomem *data_addr = ap->ioaddr.data_addr; in octeon_cf_data_xfer16()
353 ioread8(ap->ioaddr.altstatus_addr); in octeon_cf_data_xfer16()
382 static void octeon_cf_tf_read16(struct ata_port *ap, struct ata_taskfile *tf) in octeon_cf_tf_read16() argument
386 void __iomem *base = ap->ioaddr.data_addr; in octeon_cf_tf_read16()
404 if (likely(ap->ioaddr.ctl_addr)) { in octeon_cf_tf_read16()
405 iowrite8(tf->ctl | ATA_HOB, ap->ioaddr.ctl_addr); in octeon_cf_tf_read16()
418 iowrite8(tf->ctl, ap->ioaddr.ctl_addr); in octeon_cf_tf_read16()
419 ap->last_ctl = tf->ctl; in octeon_cf_tf_read16()
426 static u8 octeon_cf_check_status16(struct ata_port *ap) in octeon_cf_check_status16() argument
429 void __iomem *base = ap->ioaddr.data_addr; in octeon_cf_check_status16()
438 struct ata_port *ap = link->ap; in octeon_cf_softreset16() local
439 void __iomem *base = ap->ioaddr.data_addr; in octeon_cf_softreset16()
444 __raw_writew(ap->ctl, base + 0xe); in octeon_cf_softreset16()
446 __raw_writew(ap->ctl | ATA_SRST, base + 0xe); in octeon_cf_softreset16()
448 __raw_writew(ap->ctl, base + 0xe); in octeon_cf_softreset16()
466 static void octeon_cf_tf_load16(struct ata_port *ap, in octeon_cf_tf_load16() argument
471 void __iomem *base = ap->ioaddr.data_addr; in octeon_cf_tf_load16()
473 if (tf->ctl != ap->last_ctl) { in octeon_cf_tf_load16()
474 iowrite8(tf->ctl, ap->ioaddr.ctl_addr); in octeon_cf_tf_load16()
475 ap->last_ctl = tf->ctl; in octeon_cf_tf_load16()
476 ata_wait_idle(ap); in octeon_cf_tf_load16()
500 ata_wait_idle(ap); in octeon_cf_tf_load16()
504 static void octeon_cf_dev_select(struct ata_port *ap, unsigned int device) in octeon_cf_dev_select() argument
514 static void octeon_cf_exec_command16(struct ata_port *ap, in octeon_cf_exec_command16() argument
518 void __iomem *base = ap->ioaddr.data_addr; in octeon_cf_exec_command16()
528 DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); in octeon_cf_exec_command16()
533 ata_wait_idle(ap); in octeon_cf_exec_command16()
536 static void octeon_cf_ata_port_noaction(struct ata_port *ap) in octeon_cf_ata_port_noaction() argument
542 struct ata_port *ap = qc->ap; in octeon_cf_dma_setup() local
545 cf_port = ap->private_data; in octeon_cf_dma_setup()
550 ap->ops->sff_exec_command(ap, &qc->tf); in octeon_cf_dma_setup()
561 struct octeon_cf_port *cf_port = qc->ap->private_data; in octeon_cf_dma_start()
621 static unsigned int octeon_cf_dma_finished(struct ata_port *ap, in octeon_cf_dma_finished() argument
624 struct ata_eh_info *ehi = &ap->link.eh_info; in octeon_cf_dma_finished()
625 struct octeon_cf_port *cf_port = ap->private_data; in octeon_cf_dma_finished()
631 ap->print_id, qc->tf.protocol, ap->hsm_task_state); in octeon_cf_dma_finished()
634 if (ap->hsm_task_state != HSM_ST_LAST) in octeon_cf_dma_finished()
641 ap->hsm_task_state = HSM_ST_ERR; in octeon_cf_dma_finished()
657 status = ap->ops->sff_check_status(ap); in octeon_cf_dma_finished()
659 ata_sff_hsm_move(ap, qc, status, 0); in octeon_cf_dma_finished()
684 struct ata_port *ap; in octeon_cf_interrupt() local
689 ap = host->ports[i]; in octeon_cf_interrupt()
690 cf_port = ap->private_data; in octeon_cf_interrupt()
695 qc = ata_qc_from_tag(ap, ap->link.active_tag); in octeon_cf_interrupt()
712 status = ioread8(ap->ioaddr.altstatus_addr); in octeon_cf_interrupt()
731 handled |= octeon_cf_dma_finished(ap, qc); in octeon_cf_interrupt()
744 struct ata_port *ap = cf_port->ap; in octeon_cf_delayed_finish() local
745 struct ata_host *host = ap->host; in octeon_cf_delayed_finish()
758 if (ap->hsm_task_state != HSM_ST_LAST || !cf_port->dma_finished) in octeon_cf_delayed_finish()
761 status = ioread8(ap->ioaddr.altstatus_addr); in octeon_cf_delayed_finish()
769 qc = ata_qc_from_tag(ap, ap->link.active_tag); in octeon_cf_delayed_finish()
771 octeon_cf_dma_finished(ap, qc); in octeon_cf_delayed_finish()
797 struct ata_port *ap = qc->ap; in octeon_cf_qc_issue() local
803 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ in octeon_cf_qc_issue()
806 ap->hsm_task_state = HSM_ST_LAST; in octeon_cf_qc_issue()
810 dev_err(ap->dev, "Error, ATAPI not supported\n"); in octeon_cf_qc_issue()
846 struct ata_port *ap; in octeon_cf_probe() local
938 ap = host->ports[0]; in octeon_cf_probe()
939 ap->private_data = cf_port; in octeon_cf_probe()
941 cf_port->ap = ap; in octeon_cf_probe()
942 ap->ops = &octeon_cf_ops; in octeon_cf_probe()
943 ap->pio_mask = ATA_PIO6; in octeon_cf_probe()
944 ap->flags |= ATA_FLAG_NO_ATAPI | ATA_FLAG_PIO_POLLING; in octeon_cf_probe()
948 ap->ioaddr.cmd_addr = base; in octeon_cf_probe()
949 ata_sff_std_ports(&ap->ioaddr); in octeon_cf_probe()
951 ap->ioaddr.altstatus_addr = base + 0xe; in octeon_cf_probe()
952 ap->ioaddr.ctl_addr = base + 0xe; in octeon_cf_probe()
956 ap->ioaddr.cmd_addr = base + (ATA_REG_CMD << 1) + 1; in octeon_cf_probe()
957 ap->ioaddr.data_addr = base + (ATA_REG_DATA << 1); in octeon_cf_probe()
958 ap->ioaddr.error_addr = base + (ATA_REG_ERR << 1) + 1; in octeon_cf_probe()
959 ap->ioaddr.feature_addr = base + (ATA_REG_FEATURE << 1) + 1; in octeon_cf_probe()
960 ap->ioaddr.nsect_addr = base + (ATA_REG_NSECT << 1) + 1; in octeon_cf_probe()
961 ap->ioaddr.lbal_addr = base + (ATA_REG_LBAL << 1) + 1; in octeon_cf_probe()
962 ap->ioaddr.lbam_addr = base + (ATA_REG_LBAM << 1) + 1; in octeon_cf_probe()
963 ap->ioaddr.lbah_addr = base + (ATA_REG_LBAH << 1) + 1; in octeon_cf_probe()
964 ap->ioaddr.device_addr = base + (ATA_REG_DEVICE << 1) + 1; in octeon_cf_probe()
965 ap->ioaddr.status_addr = base + (ATA_REG_STATUS << 1) + 1; in octeon_cf_probe()
966 ap->ioaddr.command_addr = base + (ATA_REG_CMD << 1) + 1; in octeon_cf_probe()
967 ap->ioaddr.altstatus_addr = cs1 + (6 << 1) + 1; in octeon_cf_probe()
968 ap->ioaddr.ctl_addr = cs1 + (6 << 1) + 1; in octeon_cf_probe()
971 ap->mwdma_mask = enable_dma ? ATA_MWDMA4 : 0; in octeon_cf_probe()
987 ap->ioaddr.data_addr = base + ATA_REG_DATA; in octeon_cf_probe()
988 ap->ioaddr.nsect_addr = base + ATA_REG_NSECT; in octeon_cf_probe()
989 ap->ioaddr.lbal_addr = base + ATA_REG_LBAL; in octeon_cf_probe()
990 ap->ioaddr.ctl_addr = base + 0xe; in octeon_cf_probe()
991 ap->ioaddr.altstatus_addr = base + 0xe; in octeon_cf_probe()
993 cf_port->c0 = ap->ioaddr.ctl_addr; in octeon_cf_probe()
999 ata_port_desc(ap, "cmd %p ctl %p", base, ap->ioaddr.ctl_addr); in octeon_cf_probe()