Commit 38ed49ed authored by Rob Rice's avatar Rob Rice Committed by Jassi Brar

mailbox: bcm-pdc: Don't use iowrite32 to write DMA descriptors

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: default avatarRob Rice <rob.rice@broadcom.com>
Reviewed-by: default avatarAndy Gospodarek <gospo@broadcom.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 8aef00f0
...@@ -528,17 +528,17 @@ pdc_build_rxd(struct pdc_state *pdcs, dma_addr_t dma_addr, ...@@ -528,17 +528,17 @@ pdc_build_rxd(struct pdc_state *pdcs, dma_addr_t dma_addr,
u32 buf_len, u32 flags) u32 buf_len, u32 flags)
{ {
struct device *dev = &pdcs->pdev->dev; struct device *dev = &pdcs->pdev->dev;
struct dma64dd *rxd = &pdcs->rxd_64[pdcs->rxout];
dev_dbg(dev, dev_dbg(dev,
"Writing rx descriptor for PDC %u at index %u with length %u. flags %#x\n", "Writing rx descriptor for PDC %u at index %u with length %u. flags %#x\n",
pdcs->pdc_idx, pdcs->rxout, buf_len, flags); pdcs->pdc_idx, pdcs->rxout, buf_len, flags);
iowrite32(lower_32_bits(dma_addr), rxd->addrlow = cpu_to_le32(lower_32_bits(dma_addr));
(void *)&pdcs->rxd_64[pdcs->rxout].addrlow); rxd->addrhigh = cpu_to_le32(upper_32_bits(dma_addr));
iowrite32(upper_32_bits(dma_addr), rxd->ctrl1 = cpu_to_le32(flags);
(void *)&pdcs->rxd_64[pdcs->rxout].addrhigh); rxd->ctrl2 = cpu_to_le32(buf_len);
iowrite32(flags, (void *)&pdcs->rxd_64[pdcs->rxout].ctrl1);
iowrite32(buf_len, (void *)&pdcs->rxd_64[pdcs->rxout].ctrl2);
/* bump ring index and return */ /* bump ring index and return */
pdcs->rxout = NEXTRXD(pdcs->rxout, pdcs->nrxpost); 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, ...@@ -556,17 +556,16 @@ pdc_build_txd(struct pdc_state *pdcs, dma_addr_t dma_addr, u32 buf_len,
u32 flags) u32 flags)
{ {
struct device *dev = &pdcs->pdev->dev; struct device *dev = &pdcs->pdev->dev;
struct dma64dd *txd = &pdcs->txd_64[pdcs->txout];
dev_dbg(dev, dev_dbg(dev,
"Writing tx descriptor for PDC %u at index %u with length %u, flags %#x\n", "Writing tx descriptor for PDC %u at index %u with length %u, flags %#x\n",
pdcs->pdc_idx, pdcs->txout, buf_len, flags); pdcs->pdc_idx, pdcs->txout, buf_len, flags);
iowrite32(lower_32_bits(dma_addr), txd->addrlow = cpu_to_le32(lower_32_bits(dma_addr));
(void *)&pdcs->txd_64[pdcs->txout].addrlow); txd->addrhigh = cpu_to_le32(upper_32_bits(dma_addr));
iowrite32(upper_32_bits(dma_addr), txd->ctrl1 = cpu_to_le32(flags);
(void *)&pdcs->txd_64[pdcs->txout].addrhigh); txd->ctrl2 = cpu_to_le32(buf_len);
iowrite32(flags, (void *)&pdcs->txd_64[pdcs->txout].ctrl1);
iowrite32(buf_len, (void *)&pdcs->txd_64[pdcs->txout].ctrl2);
/* bump ring index and return */ /* bump ring index and return */
pdcs->txout = NEXTTXD(pdcs->txout, pdcs->ntxpost); pdcs->txout = NEXTTXD(pdcs->txout, pdcs->ntxpost);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment