From: Wang Dongsheng <wdsch86@gmail.com>
To: timur@codeaurora.org
Cc: netdev@vger.kernel.org, Wang Dongsheng <wdsch86@gmail.com>
Subject: [PATCH v3] net: qcom/emac: extend DMA mask to 46bits
Date: Mon, 20 Nov 2017 05:48:02 -0800 [thread overview]
Message-ID: <1511185682-18324-1-git-send-email-wdsch86@gmail.com> (raw)
Since PTP doesn't support yet, so extend the DMA address to 46bits.
Signed-off-by: Wang Dongsheng <wdsch86@gmail.com>
---
v3:
- Remove "Dynamic fix TPD_BUFFER_ADDR_H_SET size."
- Add comments for TPD_BUFFER_ADDR_H_SET.
v2:
- Changes PATCH subject.
- Dynamic fix TPD_BUFFER_ADDR_H_SET size.
- Modify DMA MASK to 46bits.
- Add Comments for DMA MASK.
---
drivers/net/ethernet/qualcomm/emac/emac-mac.h | 3 ++-
drivers/net/ethernet/qualcomm/emac/emac.c | 7 +++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.h b/drivers/net/ethernet/qualcomm/emac/emac-mac.h
index 5028fb4..4beedb8 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.h
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.h
@@ -114,8 +114,9 @@ struct emac_tpd {
#define TPD_INSTC_SET(tpd, val) BITS_SET((tpd)->word[3], 17, 17, val)
/* High-14bit Buffer Address, So, the 64b-bit address is
* {DESC_CTRL_11_TX_DATA_HIADDR[17:0],(register) BUFFER_ADDR_H, BUFFER_ADDR_L}
+ * Extend TPD_BUFFER_ADDR_H to [31, 18], because we never enable timestamping.
*/
-#define TPD_BUFFER_ADDR_H_SET(tpd, val) BITS_SET((tpd)->word[3], 18, 30, val)
+#define TPD_BUFFER_ADDR_H_SET(tpd, val) BITS_SET((tpd)->word[3], 18, 31, val)
/* Format D. Word offset from the 1st byte of this packet to start to calculate
* the custom checksum.
*/
diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c
index 70c92b6..a4b39d1 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac.c
@@ -615,8 +615,11 @@ static int emac_probe(struct platform_device *pdev)
u32 reg;
int ret;
- /* The TPD buffer address is limited to 45 bits. */
- ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(45));
+ /* The TPD buffer address is limited to:
+ * 1. PTP: 45bits. (Driver doesn't support yet.)
+ * 2. NON-PTP: 46bits.
+ */
+ ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(46));
if (ret) {
dev_err(&pdev->dev, "could not set DMA mask\n");
return ret;
--
2.7.4
next reply other threads:[~2017-11-20 13:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 13:48 Wang Dongsheng [this message]
2017-11-20 15:07 ` [PATCH v3] net: qcom/emac: extend DMA mask to 46bits Timur Tabi
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=1511185682-18324-1-git-send-email-wdsch86@gmail.com \
--to=wdsch86@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=timur@codeaurora.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).