From: Harini Katakam <harini.katakam@xilinx.com>
To: <nicolas.ferre@atmel.com>, <davem@davemloft.net>,
<robh+dt@kernel.org>, <pawel.moll@arm.com>,
<mark.rutland@arm.com>, <ijc+devicetree@hellion.org.uk>,
<galak@codeaurora.org>, <boris.brezillon@free-electrons.com>,
<alexandre.belloni@free-electrons.com>,
<harinikatakamlinux@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>, <harinik@xilinx.com>,
<punnaia@xilinx.com>, <michals@xilinx.com>, <anirudh@xilinx.com>
Subject: [RFC PATCH 1/3] net: macb: Add support for extended BD with a config option
Date: Fri, 11 Sep 2015 13:27:36 +0530 [thread overview]
Message-ID: <1441958258-35441-2-git-send-email-harinik@xilinx.com> (raw)
In-Reply-To: <1441958258-35441-1-git-send-email-harinik@xilinx.com>
Cadence GEM supports extended buffer descriptors.
This patch adds a config option to enable use of extended BD.
This adds two extra words to the TX BD and RX BD by configuring the
necessary registers. Corresponding variables are added to the
macb_dma_desc structure.
Signed-off-by: Harini Katakam <harinik@xilinx.com>
---
drivers/net/ethernet/cadence/Kconfig | 8 ++++++++
drivers/net/ethernet/cadence/macb.c | 4 ++++
drivers/net/ethernet/cadence/macb.h | 8 ++++++++
3 files changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/cadence/Kconfig b/drivers/net/ethernet/cadence/Kconfig
index f0bcb15..33e4198 100644
--- a/drivers/net/ethernet/cadence/Kconfig
+++ b/drivers/net/ethernet/cadence/Kconfig
@@ -31,4 +31,12 @@ config MACB
To compile this driver as a module, choose M here: the module
will be called macb.
+config MACB_EXT_BD
+ tristate "Cadence MACB/GEM extended buffer descriptor"
+ depends on HAS_DMA && MACB
+ ---help---
+ The Cadence MACB host supports use of extended buffer descriptor.
+ This option enables additon of two extra words to TX BD and RX BD.
+ These two extra words are currently used to obtain PTP timestamp.
+
endif # NET_CADENCE
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 88c1e1a..bb2932c 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1665,6 +1665,10 @@ static void macb_configure_dma(struct macb *bp)
dmacfg |= GEM_BIT(TXCOEN);
else
dmacfg &= ~GEM_BIT(TXCOEN);
+#ifdef CONFIG_MACB_EXT_BD
+ dmacfg |= GEM_BIT(RXBDEXT);
+ dmacfg |= GEM_BIT(TXBDEXT);
+#endif
netdev_dbg(bp->dev, "Cadence configure DMA with 0x%08x\n",
dmacfg);
gem_writel(bp, DMACFG, dmacfg);
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 6e1faea..58c9870 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -244,6 +244,10 @@
#define GEM_RXBS_SIZE 8
#define GEM_DDRP_OFFSET 24 /* disc_when_no_ahb */
#define GEM_DDRP_SIZE 1
+#define GEM_RXBDEXT_OFFSET 28 /* Extended RX BD */
+#define GEM_RXBDEXT_SIZE 1
+#define GEM_TXBDEXT_OFFSET 29 /* Extended TX BD */
+#define GEM_TXBDEXT_SIZE 1
/* Bitfields in NSR */
@@ -466,6 +470,10 @@
struct macb_dma_desc {
u32 addr;
u32 ctrl;
+#ifdef CONFIG_MACB_EXT_BD
+ u32 tsl;
+ u32 tsh;
+#endif
};
/* DMA descriptor bitfields */
--
1.7.9.5
next prev parent reply other threads:[~2015-09-11 8:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 7:57 [RFC PATCH 0/3] 1588 support for Zynq Ultrascale+ MPSoC Harini Katakam
2015-09-11 7:57 ` Harini Katakam [this message]
2015-09-21 17:48 ` [RFC PATCH 1/3] net: macb: Add support for extended BD with a config option Harini Katakam
2015-09-11 7:57 ` [RFC PATCH 2/3] net: macb: Add support for 1588 for Zynq Ultrascale+ MPSoC Harini Katakam
2015-09-21 17:49 ` Harini Katakam
2015-09-21 18:39 ` Richard Cochran
2015-09-22 4:21 ` Harini Katakam
2016-08-09 16:40 ` Nicolas Ferre
2016-08-09 16:56 ` Punnaiah Choudary Kalluri
2016-08-10 4:56 ` Harini Katakam
2016-08-10 6:11 ` Michal Simek
2016-08-10 10:12 ` Andrei Pistirica
2016-08-10 10:22 ` Harini Katakam
2015-09-11 7:57 ` [RFC PATCH 3/3] devicetree: macb: Add optional property tsu-clk Harini Katakam
2015-09-11 16:52 ` Sören Brinkmann
2015-09-14 4:09 ` Harini Katakam
2015-09-14 7:58 ` Boris Brezillon
2015-09-14 14:44 ` Sören Brinkmann
2015-09-14 17:34 ` Harini Katakam
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=1441958258-35441-2-git-send-email-harinik@xilinx.com \
--to=harini.katakam@xilinx.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=anirudh@xilinx.com \
--cc=boris.brezillon@free-electrons.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=harinik@xilinx.com \
--cc=harinikatakamlinux@gmail.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michals@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=pawel.moll@arm.com \
--cc=punnaia@xilinx.com \
--cc=robh+dt@kernel.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
all inboxes | Powered by JetHome®