Lines Matching refs:pp

598 	struct nv_adma_port_priv *pp = ap->private_data;  in nv_adma_register_mode()  local
599 void __iomem *mmio = pp->ctl_block; in nv_adma_register_mode()
603 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) in nv_adma_register_mode()
631 pp->flags |= NV_ADMA_PORT_REGISTER_MODE; in nv_adma_register_mode()
636 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_mode() local
637 void __iomem *mmio = pp->ctl_block; in nv_adma_mode()
641 if (!(pp->flags & NV_ADMA_PORT_REGISTER_MODE)) in nv_adma_mode()
644 WARN_ON(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE); in nv_adma_mode()
661 pp->flags &= ~NV_ADMA_PORT_REGISTER_MODE; in nv_adma_mode()
667 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_slave_config() local
718 pp->flags &= ~NV_ADMA_ATAPI_SETUP_COMPLETE; in nv_adma_slave_config()
721 pp->flags |= NV_ADMA_ATAPI_SETUP_COMPLETE; in nv_adma_slave_config()
740 rc = dma_set_mask(&pdev->dev, pp->adma_dma_mask); in nv_adma_slave_config()
757 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_check_atapi_dma() local
758 return !(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE); in nv_adma_check_atapi_dma()
809 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_check_cpb() local
810 u8 flags = pp->cpb[cpb_num].resp_flags; in nv_adma_check_cpb()
886 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_interrupt() local
887 void __iomem *mmio = pp->ctl_block; in nv_adma_interrupt()
895 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { in nv_adma_interrupt()
903 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { in nv_adma_interrupt()
919 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL); in nv_adma_interrupt()
1001 struct nv_adma_port_priv *pp = host->ports[0]->private_data; in nv_adma_interrupt() local
1002 writel(notifier_clears[0], pp->notifier_clear_block); in nv_adma_interrupt()
1003 pp = host->ports[1]->private_data; in nv_adma_interrupt()
1004 writel(notifier_clears[1], pp->notifier_clear_block); in nv_adma_interrupt()
1014 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_freeze() local
1015 void __iomem *mmio = pp->ctl_block; in nv_adma_freeze()
1020 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_adma_freeze()
1036 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_thaw() local
1037 void __iomem *mmio = pp->ctl_block; in nv_adma_thaw()
1042 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_adma_thaw()
1054 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_irq_clear() local
1055 void __iomem *mmio = pp->ctl_block; in nv_adma_irq_clear()
1058 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { in nv_adma_irq_clear()
1079 pp = ap->host->ports[0]->private_data; in nv_adma_irq_clear()
1080 writel(notifier_clears[0], pp->notifier_clear_block); in nv_adma_irq_clear()
1081 pp = ap->host->ports[1]->private_data; in nv_adma_irq_clear()
1082 writel(notifier_clears[1], pp->notifier_clear_block); in nv_adma_irq_clear()
1087 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_post_internal_cmd() local
1089 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) in nv_adma_post_internal_cmd()
1096 struct nv_adma_port_priv *pp; in nv_adma_port_start() local
1117 pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); in nv_adma_port_start()
1118 if (!pp) in nv_adma_port_start()
1123 pp->ctl_block = mmio; in nv_adma_port_start()
1124 pp->gen_block = ap->host->iomap[NV_MMIO_BAR] + NV_ADMA_GEN; in nv_adma_port_start()
1125 pp->notifier_clear_block = pp->gen_block + in nv_adma_port_start()
1134 pp->adma_dma_mask = *dev->dma_mask; in nv_adma_port_start()
1146 pp->cpb = mem; in nv_adma_port_start()
1147 pp->cpb_dma = mem_dma; in nv_adma_port_start()
1158 pp->aprd = mem; in nv_adma_port_start()
1159 pp->aprd_dma = mem_dma; in nv_adma_port_start()
1161 ap->private_data = pp; in nv_adma_port_start()
1167 pp->flags = NV_ADMA_PORT_REGISTER_MODE; in nv_adma_port_start()
1189 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_port_stop() local
1190 void __iomem *mmio = pp->ctl_block; in nv_adma_port_stop()
1198 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_port_suspend() local
1199 void __iomem *mmio = pp->ctl_block; in nv_adma_port_suspend()
1215 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_port_resume() local
1216 void __iomem *mmio = pp->ctl_block; in nv_adma_port_resume()
1220 writel(pp->cpb_dma & 0xFFFFFFFF, mmio + NV_ADMA_CPB_BASE_LOW); in nv_adma_port_resume()
1221 writel((pp->cpb_dma >> 16) >> 16, mmio + NV_ADMA_CPB_BASE_HIGH); in nv_adma_port_resume()
1227 pp->flags |= NV_ADMA_PORT_REGISTER_MODE; in nv_adma_port_resume()
1312 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_fill_sg() local
1319 &pp->aprd[NV_ADMA_SGTBL_LEN * qc->hw_tag + (si-5)]; in nv_adma_fill_sg()
1323 cpb->next_aprd = cpu_to_le64(((u64)(pp->aprd_dma + NV_ADMA_SGTBL_SZ * qc->hw_tag))); in nv_adma_fill_sg()
1330 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_use_reg_mode() local
1334 if ((pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) || in nv_adma_use_reg_mode()
1347 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_qc_prep() local
1348 struct nv_adma_cpb *cpb = &pp->cpb[qc->hw_tag]; in nv_adma_qc_prep()
1353 BUG_ON(!(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) && in nv_adma_qc_prep()
1393 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_qc_issue() local
1394 void __iomem *mmio = pp->ctl_block; in nv_adma_qc_issue()
1408 BUG_ON(!(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) && in nv_adma_qc_issue()
1419 if (curr_ncq != pp->last_issue_ncq) { in nv_adma_qc_issue()
1423 pp->last_issue_ncq = curr_ncq; in nv_adma_qc_issue()
1627 struct nv_adma_port_priv *pp = ap->private_data; in nv_adma_error_handler() local
1628 if (!(pp->flags & NV_ADMA_PORT_REGISTER_MODE)) { in nv_adma_error_handler()
1629 void __iomem *mmio = pp->ctl_block; in nv_adma_error_handler()
1636 u32 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL); in nv_adma_error_handler()
1649 struct nv_adma_cpb *cpb = &pp->cpb[i]; in nv_adma_error_handler()
1664 pp->cpb[i].ctl_flags &= ~NV_CPB_CTL_CPB_VALID; in nv_adma_error_handler()
1683 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_qc_to_dq() local
1684 struct defer_queue *dq = &pp->defer_queue; in nv_swncq_qc_to_dq()
1694 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_qc_from_dq() local
1695 struct defer_queue *dq = &pp->defer_queue; in nv_swncq_qc_from_dq()
1711 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_fis_reinit() local
1713 pp->dhfis_bits = 0; in nv_swncq_fis_reinit()
1714 pp->dmafis_bits = 0; in nv_swncq_fis_reinit()
1715 pp->sdbfis_bits = 0; in nv_swncq_fis_reinit()
1716 pp->ncq_flags = 0; in nv_swncq_fis_reinit()
1721 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_pp_reinit() local
1722 struct defer_queue *dq = &pp->defer_queue; in nv_swncq_pp_reinit()
1727 pp->qc_active = 0; in nv_swncq_pp_reinit()
1728 pp->last_issue_tag = ATA_TAG_POISON; in nv_swncq_pp_reinit()
1734 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_irq_clear() local
1736 writew(fis, pp->irq_block); in nv_swncq_irq_clear()
1749 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_ncq_stop() local
1759 pp->qc_active, pp->defer_queue.defer_bits, pp->last_issue_tag, in nv_swncq_ncq_stop()
1760 pp->dhfis_bits, pp->dmafis_bits, pp->sdbfis_bits); in nv_swncq_ncq_stop()
1766 sactive = readl(pp->sactive_block); in nv_swncq_ncq_stop()
1767 done_mask = pp->qc_active ^ sactive; in nv_swncq_ncq_stop()
1772 if (pp->qc_active & (1 << i)) in nv_swncq_ncq_stop()
1781 (pp->dhfis_bits >> i) & 0x1, in nv_swncq_ncq_stop()
1782 (pp->dmafis_bits >> i) & 0x1, in nv_swncq_ncq_stop()
1783 (pp->sdbfis_bits >> i) & 0x1, in nv_swncq_ncq_stop()
1921 struct nv_swncq_port_priv *pp; in nv_swncq_port_start() local
1929 pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); in nv_swncq_port_start()
1930 if (!pp) in nv_swncq_port_start()
1933 pp->prd = dmam_alloc_coherent(dev, ATA_PRD_TBL_SZ * ATA_MAX_QUEUE, in nv_swncq_port_start()
1934 &pp->prd_dma, GFP_KERNEL); in nv_swncq_port_start()
1935 if (!pp->prd) in nv_swncq_port_start()
1938 ap->private_data = pp; in nv_swncq_port_start()
1939 pp->sactive_block = ap->ioaddr.scr_addr + 4 * SCR_ACTIVE; in nv_swncq_port_start()
1940 pp->irq_block = mmio + NV_INT_STATUS_MCP55 + ap->port_no * 2; in nv_swncq_port_start()
1941 pp->tag_block = mmio + NV_NCQ_REG_MCP55 + ap->port_no * 2; in nv_swncq_port_start()
1965 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_fill_sg() local
1969 prd = pp->prd + ATA_MAX_PRD * qc->hw_tag; in nv_swncq_fill_sg()
2000 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_issue_atacmd() local
2005 writel((1 << qc->hw_tag), pp->sactive_block); in nv_swncq_issue_atacmd()
2006 pp->last_issue_tag = qc->hw_tag; in nv_swncq_issue_atacmd()
2007 pp->dhfis_bits &= ~(1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2008 pp->dmafis_bits &= ~(1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2009 pp->qc_active |= (0x1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2022 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_qc_issue() local
2027 if (!pp->qc_active) in nv_swncq_qc_issue()
2063 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_sdbfis() local
2084 sactive = readl(pp->sactive_block); in nv_swncq_sdbfis()
2085 done_mask = pp->qc_active ^ sactive; in nv_swncq_sdbfis()
2087 pp->qc_active &= ~done_mask; in nv_swncq_sdbfis()
2088 pp->dhfis_bits &= ~done_mask; in nv_swncq_sdbfis()
2089 pp->dmafis_bits &= ~done_mask; in nv_swncq_sdbfis()
2090 pp->sdbfis_bits |= done_mask; in nv_swncq_sdbfis()
2099 if (pp->qc_active & pp->dhfis_bits) in nv_swncq_sdbfis()
2102 if ((pp->ncq_flags & ncq_saw_backout) || in nv_swncq_sdbfis()
2103 (pp->qc_active ^ pp->dhfis_bits)) in nv_swncq_sdbfis()
2112 ap->qc_active, pp->qc_active, in nv_swncq_sdbfis()
2113 pp->defer_queue.defer_bits, pp->dhfis_bits, in nv_swncq_sdbfis()
2114 pp->dmafis_bits, pp->last_issue_tag); in nv_swncq_sdbfis()
2119 qc = ata_qc_from_tag(ap, pp->last_issue_tag); in nv_swncq_sdbfis()
2124 if (pp->defer_queue.defer_bits) { in nv_swncq_sdbfis()
2136 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_tag() local
2139 tag = readb(pp->tag_block) >> 2; in nv_swncq_tag()
2149 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_dmafis() local
2163 iowrite32(pp->prd_dma + ATA_PRD_TBL_SZ * qc->hw_tag, in nv_swncq_dmafis()
2177 struct nv_swncq_port_priv *pp = ap->private_data; in nv_swncq_host_interrupt() local
2196 if (!pp->qc_active) in nv_swncq_host_interrupt()
2217 pp->ncq_flags |= ncq_saw_backout; in nv_swncq_host_interrupt()
2221 pp->ncq_flags |= ncq_saw_sdb; in nv_swncq_host_interrupt()
2224 pp->qc_active, pp->dhfis_bits, in nv_swncq_host_interrupt()
2225 pp->dmafis_bits, readl(pp->sactive_block)); in nv_swncq_host_interrupt()
2234 pp->dhfis_bits |= (0x1 << pp->last_issue_tag); in nv_swncq_host_interrupt()
2235 pp->ncq_flags |= ncq_saw_d2h; in nv_swncq_host_interrupt()
2236 if (pp->ncq_flags & (ncq_saw_sdb | ncq_saw_backout)) { in nv_swncq_host_interrupt()
2244 !(pp->ncq_flags & ncq_saw_dmas)) { in nv_swncq_host_interrupt()
2249 if (pp->defer_queue.defer_bits) { in nv_swncq_host_interrupt()
2261 pp->dmafis_bits |= (0x1 << nv_swncq_tag(ap)); in nv_swncq_host_interrupt()
2262 pp->ncq_flags |= ncq_saw_dmas; in nv_swncq_host_interrupt()
2408 struct nv_adma_port_priv *pp; in nv_pci_device_resume() local
2412 pp = host->ports[0]->private_data; in nv_pci_device_resume()
2413 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_pci_device_resume()
2419 pp = host->ports[1]->private_data; in nv_pci_device_resume()
2420 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) in nv_pci_device_resume()