From: Vince Bridgers <vbridger@opensource.altera.com>
To: <peppe.cavallaro@st.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <vbridger@opensource.altera.com>, <vbridger@altera.com>
Subject: [PATCH net 3/5] stmmac: Read tx-fifo-depth and rx-fifo-depth from the devicetree
Date: Wed, 15 Apr 2015 11:17:40 -0500 [thread overview]
Message-ID: <1429114662-1528-4-git-send-email-vbridger@opensource.altera.com> (raw)
In-Reply-To: <1429114662-1528-1-git-send-email-vbridger@opensource.altera.com>
Read the tx-fifo-depth and rx-fifo-depth from the devicetree. The Synopsys
stmmac controller fifos are configurable per product instance, and the fifo
sizes are needed to configure certain features correctly such as flow control.
Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ++++
include/linux/stmmac.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index f9b42f1..705bbdf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -181,6 +181,10 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
sizeof(struct stmmac_mdio_bus_data),
GFP_KERNEL);
+ of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
+
+ of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
+
plat->force_sf_dma_mode =
of_property_read_bool(np, "snps,force_sf_dma_mode");
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index cd63851..7f484a2 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -114,6 +114,8 @@ struct plat_stmmacenet_data {
int maxmtu;
int multicast_filter_bins;
int unicast_filter_entries;
+ int tx_fifo_size;
+ int rx_fifo_size;
void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr);
void *(*setup)(struct platform_device *pdev);
--
1.9.1
next prev parent reply other threads:[~2015-04-15 20:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 16:17 [PATCH net 0/5] stmmac: Correct flow control configuration Vince Bridgers
2015-04-15 16:17 ` [PATCH net 1/5] stmmac: Add properties for transmit and receive fifo sizes Vince Bridgers
2015-04-15 16:17 ` [PATCH net 2/5] stmmac: Add defines and documentation for enabling flow control Vince Bridgers
2015-04-15 16:17 ` Vince Bridgers [this message]
2015-04-15 16:17 ` [PATCH net 4/5] stmmac: Enable unicast pause frame detect in GMAC Register 6 Vince Bridgers
2015-04-15 16:17 ` [PATCH net 5/5] stmmac: Configure Flow Control to work correctly based on rxfifo size Vince Bridgers
2015-04-16 7:22 ` [PATCH net 0/5] stmmac: Correct flow control configuration Giuseppe CAVALLARO
2015-04-16 18:09 ` 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=1429114662-1528-4-git-send-email-vbridger@opensource.altera.com \
--to=vbridger@opensource.altera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=vbridger@altera.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).