[U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length

sonic.adi at gmail.com sonic.adi at gmail.com
Tue Jan 27 03:54:52 CET 2015


From: Sonic Zhang <sonic.zhang at analog.com>

Board can define its own AXI burst length to improve DWMAC DMA performance.

Signed-off-by: Sonic Zhang <sonic.zhang at analog.com>
---

 drivers/net/designware.c |    2 ++
 drivers/net/designware.h |    5 +++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 9ded895..d8d6792 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -256,6 +256,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 
 	writel(readl(&dma_p->opmode) | RXSTART | TXSTART, &dma_p->opmode);
 
+	writel((CONFIG_DW_AXI_BURST_LEN & 0x1FF >> 1), &dma_p->axibus);
+
 	/* Start up the PHY */
 	if (phy_startup(priv->phydev)) {
 		printf("Could not initialize PHY %s\n",
diff --git a/drivers/net/designware.h b/drivers/net/designware.h
index ce51102..d8bd84d 100644
--- a/drivers/net/designware.h
+++ b/drivers/net/designware.h
@@ -102,6 +102,11 @@ struct eth_dma_regs {
 #define TXSECONDFRAME		(1 << 2)
 #define RXSTART			(1 << 1)
 
+/* Default AXI BUS Burst length */
+#ifndef CONFIG_DW_AXI_BURST_LEN
+#define CONFIG_DW_AXI_BURST_LEN 0
+#endif
+
 /* Descriptior related definitions */
 #define MAC_MAX_FRAME_SZ	(1600)
 
-- 
1.7.9.5



More information about the U-Boot mailing list