Lines Matching full:ap
314 * ap->private_data
332 static void sil24_pmp_attach(struct ata_port *ap);
333 static void sil24_pmp_detach(struct ata_port *ap);
334 static void sil24_freeze(struct ata_port *ap);
335 static void sil24_thaw(struct ata_port *ap);
342 static void sil24_error_handler(struct ata_port *ap);
344 static int sil24_port_start(struct ata_port *ap);
350 static int sil24_port_resume(struct ata_port *ap);
462 static unsigned long sil24_port_offset(struct ata_port *ap) in sil24_port_offset() argument
464 return ap->port_no * PORT_REGS_SIZE; in sil24_port_offset()
467 static void __iomem *sil24_port_base(struct ata_port *ap) in sil24_port_base() argument
469 return ap->host->iomap[SIL24_PORT_BAR] + sil24_port_offset(ap); in sil24_port_base()
474 void __iomem *port = sil24_port_base(dev->link->ap); in sil24_dev_config()
482 static void sil24_read_tf(struct ata_port *ap, int tag, struct ata_taskfile *tf) in sil24_read_tf() argument
484 void __iomem *port = sil24_port_base(ap); in sil24_read_tf()
502 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; in sil24_scr_read()
513 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; in sil24_scr_write()
522 static void sil24_config_port(struct ata_port *ap) in sil24_config_port() argument
524 void __iomem *port = sil24_port_base(ap); in sil24_config_port()
527 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) in sil24_config_port()
547 static void sil24_config_pmp(struct ata_port *ap, int attached) in sil24_config_pmp() argument
549 void __iomem *port = sil24_port_base(ap); in sil24_config_pmp()
557 static void sil24_clear_pmp(struct ata_port *ap) in sil24_clear_pmp() argument
559 void __iomem *port = sil24_port_base(ap); in sil24_clear_pmp()
572 static int sil24_init_port(struct ata_port *ap) in sil24_init_port() argument
574 void __iomem *port = sil24_port_base(ap); in sil24_init_port()
575 struct sil24_port_priv *pp = ap->private_data; in sil24_init_port()
579 if (sata_pmp_attached(ap)) in sil24_init_port()
580 sil24_clear_pmp(ap); in sil24_init_port()
583 ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_init_port()
585 tmp = ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_init_port()
590 ap->link.eh_context.i.action |= ATA_EH_RESET; in sil24_init_port()
597 static int sil24_exec_polled_cmd(struct ata_port *ap, int pmp, in sil24_exec_polled_cmd() argument
602 void __iomem *port = sil24_port_base(ap); in sil24_exec_polled_cmd()
603 struct sil24_port_priv *pp = ap->private_data; in sil24_exec_polled_cmd()
625 irq_stat = ata_wait_register(ap, port + PORT_IRQ_STAT, irq_mask, 0x0, in sil24_exec_polled_cmd()
635 sil24_init_port(ap); in sil24_exec_polled_cmd()
652 struct ata_port *ap = link->ap; in sil24_softreset() local
660 if (sil24_init_port(ap)) { in sil24_softreset()
670 rc = sil24_exec_polled_cmd(ap, pmp, &tf, 0, PRB_CTRL_SRST, in sil24_softreset()
680 sil24_read_tf(ap, 0, &tf); in sil24_softreset()
681 *class = ata_port_classify(ap, &tf); in sil24_softreset()
693 struct ata_port *ap = link->ap; in sil24_hardreset() local
694 void __iomem *port = sil24_port_base(ap); in sil24_hardreset()
695 struct sil24_port_priv *pp = ap->private_data; in sil24_hardreset()
706 ata_port_warn(ap, in sil24_hardreset()
710 ata_msleep(ap, 10); in sil24_hardreset()
712 ata_wait_register(ap, port + PORT_CTRL_STAT, PORT_CS_RDY, 0, in sil24_hardreset()
716 sil24_config_port(ap); in sil24_hardreset()
717 sil24_config_pmp(ap, ap->nr_pmp_links); in sil24_hardreset()
731 tmp = ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_hardreset()
791 struct ata_port *ap = link->ap; in sil24_qc_defer() local
816 if (unlikely(ap->excl_link)) { in sil24_qc_defer()
817 if (link == ap->excl_link) { in sil24_qc_defer()
818 if (ap->nr_active_links) in sil24_qc_defer()
824 ap->excl_link = link; in sil24_qc_defer()
825 if (ap->nr_active_links) in sil24_qc_defer()
835 struct ata_port *ap = qc->ap; in sil24_qc_prep() local
836 struct sil24_port_priv *pp = ap->private_data; in sil24_qc_prep()
883 struct ata_port *ap = qc->ap; in sil24_qc_issue() local
884 struct sil24_port_priv *pp = ap->private_data; in sil24_qc_issue()
885 void __iomem *port = sil24_port_base(ap); in sil24_qc_issue()
906 sil24_read_tf(qc->ap, qc->hw_tag, &qc->result_tf); in sil24_qc_fill_rtf()
909 static void sil24_pmp_attach(struct ata_port *ap) in sil24_pmp_attach() argument
911 u32 *gscr = ap->link.device->gscr; in sil24_pmp_attach()
913 sil24_config_pmp(ap, 1); in sil24_pmp_attach()
914 sil24_init_port(ap); in sil24_pmp_attach()
918 ata_port_info(ap, in sil24_pmp_attach()
920 ap->flags &= ~ATA_FLAG_NCQ; in sil24_pmp_attach()
924 static void sil24_pmp_detach(struct ata_port *ap) in sil24_pmp_detach() argument
926 sil24_init_port(ap); in sil24_pmp_detach()
927 sil24_config_pmp(ap, 0); in sil24_pmp_detach()
929 ap->flags |= ATA_FLAG_NCQ; in sil24_pmp_detach()
937 rc = sil24_init_port(link->ap); in sil24_pmp_hardreset()
946 static void sil24_freeze(struct ata_port *ap) in sil24_freeze() argument
948 void __iomem *port = sil24_port_base(ap); in sil24_freeze()
956 static void sil24_thaw(struct ata_port *ap) in sil24_thaw() argument
958 void __iomem *port = sil24_port_base(ap); in sil24_thaw()
969 static void sil24_error_intr(struct ata_port *ap) in sil24_error_intr() argument
971 void __iomem *port = sil24_port_base(ap); in sil24_error_intr()
972 struct sil24_port_priv *pp = ap->private_data; in sil24_error_intr()
984 link = &ap->link; in sil24_error_intr()
992 sata_async_notification(ap); in sil24_error_intr()
1024 if (ap->nr_active_links >= 3) { in sil24_error_intr()
1033 if (sata_pmp_attached(ap)) { in sil24_error_intr()
1037 if (pmp < ap->nr_pmp_links) { in sil24_error_intr()
1038 link = &ap->pmp_link[pmp]; in sil24_error_intr()
1040 qc = ata_qc_from_tag(ap, link->active_tag); in sil24_error_intr()
1051 qc = ata_qc_from_tag(ap, link->active_tag); in sil24_error_intr()
1081 if (sata_pmp_attached(ap)) in sil24_error_intr()
1087 ata_port_freeze(ap); in sil24_error_intr()
1092 ata_port_abort(ap); in sil24_error_intr()
1096 static inline void sil24_host_intr(struct ata_port *ap) in sil24_host_intr() argument
1098 void __iomem *port = sil24_port_base(ap); in sil24_host_intr()
1109 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) in sil24_host_intr()
1115 sil24_error_intr(ap); in sil24_host_intr()
1120 rc = ata_qc_complete_multiple(ap, qc_active); in sil24_host_intr()
1124 struct ata_eh_info *ehi = &ap->link.eh_info; in sil24_host_intr()
1127 ata_port_freeze(ap); in sil24_host_intr()
1132 if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) in sil24_host_intr()
1133 ata_port_info(ap, in sil24_host_intr()
1135 slot_stat, ap->link.active_tag, ap->link.sactive); in sil24_host_intr()
1170 static void sil24_error_handler(struct ata_port *ap) in sil24_error_handler() argument
1172 struct sil24_port_priv *pp = ap->private_data; in sil24_error_handler()
1174 if (sil24_init_port(ap)) in sil24_error_handler()
1175 ata_eh_freeze_port(ap); in sil24_error_handler()
1177 sata_pmp_error_handler(ap); in sil24_error_handler()
1184 struct ata_port *ap = qc->ap; in sil24_post_internal_cmd() local
1187 if ((qc->flags & ATA_QCFLAG_EH) && sil24_init_port(ap)) in sil24_post_internal_cmd()
1188 ata_eh_freeze_port(ap); in sil24_post_internal_cmd()
1191 static int sil24_port_start(struct ata_port *ap) in sil24_port_start() argument
1193 struct device *dev = ap->host->dev; in sil24_port_start()
1210 ap->private_data = pp; in sil24_port_start()
1212 ata_port_pbar_desc(ap, SIL24_HOST_BAR, -1, "host"); in sil24_port_start()
1213 ata_port_pbar_desc(ap, SIL24_PORT_BAR, sil24_port_offset(ap), "port"); in sil24_port_start()
1232 struct ata_port *ap = host->ports[i]; in sil24_init_controller() local
1233 void __iomem *port = sil24_port_base(ap); in sil24_init_controller()
1252 sil24_config_port(ap); in sil24_init_controller()
1351 static int sil24_port_resume(struct ata_port *ap) in sil24_port_resume() argument
1353 sil24_config_pmp(ap, ap->nr_pmp_links); in sil24_port_resume()