From: Rob Rice <rob.rice@broadcom.com>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com,
linux-kernel@vger.kernel.org,
Steve Lin <steven.lin1@broadcom.com>,
Rob Rice <rob.rice@broadcom.com>
Subject: [PATCH 08/11] mailbox: bcm-pdc: Don't use iowrite32 to write DMA descriptors
Date: Mon, 14 Nov 2016 13:26:02 -0500 [thread overview]
Message-ID: <1479147965-29662-9-git-send-email-rob.rice@broadcom.com> (raw)
In-Reply-To: <1479147965-29662-1-git-send-email-rob.rice@broadcom.com>
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>
---
drivers/mailbox/bcm-pdc-mailbox.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/mailbox/bcm-pdc-mailbox.c b/drivers/mailbox/bcm-pdc-mailbox.c
index 16e5440..e7dc1a2 100644
--- a/drivers/mailbox/bcm-pdc-mailbox.c
+++ b/drivers/mailbox/bcm-pdc-mailbox.c
@@ -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);
--
2.1.0
next prev parent reply other threads:[~2016-11-14 18:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 18:25 [PATCH 00/11] Update Broadcom PDC Mailbox Driver Rob Rice
2016-11-14 18:25 ` [PATCH 01/11] mailbox: bcm-pdc: Use octal permissions rather than symbolic Rob Rice
2016-11-14 18:25 ` [PATCH 02/11] mailbox: bcm-pdc: Changes so mbox client can be removed / re-inserted Rob Rice
2016-11-14 18:25 ` [PATCH 03/11] mailbox: bcm-pdc: PDC driver leaves debugfs files after removal Rob Rice
2016-11-14 18:25 ` [PATCH 04/11] mailbox: bcm-pdc: Convert from interrupts to poll for tx done Rob Rice
2016-11-14 18:25 ` [PATCH 05/11] mailbox: bcm-pdc: streamline rx code Rob Rice
2016-11-14 18:26 ` [PATCH 06/11] mailbox: bcm-pdc: Try to improve branch prediction Rob Rice
2016-11-14 18:26 ` [PATCH 07/11] mailbox: bcm-pdc: Convert from threaded IRQ to tasklet Rob Rice
2016-11-14 18:26 ` Rob Rice [this message]
2016-11-14 18:26 ` [PATCH 09/11] mailbox: bcm-pdc: Performance improvements Rob Rice
2016-11-14 18:26 ` [PATCH 10/11] mailbox: bcm-pdc: Simplify interrupt handler logic Rob Rice
2016-11-14 18:26 ` [PATCH 11/11] mailbox: bcm-pdc: Remove unnecessary void* casts Rob Rice
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1479147965-29662-9-git-send-email-rob.rice@broadcom.com \
--to=rob.rice@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=steven.lin1@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.