]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mailbox: bcm-pdc: Don't use iowrite32 to write DMA descriptors
authorRob Rice <rob.rice@broadcom.com>
Mon, 14 Nov 2016 18:26:02 +0000 (13:26 -0500)
committerJassi Brar <jaswinder.singh@linaro.org>
Mon, 19 Dec 2016 14:40:21 +0000 (20:10 +0530)
In PDC driver, it is not necessary to use iowrite32()
when writing DMA descriptors to the transmit and receive rings.
The ring memory is in host memory. So convert to normal
assignment statements.

Signed-off-by: Rob Rice <rob.rice@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/bcm-pdc-mailbox.c

index 16e544018a68a986ad5b6b63d17822f387fe2890..e7dc1a2277133cfdc5af28c9456933199f370306 100644 (file)
@@ -528,17 +528,17 @@ pdc_build_rxd(struct pdc_state *pdcs, dma_addr_t dma_addr,
              u32 buf_len, u32 flags)
 {
        struct device *dev = &pdcs->pdev->dev;
+       struct dma64dd *rxd = &pdcs->rxd_64[pdcs->rxout];
 
        dev_dbg(dev,
                "Writing rx descriptor for PDC %u at index %u with length %u. flags %#x\n",
                pdcs->pdc_idx, pdcs->rxout, buf_len, flags);
 
-       iowrite32(lower_32_bits(dma_addr),
-                 (void *)&pdcs->rxd_64[pdcs->rxout].addrlow);
-       iowrite32(upper_32_bits(dma_addr),
-                 (void *)&pdcs->rxd_64[pdcs->rxout].addrhigh);
-       iowrite32(flags, (void *)&pdcs->rxd_64[pdcs->rxout].ctrl1);
-       iowrite32(buf_len, (void *)&pdcs->rxd_64[pdcs->rxout].ctrl2);
+       rxd->addrlow = cpu_to_le32(lower_32_bits(dma_addr));
+       rxd->addrhigh = cpu_to_le32(upper_32_bits(dma_addr));
+       rxd->ctrl1 = cpu_to_le32(flags);
+       rxd->ctrl2 = cpu_to_le32(buf_len);
+
        /* bump ring index and return */
        pdcs->rxout = NEXTRXD(pdcs->rxout, pdcs->nrxpost);
 }
@@ -556,17 +556,16 @@ pdc_build_txd(struct pdc_state *pdcs, dma_addr_t dma_addr, u32 buf_len,
              u32 flags)
 {
        struct device *dev = &pdcs->pdev->dev;
+       struct dma64dd *txd = &pdcs->txd_64[pdcs->txout];
 
        dev_dbg(dev,
                "Writing tx descriptor for PDC %u at index %u with length %u, flags %#x\n",
                pdcs->pdc_idx, pdcs->txout, buf_len, flags);
 
-       iowrite32(lower_32_bits(dma_addr),
-                 (void *)&pdcs->txd_64[pdcs->txout].addrlow);
-       iowrite32(upper_32_bits(dma_addr),
-                 (void *)&pdcs->txd_64[pdcs->txout].addrhigh);
-       iowrite32(flags, (void *)&pdcs->txd_64[pdcs->txout].ctrl1);
-       iowrite32(buf_len, (void *)&pdcs->txd_64[pdcs->txout].ctrl2);
+       txd->addrlow = cpu_to_le32(lower_32_bits(dma_addr));
+       txd->addrhigh = cpu_to_le32(upper_32_bits(dma_addr));
+       txd->ctrl1 = cpu_to_le32(flags);
+       txd->ctrl2 = cpu_to_le32(buf_len);
 
        /* bump ring index and return */
        pdcs->txout = NEXTTXD(pdcs->txout, pdcs->ntxpost);