From: Ramon Fried <rfried.dev@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] net: macb: add dma_burst_length config
Date: Tue, 16 Jul 2019 22:03:04 +0300 [thread overview]
Message-ID: <20190716190305.20520-5-rfried.dev@gmail.com> (raw)
In-Reply-To: <20190716190305.20520-1-rfried.dev@gmail.com>
GEM support higher DMA burst writes/reads than the default (4).
add configuration structure with dma burst length so it could be
applied later to DMA configuration.
Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
v2: nothing.
drivers/net/macb.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index cf76270ad8..dc6aa6deda 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -82,6 +82,7 @@ struct macb_dma_desc {
struct macb_device {
void *regs;
+ unsigned int dma_burst_length;
unsigned int rx_tail;
unsigned int tx_head;
@@ -118,6 +119,11 @@ struct macb_device {
phy_interface_t phy_interface;
#endif
};
+
+struct macb_config {
+ unsigned int dma_burst_length;
+};
+
#ifndef CONFIG_DM_ETH
#define to_macb(_nd) container_of(_nd, struct macb_device, netdev)
#endif
@@ -1135,8 +1141,13 @@ static int macb_enable_clk(struct udevice *dev)
}
#endif
+static const struct macb_config default_gem_config = {
+ .dma_burst_length = 16,
+};
+
static int macb_eth_probe(struct udevice *dev)
{
+ const struct macb_config *macb_config;
struct eth_pdata *pdata = dev_get_platdata(dev);
struct macb_device *macb = dev_get_priv(dev);
const char *phy_mode;
@@ -1153,6 +1164,11 @@ static int macb_eth_probe(struct udevice *dev)
macb->regs = (void *)pdata->iobase;
+ macb_config = (struct macb_config *)dev_get_driver_data(dev);
+ if (!macb_config)
+ macb_config = &default_gem_config;
+
+ macb->dma_burst_length = macb_config->dma_burst_length;
#ifdef CONFIG_CLK
ret = macb_enable_clk(dev);
if (ret)
@@ -1213,12 +1229,16 @@ static int macb_eth_ofdata_to_platdata(struct udevice *dev)
return macb_late_eth_ofdata_to_platdata(dev);
}
+static const struct macb_config sama5d4_config = {
+ .dma_burst_length = 4,
+};
+
static const struct udevice_id macb_eth_ids[] = {
{ .compatible = "cdns,macb" },
{ .compatible = "cdns,at91sam9260-macb" },
{ .compatible = "atmel,sama5d2-gem" },
{ .compatible = "atmel,sama5d3-gem" },
- { .compatible = "atmel,sama5d4-gem" },
+ { .compatible = "atmel,sama5d4-gem", .data = (ulong)&sama5d4_config },
{ .compatible = "cdns,zynq-gem" },
{ }
};
--
2.22.0
next prev parent reply other threads:[~2019-07-16 19:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 19:03 [U-Boot] [PATCH v2 1/6] net: macb: sync header definitions as taken from Linux Ramon Fried
2019-07-16 19:03 ` [U-Boot] [PATCH 2/6] net: macb: add support for faster clk rates Ramon Fried
2019-07-16 19:03 ` [U-Boot] [PATCH 3/6] net: macb: use bit access macro from header file Ramon Fried
2019-07-16 19:03 ` [U-Boot] [PATCH 4/6] net: macb: add support for SGMII phy interface Ramon Fried
2019-07-16 19:03 ` Ramon Fried [this message]
2019-07-16 19:03 ` [U-Boot] [PATCH 6/6] net: macb: apply sane DMA configuration Ramon Fried
2019-07-25 18:41 ` [U-Boot] net: macb: sync header definitions as taken from Linux Joe Hershberger
-- strict thread matches above, loose matches on Subject: below --
2019-06-11 15:19 [U-Boot] [PATCH 1/6] " Ramon Fried
2019-06-11 15:19 ` [U-Boot] [PATCH 5/6] net: macb: add dma_burst_length config Ramon Fried
2019-07-03 3:35 ` Anup Patel
2019-07-08 23:23 ` Joe Hershberger
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=20190716190305.20520-5-rfried.dev@gmail.com \
--to=rfried.dev@gmail.com \
--cc=u-boot@lists.denx.de \
/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.