netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@free-electrons.com>
To: davem@davemloft.net
Cc: Antoine Tenart <antoine.tenart@free-electrons.com>,
	andrew@lunn.ch, gregory.clement@free-electrons.com,
	thomas.petazzoni@free-electrons.com,
	miquel.raynal@free-electrons.com, nadavh@marvell.com,
	mw@semihalf.com, stefanc@marvell.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net-next 2/6] net: mvpp2: initialize the Tx FIFO size
Date: Mon, 30 Oct 2017 11:23:29 +0100	[thread overview]
Message-ID: <20171030102333.30781-3-antoine.tenart@free-electrons.com> (raw)
In-Reply-To: <20171030102333.30781-1-antoine.tenart@free-electrons.com>

So far only the Rx FIFO size was initialized. For PPv2.2 the Tx FIFO
size can be set as well. This patch initializes the Tx FIFO size for
PPv2.2 controllers to 3K.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 3bf9eaafcde5..f15e5ffde9cb 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -38,11 +38,12 @@
 #include <net/ipv6.h>
 #include <net/tso.h>
 
-/* RX Fifo Registers */
+/* Fifo Registers */
 #define MVPP2_RX_DATA_FIFO_SIZE_REG(port)	(0x00 + 4 * (port))
 #define MVPP2_RX_ATTR_FIFO_SIZE_REG(port)	(0x20 + 4 * (port))
 #define MVPP2_RX_MIN_PKT_SIZE_REG		0x60
 #define MVPP2_RX_FIFO_INIT_REG			0x64
+#define MVPP22_TX_FIFO_SIZE_REG(port)		(0x8860 + 4 * (port))
 
 /* RX DMA Top Registers */
 #define MVPP2_RX_CTRL_REG(port)			(0x140 + 4 * (port))
@@ -512,6 +513,10 @@
 #define MVPP2_RX_FIFO_PORT_ATTR_SIZE_4KB	0x40
 #define MVPP2_RX_FIFO_PORT_MIN_PKT		0x80
 
+/* TX FIFO constants */
+#define MVPP22_TX_FIFO_DATA_SIZE_10KB		0xa
+#define MVPP22_TX_FIFO_DATA_SIZE_3KB		0x3
+
 /* RX buffer constants */
 #define MVPP2_SKB_SHINFO_SIZE \
 	SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
@@ -7811,6 +7816,16 @@ static void mvpp22_rx_fifo_init(struct mvpp2 *priv)
 	mvpp2_write(priv, MVPP2_RX_FIFO_INIT_REG, 0x1);
 }
 
+/* Initialize Tx FIFO's */
+static void mvpp22_tx_fifo_init(struct mvpp2 *priv)
+{
+	int port;
+
+	for (port = 0; port < MVPP2_MAX_PORTS; port++)
+		mvpp2_write(priv, MVPP22_TX_FIFO_SIZE_REG(port),
+			    MVPP22_TX_FIFO_DATA_SIZE_3KB);
+}
+
 static void mvpp2_axi_init(struct mvpp2 *priv)
 {
 	u32 val, rdval, wrval;
@@ -7906,11 +7921,13 @@ static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv)
 			return err;
 	}
 
-	/* Rx Fifo Init */
-	if (priv->hw_version == MVPP21)
+	/* Fifo Init */
+	if (priv->hw_version == MVPP21) {
 		mvpp2_rx_fifo_init(priv);
-	else
+	} else {
 		mvpp22_rx_fifo_init(priv);
+		mvpp22_tx_fifo_init(priv);
+	}
 
 	if (priv->hw_version == MVPP21)
 		writel(MVPP2_EXT_GLOBAL_CTRL_DEFAULT,
-- 
2.14.3

  parent reply	other threads:[~2017-10-30 10:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 10:23 [PATCH net-next 0/6] net: ppv2: various improvements Antoine Tenart
2017-10-30 10:23 ` [PATCH net-next 1/6] net: mvpp2: set the Rx FIFO size depending on the port speeds for PPv2.2 Antoine Tenart
2017-10-30 10:23 ` Antoine Tenart [this message]
2017-10-30 10:23 ` [PATCH net-next 3/6] net: mvpp2: initialize the RSS tables Antoine Tenart
2017-10-30 10:23 ` [PATCH net-next 4/6] net: mvpp2: limit TSO segments and use stop/wake thresholds Antoine Tenart
2017-10-30 10:23 ` [PATCH net-next 5/6] net: mvpp2: use the aggr txq size define everywhere Antoine Tenart
2017-10-30 10:23 ` [PATCH net-next 6/6] net: mvpp2: simplify the Tx desc set DMA logic Antoine Tenart
2017-11-01  3:29 ` [PATCH net-next 0/6] net: ppv2: various improvements David Miller

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=20171030102333.30781-3-antoine.tenart@free-electrons.com \
    --to=antoine.tenart@free-electrons.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquel.raynal@free-electrons.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefanc@marvell.com \
    --cc=thomas.petazzoni@free-electrons.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 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).