Lines Matching full:pp
600 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_register_mode() local
601 void __iomem *mmio = pp->ctl_block; in nv_adma_register_mode()
605 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) in nv_adma_register_mode()
633 pp->flags |= NV_ADMA_PORT_REGISTER_MODE; in nv_adma_register_mode()
638 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_mode() local
639 void __iomem *mmio = pp->ctl_block; in nv_adma_mode()
643 if (!(pp->flags & NV_ADMA_PORT_REGISTER_MODE)) in nv_adma_mode()
646 WARN_ON(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE); in nv_adma_mode()
663 pp->flags &= ~NV_ADMA_PORT_REGISTER_MODE; in nv_adma_mode()
670 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_device_configure() local
721 pp->flags &= ~NV_ADMA_ATAPI_SETUP_COMPLETE; in nv_adma_device_configure()
724 pp->flags |= NV_ADMA_ATAPI_SETUP_COMPLETE; in nv_adma_device_configure()
743 rc = dma_set_mask(&pdev->dev, pp->adma_dma_mask); in nv_adma_device_configure()
760 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_check_atapi_dma() local
761 return !(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE); in nv_adma_check_atapi_dma()
812 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_check_cpb() local
813 u8 flags = pp->cpb[cpb_num].resp_flags; in nv_adma_check_cpb()
889 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_interrupt() local
890 void __iomem *mmio = pp->ctl_block; in nv_adma_interrupt()
898 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { in nv_adma_interrupt()
906 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { in nv_adma_interrupt()
922 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL); in nv_adma_interrupt()
1004 struct nv_adma_port_priv *pp = host->ports[0]->private_data; in nv_adma_interrupt() local
1005 writel(notifier_clears[0], pp->notifier_clear_block); in nv_adma_interrupt()
1006 pp = host->ports[1]->private_data; in nv_adma_interrupt()
1007 writel(notifier_clears[1], pp->notifier_clear_block); in nv_adma_interrupt()
1017 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_freeze() local
1018 void __iomem *mmio = pp->ctl_block; in nv_adma_freeze()
1023 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_adma_freeze()
1039 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_thaw() local
1040 void __iomem *mmio = pp->ctl_block; in nv_adma_thaw()
1045 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_adma_thaw()
1057 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_irq_clear() local
1058 void __iomem *mmio = pp->ctl_block; in nv_adma_irq_clear()
1061 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { in nv_adma_irq_clear()
1082 pp = ap->host->ports[0]->private_data; in nv_adma_irq_clear()
1083 writel(notifier_clears[0], pp->notifier_clear_block); in nv_adma_irq_clear()
1084 pp = ap->host->ports[1]->private_data; in nv_adma_irq_clear()
1085 writel(notifier_clears[1], pp->notifier_clear_block); in nv_adma_irq_clear()
1090 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_post_internal_cmd() local
1092 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) in nv_adma_post_internal_cmd()
1099 struct nv_adma_port_priv *pp; in nv_adma_port_start() local
1120 pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); in nv_adma_port_start()
1121 if (!pp) in nv_adma_port_start()
1126 pp->ctl_block = mmio; in nv_adma_port_start()
1127 pp->gen_block = ap->host->iomap[NV_MMIO_BAR] + NV_ADMA_GEN; in nv_adma_port_start()
1128 pp->notifier_clear_block = pp->gen_block + in nv_adma_port_start()
1137 pp->adma_dma_mask = *dev->dma_mask; in nv_adma_port_start()
1149 pp->cpb = mem; in nv_adma_port_start()
1150 pp->cpb_dma = mem_dma; in nv_adma_port_start()
1161 pp->aprd = mem; in nv_adma_port_start()
1162 pp->aprd_dma = mem_dma; in nv_adma_port_start()
1164 ap->private_data = pp; in nv_adma_port_start()
1170 pp->flags = NV_ADMA_PORT_REGISTER_MODE; in nv_adma_port_start()
1192 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_port_stop() local
1193 void __iomem *mmio = pp->ctl_block; in nv_adma_port_stop()
1201 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_port_suspend() local
1202 void __iomem *mmio = pp->ctl_block; in nv_adma_port_suspend()
1218 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_port_resume() local
1219 void __iomem *mmio = pp->ctl_block; in nv_adma_port_resume()
1223 writel(pp->cpb_dma & 0xFFFFFFFF, mmio + NV_ADMA_CPB_BASE_LOW); in nv_adma_port_resume()
1224 writel((pp->cpb_dma >> 16) >> 16, mmio + NV_ADMA_CPB_BASE_HIGH); in nv_adma_port_resume()
1230 pp->flags |= NV_ADMA_PORT_REGISTER_MODE; in nv_adma_port_resume()
1315 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_fill_sg() local
1322 &pp->aprd[NV_ADMA_SGTBL_LEN * qc->hw_tag + (si-5)]; in nv_adma_fill_sg()
1326 cpb->next_aprd = cpu_to_le64(((u64)(pp->aprd_dma + NV_ADMA_SGTBL_SZ * qc->hw_tag))); in nv_adma_fill_sg()
1333 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_use_reg_mode() local
1337 if ((pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) || in nv_adma_use_reg_mode()
1350 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_qc_prep() local
1351 struct nv_adma_cpb *cpb = &pp->cpb[qc->hw_tag]; in nv_adma_qc_prep()
1356 BUG_ON(!(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) && in nv_adma_qc_prep()
1396 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_qc_issue() local
1397 void __iomem *mmio = pp->ctl_block; in nv_adma_qc_issue()
1411 BUG_ON(!(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) && in nv_adma_qc_issue()
1422 if (curr_ncq != pp->last_issue_ncq) { in nv_adma_qc_issue()
1426 pp->last_issue_ncq = curr_ncq; in nv_adma_qc_issue()
1630 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_error_handler() local
1631 if (!(pp->flags & NV_ADMA_PORT_REGISTER_MODE)) { in nv_adma_error_handler()
1632 void __iomem *mmio = pp->ctl_block; in nv_adma_error_handler()
1639 u32 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL); in nv_adma_error_handler()
1652 struct nv_adma_cpb *cpb = &pp->cpb[i]; in nv_adma_error_handler()
1667 pp->cpb[i].ctl_flags &= ~NV_CPB_CTL_CPB_VALID; in nv_adma_error_handler()
1686 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_qc_to_dq() local
1687 struct defer_queue *dq = &pp->defer_queue; in nv_swncq_qc_to_dq()
1697 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_qc_from_dq() local
1698 struct defer_queue *dq = &pp->defer_queue; in nv_swncq_qc_from_dq()
1714 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_fis_reinit() local
1716 pp->dhfis_bits = 0; in nv_swncq_fis_reinit()
1717 pp->dmafis_bits = 0; in nv_swncq_fis_reinit()
1718 pp->sdbfis_bits = 0; in nv_swncq_fis_reinit()
1719 pp->ncq_flags = 0; in nv_swncq_fis_reinit()
1724 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_pp_reinit() local
1725 struct defer_queue *dq = &pp->defer_queue; in nv_swncq_pp_reinit()
1730 pp->qc_active = 0; in nv_swncq_pp_reinit()
1731 pp->last_issue_tag = ATA_TAG_POISON; in nv_swncq_pp_reinit()
1737 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_irq_clear() local
1739 writew(fis, pp->irq_block); in nv_swncq_irq_clear()
1752 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_ncq_stop() local
1762 pp->qc_active, pp->defer_queue.defer_bits, pp->last_issue_tag, in nv_swncq_ncq_stop()
1763 pp->dhfis_bits, pp->dmafis_bits, pp->sdbfis_bits); in nv_swncq_ncq_stop()
1769 sactive = readl(pp->sactive_block); in nv_swncq_ncq_stop()
1770 done_mask = pp->qc_active ^ sactive; in nv_swncq_ncq_stop()
1775 if (pp->qc_active & (1 << i)) in nv_swncq_ncq_stop()
1784 (pp->dhfis_bits >> i) & 0x1, in nv_swncq_ncq_stop()
1785 (pp->dmafis_bits >> i) & 0x1, in nv_swncq_ncq_stop()
1786 (pp->sdbfis_bits >> i) & 0x1, in nv_swncq_ncq_stop()
1925 struct nv_swncq_port_priv *pp; in nv_swncq_port_start() local
1933 pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); in nv_swncq_port_start()
1934 if (!pp) in nv_swncq_port_start()
1937 pp->prd = dmam_alloc_coherent(dev, ATA_PRD_TBL_SZ * ATA_MAX_QUEUE, in nv_swncq_port_start()
1938 &pp->prd_dma, GFP_KERNEL); in nv_swncq_port_start()
1939 if (!pp->prd) in nv_swncq_port_start()
1942 ap->private_data = pp; in nv_swncq_port_start()
1943 pp->sactive_block = ap->ioaddr.scr_addr + 4 * SCR_ACTIVE; in nv_swncq_port_start()
1944 pp->irq_block = mmio + NV_INT_STATUS_MCP55 + ap->port_no * 2; in nv_swncq_port_start()
1945 pp->tag_block = mmio + NV_NCQ_REG_MCP55 + ap->port_no * 2; in nv_swncq_port_start()
1969 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_fill_sg() local
1973 prd = pp->prd + ATA_MAX_PRD * qc->hw_tag; in nv_swncq_fill_sg()
2004 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_issue_atacmd() local
2009 writel((1 << qc->hw_tag), pp->sactive_block); in nv_swncq_issue_atacmd()
2010 pp->last_issue_tag = qc->hw_tag; in nv_swncq_issue_atacmd()
2011 pp->dhfis_bits &= ~(1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2012 pp->dmafis_bits &= ~(1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2013 pp->qc_active |= (0x1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2026 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_qc_issue() local
2031 if (!pp->qc_active) in nv_swncq_qc_issue()
2067 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_sdbfis() local
2088 sactive = readl(pp->sactive_block); in nv_swncq_sdbfis()
2089 done_mask = pp->qc_active ^ sactive; in nv_swncq_sdbfis()
2091 pp->qc_active &= ~done_mask; in nv_swncq_sdbfis()
2092 pp->dhfis_bits &= ~done_mask; in nv_swncq_sdbfis()
2093 pp->dmafis_bits &= ~done_mask; in nv_swncq_sdbfis()
2094 pp->sdbfis_bits |= done_mask; in nv_swncq_sdbfis()
2103 if (pp->qc_active & pp->dhfis_bits) in nv_swncq_sdbfis()
2106 if ((pp->ncq_flags & ncq_saw_backout) || in nv_swncq_sdbfis()
2107 (pp->qc_active ^ pp->dhfis_bits)) in nv_swncq_sdbfis()
2116 ap->qc_active, pp->qc_active, in nv_swncq_sdbfis()
2117 pp->defer_queue.defer_bits, pp->dhfis_bits, in nv_swncq_sdbfis()
2118 pp->dmafis_bits, pp->last_issue_tag); in nv_swncq_sdbfis()
2123 qc = ata_qc_from_tag(ap, pp->last_issue_tag); in nv_swncq_sdbfis()
2128 if (pp->defer_queue.defer_bits) { in nv_swncq_sdbfis()
2140 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_tag() local
2143 tag = readb(pp->tag_block) >> 2; in nv_swncq_tag()
2153 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_dmafis() local
2167 iowrite32(pp->prd_dma + ATA_PRD_TBL_SZ * qc->hw_tag, in nv_swncq_dmafis()
2181 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_host_interrupt() local
2200 if (!pp->qc_active) in nv_swncq_host_interrupt()
2221 pp->ncq_flags |= ncq_saw_backout; in nv_swncq_host_interrupt()
2225 pp->ncq_flags |= ncq_saw_sdb; in nv_swncq_host_interrupt()
2228 pp->qc_active, pp->dhfis_bits, in nv_swncq_host_interrupt()
2229 pp->dmafis_bits, readl(pp->sactive_block)); in nv_swncq_host_interrupt()
2238 pp->dhfis_bits |= (0x1 << pp->last_issue_tag); in nv_swncq_host_interrupt()
2239 pp->ncq_flags |= ncq_saw_d2h; in nv_swncq_host_interrupt()
2240 if (pp->ncq_flags & (ncq_saw_sdb | ncq_saw_backout)) { in nv_swncq_host_interrupt()
2248 !(pp->ncq_flags & ncq_saw_dmas)) { in nv_swncq_host_interrupt()
2253 if (pp->defer_queue.defer_bits) { in nv_swncq_host_interrupt()
2265 pp->dmafis_bits |= (0x1 << nv_swncq_tag(ap)); in nv_swncq_host_interrupt()
2266 pp->ncq_flags |= ncq_saw_dmas; in nv_swncq_host_interrupt()
2412 struct nv_adma_port_priv *pp; in nv_pci_device_resume() local
2416 pp = host->ports[0]->private_data; in nv_pci_device_resume()
2417 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_pci_device_resume()
2423 pp = host->ports[1]->private_data; in nv_pci_device_resume()
2424 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_pci_device_resume()