• Home
  • Raw
  • Download

Lines Matching refs:pdma

215 	struct xgene_dma *pdma;  member
271 struct xgene_dma *pdma; member
343 static bool is_pq_enabled(struct xgene_dma *pdma) in is_pq_enabled() argument
347 val = ioread32(pdma->csr_efuse + XGENE_SOC_JTAG1_SHADOW); in is_pq_enabled()
1013 struct xgene_dma *pdma = (struct xgene_dma *)id; in xgene_dma_err_isr() local
1017 val = ioread32(pdma->csr_dma + XGENE_DMA_INT); in xgene_dma_err_isr()
1020 iowrite32(val, pdma->csr_dma + XGENE_DMA_INT); in xgene_dma_err_isr()
1025 dev_err(pdma->dev, in xgene_dma_err_isr()
1035 iowrite32(ring->num, ring->pdma->csr_ring + XGENE_DMA_RING_STATE); in xgene_dma_wr_ring_state()
1038 iowrite32(ring->state[i], ring->pdma->csr_ring + in xgene_dma_wr_ring_state()
1082 ring->pdma->csr_ring + XGENE_DMA_RING_ID); in xgene_dma_setup_ring()
1086 ring->pdma->csr_ring + XGENE_DMA_RING_ID_BUF); in xgene_dma_setup_ring()
1100 val = ioread32(ring->pdma->csr_ring + XGENE_DMA_RING_NE_INT_MODE); in xgene_dma_setup_ring()
1102 iowrite32(val, ring->pdma->csr_ring + XGENE_DMA_RING_NE_INT_MODE); in xgene_dma_setup_ring()
1111 val = ioread32(ring->pdma->csr_ring + in xgene_dma_clear_ring()
1114 iowrite32(val, ring->pdma->csr_ring + in xgene_dma_clear_ring()
1120 iowrite32(ring_id, ring->pdma->csr_ring + XGENE_DMA_RING_ID); in xgene_dma_clear_ring()
1122 iowrite32(0, ring->pdma->csr_ring + XGENE_DMA_RING_ID_BUF); in xgene_dma_clear_ring()
1128 ring->cmd_base = ring->pdma->csr_ring_cmd + in xgene_dma_set_ring_cmd()
1171 dma_free_coherent(ring->pdma->dev, ring->size, in xgene_dma_delete_ring_one()
1190 ring->pdma = chan->pdma; in xgene_dma_create_ring_one()
1192 ring->num = chan->pdma->ring_num++; in xgene_dma_create_ring_one()
1256 static int xgene_dma_init_rings(struct xgene_dma *pdma) in xgene_dma_init_rings() argument
1261 ret = xgene_dma_create_chan_rings(&pdma->chan[i]); in xgene_dma_init_rings()
1264 xgene_dma_delete_chan_rings(&pdma->chan[j]); in xgene_dma_init_rings()
1272 static void xgene_dma_enable(struct xgene_dma *pdma) in xgene_dma_enable() argument
1277 val = ioread32(pdma->csr_dma + XGENE_DMA_GCR); in xgene_dma_enable()
1280 iowrite32(val, pdma->csr_dma + XGENE_DMA_GCR); in xgene_dma_enable()
1283 static void xgene_dma_disable(struct xgene_dma *pdma) in xgene_dma_disable() argument
1287 val = ioread32(pdma->csr_dma + XGENE_DMA_GCR); in xgene_dma_disable()
1289 iowrite32(val, pdma->csr_dma + XGENE_DMA_GCR); in xgene_dma_disable()
1292 static void xgene_dma_mask_interrupts(struct xgene_dma *pdma) in xgene_dma_mask_interrupts() argument
1299 pdma->csr_dma + XGENE_DMA_RING_INT0_MASK); in xgene_dma_mask_interrupts()
1301 pdma->csr_dma + XGENE_DMA_RING_INT1_MASK); in xgene_dma_mask_interrupts()
1303 pdma->csr_dma + XGENE_DMA_RING_INT2_MASK); in xgene_dma_mask_interrupts()
1305 pdma->csr_dma + XGENE_DMA_RING_INT3_MASK); in xgene_dma_mask_interrupts()
1307 pdma->csr_dma + XGENE_DMA_RING_INT4_MASK); in xgene_dma_mask_interrupts()
1310 iowrite32(XGENE_DMA_INT_ALL_MASK, pdma->csr_dma + XGENE_DMA_INT_MASK); in xgene_dma_mask_interrupts()
1313 static void xgene_dma_unmask_interrupts(struct xgene_dma *pdma) in xgene_dma_unmask_interrupts() argument
1320 pdma->csr_dma + XGENE_DMA_RING_INT0_MASK); in xgene_dma_unmask_interrupts()
1322 pdma->csr_dma + XGENE_DMA_RING_INT1_MASK); in xgene_dma_unmask_interrupts()
1324 pdma->csr_dma + XGENE_DMA_RING_INT2_MASK); in xgene_dma_unmask_interrupts()
1326 pdma->csr_dma + XGENE_DMA_RING_INT3_MASK); in xgene_dma_unmask_interrupts()
1328 pdma->csr_dma + XGENE_DMA_RING_INT4_MASK); in xgene_dma_unmask_interrupts()
1332 pdma->csr_dma + XGENE_DMA_INT_MASK); in xgene_dma_unmask_interrupts()
1335 static void xgene_dma_init_hw(struct xgene_dma *pdma) in xgene_dma_init_hw() argument
1341 pdma->csr_dma + XGENE_DMA_CFG_RING_WQ_ASSOC); in xgene_dma_init_hw()
1344 if (is_pq_enabled(pdma)) in xgene_dma_init_hw()
1346 pdma->csr_dma + XGENE_DMA_RAID6_CONT); in xgene_dma_init_hw()
1348 dev_info(pdma->dev, "PQ is disabled in HW\n"); in xgene_dma_init_hw()
1350 xgene_dma_enable(pdma); in xgene_dma_init_hw()
1351 xgene_dma_unmask_interrupts(pdma); in xgene_dma_init_hw()
1354 val = ioread32(pdma->csr_dma + XGENE_DMA_IPBRR); in xgene_dma_init_hw()
1357 dev_info(pdma->dev, in xgene_dma_init_hw()
1363 static int xgene_dma_init_ring_mngr(struct xgene_dma *pdma) in xgene_dma_init_ring_mngr() argument
1365 if (ioread32(pdma->csr_ring + XGENE_DMA_RING_CLKEN) && in xgene_dma_init_ring_mngr()
1366 (!ioread32(pdma->csr_ring + XGENE_DMA_RING_SRST))) in xgene_dma_init_ring_mngr()
1369 iowrite32(0x3, pdma->csr_ring + XGENE_DMA_RING_CLKEN); in xgene_dma_init_ring_mngr()
1370 iowrite32(0x0, pdma->csr_ring + XGENE_DMA_RING_SRST); in xgene_dma_init_ring_mngr()
1373 iowrite32(0x0, pdma->csr_ring + XGENE_DMA_RING_MEM_RAM_SHUTDOWN); in xgene_dma_init_ring_mngr()
1376 ioread32(pdma->csr_ring + XGENE_DMA_RING_MEM_RAM_SHUTDOWN); in xgene_dma_init_ring_mngr()
1381 if (ioread32(pdma->csr_ring + XGENE_DMA_RING_BLK_MEM_RDY) in xgene_dma_init_ring_mngr()
1383 dev_err(pdma->dev, in xgene_dma_init_ring_mngr()
1390 pdma->csr_ring + XGENE_DMA_RING_THRESLD0_SET1); in xgene_dma_init_ring_mngr()
1392 pdma->csr_ring + XGENE_DMA_RING_THRESLD1_SET1); in xgene_dma_init_ring_mngr()
1394 pdma->csr_ring + XGENE_DMA_RING_HYSTERESIS); in xgene_dma_init_ring_mngr()
1398 pdma->csr_ring + XGENE_DMA_RING_CONFIG); in xgene_dma_init_ring_mngr()
1403 static int xgene_dma_init_mem(struct xgene_dma *pdma) in xgene_dma_init_mem() argument
1407 ret = xgene_dma_init_ring_mngr(pdma); in xgene_dma_init_mem()
1412 iowrite32(0x0, pdma->csr_dma + XGENE_DMA_MEM_RAM_SHUTDOWN); in xgene_dma_init_mem()
1415 ioread32(pdma->csr_dma + XGENE_DMA_MEM_RAM_SHUTDOWN); in xgene_dma_init_mem()
1420 if (ioread32(pdma->csr_dma + XGENE_DMA_BLK_MEM_RDY) in xgene_dma_init_mem()
1422 dev_err(pdma->dev, in xgene_dma_init_mem()
1430 static int xgene_dma_request_irqs(struct xgene_dma *pdma) in xgene_dma_request_irqs() argument
1436 ret = devm_request_irq(pdma->dev, pdma->err_irq, xgene_dma_err_isr, in xgene_dma_request_irqs()
1437 0, "dma_error", pdma); in xgene_dma_request_irqs()
1439 dev_err(pdma->dev, in xgene_dma_request_irqs()
1440 "Failed to register error IRQ %d\n", pdma->err_irq); in xgene_dma_request_irqs()
1446 chan = &pdma->chan[i]; in xgene_dma_request_irqs()
1454 devm_free_irq(pdma->dev, pdma->err_irq, pdma); in xgene_dma_request_irqs()
1457 chan = &pdma->chan[i]; in xgene_dma_request_irqs()
1469 static void xgene_dma_free_irqs(struct xgene_dma *pdma) in xgene_dma_free_irqs() argument
1475 devm_free_irq(pdma->dev, pdma->err_irq, pdma); in xgene_dma_free_irqs()
1478 chan = &pdma->chan[i]; in xgene_dma_free_irqs()
1502 is_pq_enabled(chan->pdma)) { in xgene_dma_set_caps()
1506 !is_pq_enabled(chan->pdma)) { in xgene_dma_set_caps()
1530 static int xgene_dma_async_register(struct xgene_dma *pdma, int id) in xgene_dma_async_register() argument
1532 struct xgene_dma_chan *chan = &pdma->chan[id]; in xgene_dma_async_register()
1533 struct dma_device *dma_dev = &pdma->dma_dev[id]; in xgene_dma_async_register()
1565 dev_info(pdma->dev, in xgene_dma_async_register()
1573 static int xgene_dma_init_async(struct xgene_dma *pdma) in xgene_dma_init_async() argument
1578 ret = xgene_dma_async_register(pdma, i); in xgene_dma_init_async()
1581 dma_async_device_unregister(&pdma->dma_dev[j]); in xgene_dma_init_async()
1582 tasklet_kill(&pdma->chan[j].tasklet); in xgene_dma_init_async()
1592 static void xgene_dma_async_unregister(struct xgene_dma *pdma) in xgene_dma_async_unregister() argument
1597 dma_async_device_unregister(&pdma->dma_dev[i]); in xgene_dma_async_unregister()
1600 static void xgene_dma_init_channels(struct xgene_dma *pdma) in xgene_dma_init_channels() argument
1605 pdma->ring_num = XGENE_DMA_RING_NUM; in xgene_dma_init_channels()
1608 chan = &pdma->chan[i]; in xgene_dma_init_channels()
1609 chan->dev = pdma->dev; in xgene_dma_init_channels()
1610 chan->pdma = pdma; in xgene_dma_init_channels()
1617 struct xgene_dma *pdma) in xgene_dma_get_resources() argument
1629 pdma->csr_dma = devm_ioremap(&pdev->dev, res->start, in xgene_dma_get_resources()
1631 if (!pdma->csr_dma) { in xgene_dma_get_resources()
1643 pdma->csr_ring = devm_ioremap(&pdev->dev, res->start, in xgene_dma_get_resources()
1645 if (!pdma->csr_ring) { in xgene_dma_get_resources()
1657 pdma->csr_ring_cmd = devm_ioremap(&pdev->dev, res->start, in xgene_dma_get_resources()
1659 if (!pdma->csr_ring_cmd) { in xgene_dma_get_resources()
1664 pdma->csr_ring_cmd += XGENE_DMA_RING_CMD_SM_OFFSET; in xgene_dma_get_resources()
1673 pdma->csr_efuse = devm_ioremap(&pdev->dev, res->start, in xgene_dma_get_resources()
1675 if (!pdma->csr_efuse) { in xgene_dma_get_resources()
1685 pdma->err_irq = irq; in xgene_dma_get_resources()
1693 pdma->chan[i - 1].rx_irq = irq; in xgene_dma_get_resources()
1701 struct xgene_dma *pdma; in xgene_dma_probe() local
1704 pdma = devm_kzalloc(&pdev->dev, sizeof(*pdma), GFP_KERNEL); in xgene_dma_probe()
1705 if (!pdma) in xgene_dma_probe()
1708 pdma->dev = &pdev->dev; in xgene_dma_probe()
1709 platform_set_drvdata(pdev, pdma); in xgene_dma_probe()
1711 ret = xgene_dma_get_resources(pdev, pdma); in xgene_dma_probe()
1715 pdma->clk = devm_clk_get(&pdev->dev, NULL); in xgene_dma_probe()
1716 if (IS_ERR(pdma->clk) && !ACPI_COMPANION(&pdev->dev)) { in xgene_dma_probe()
1718 return PTR_ERR(pdma->clk); in xgene_dma_probe()
1722 if (!IS_ERR(pdma->clk)) { in xgene_dma_probe()
1723 ret = clk_prepare_enable(pdma->clk); in xgene_dma_probe()
1731 ret = xgene_dma_init_mem(pdma); in xgene_dma_probe()
1742 xgene_dma_init_channels(pdma); in xgene_dma_probe()
1745 ret = xgene_dma_init_rings(pdma); in xgene_dma_probe()
1749 ret = xgene_dma_request_irqs(pdma); in xgene_dma_probe()
1754 xgene_dma_init_hw(pdma); in xgene_dma_probe()
1757 ret = xgene_dma_init_async(pdma); in xgene_dma_probe()
1764 xgene_dma_free_irqs(pdma); in xgene_dma_probe()
1768 xgene_dma_delete_chan_rings(&pdma->chan[i]); in xgene_dma_probe()
1772 if (!IS_ERR(pdma->clk)) in xgene_dma_probe()
1773 clk_disable_unprepare(pdma->clk); in xgene_dma_probe()
1780 struct xgene_dma *pdma = platform_get_drvdata(pdev); in xgene_dma_remove() local
1784 xgene_dma_async_unregister(pdma); in xgene_dma_remove()
1787 xgene_dma_mask_interrupts(pdma); in xgene_dma_remove()
1788 xgene_dma_disable(pdma); in xgene_dma_remove()
1789 xgene_dma_free_irqs(pdma); in xgene_dma_remove()
1792 chan = &pdma->chan[i]; in xgene_dma_remove()
1797 if (!IS_ERR(pdma->clk)) in xgene_dma_remove()
1798 clk_disable_unprepare(pdma->clk); in xgene_dma_remove()