Skip to contentSkip to conversation

net: configure DWMAC DMA by default AXI burst length

PATCH New sonic.adi at gmail.com 2 participants 5 messages Jan 27, 2015 – Jan 29, 2015 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: configure DWMAC DMA by default AXI burst length

From: Sonic Zhang <[email protected]>

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

---

 drivers/net/designware.c |    2 ++
 drivers/net/designware.h |    5 +++++
 2 files changed, 7 insertions(+)
drivers/net/designware.c +2 -0
index 9ded895..d8d6792 100644
@@ -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",
drivers/net/designware.h +5 -0
index ce51102..d8bd84d 100644
@@ -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)
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 net: configure DWMAC DMA by default AXI burst length

Quoted 4 lines · On Mon, Jan 26, 2015 at 8:54 PM, <[email protected]> wrote:

From: Sonic Zhang <[email protected]>

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

performance.

drivers/net/designware.c static int dw_eth_init(struct eth_device *dev, bd_t

Quoted 13 lines

---

 drivers/net/designware.c |    2 ++
 drivers/net/designware.h |    5 +++++
 2 files changed, 7 insertions(+)
drivers/net/designware.c +0 -0
index 9ded895..d8d6792 100644
@@ -256,6 +256,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t

*bis)

drivers/net/designware.c static int dw_eth_init(struct eth_device *dev, bd_t *bis) · line 258

Quoted 3 lines
drivers/net/designware.c +0 -0
        writel(readl(&dma_p->opmode) | RXSTART | TXSTART, &dma_p->opmode);
 

This should probably include:
+#if CONFIG_DW_AXI_BURST_LEN
so that this register is only accessed if configured.

Quoted 24 lines
drivers/net/designware.c +2 -0
+       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",
drivers/net/designware.h +5 -1
index ce51102..d8bd84d 100644
@@ -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

#2 lore raw

PATCH 1/1 net: configure DWMAC DMA by default AXI burst length

Hi Joe,

Quoted 21 lines · Joe Hershberger
Quoted 20 lines · On Mon, Jan 26, 2015 at 8:54 PM, <[email protected]> wrote:

From: Sonic Zhang <[email protected]>

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

---

 drivers/net/designware.c |    2 ++
 drivers/net/designware.h |    5 +++++
 2 files changed, 7 insertions(+)
drivers/net/designware.c +0 -0
index 9ded895..d8d6792 100644
@@ -256,6 +256,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t
 *bis)
 
Quoted 5 lines

drivers/net/designware.c static int dw_eth_init(struct eth_device *dev, bd_t *bis) · line 258

Quoted 2 lines
drivers/net/designware.c +0 -0
        writel(readl(&dma_p->opmode) | RXSTART | TXSTART, &dma_p->opmode);
 

This should probably include:
+#if CONFIG_DW_AXI_BURST_LEN
so that this register is only accessed if configured.

CONFIG_DW_AXI_BURST_LEN is always defined in designware.h in the same patch.

+/* Default AXI BUS Burst length */
+#ifndef CONFIG_DW_AXI_BURST_LEN
+#define CONFIG_DW_AXI_BURST_LEN 0
+#endif
+

Regards,

Sonic

#3 lore raw

PATCH 1/1 net: configure DWMAC DMA by default AXI burst length

Quoted 19 lines · Sonic Zhang

Hi Joe,

Quoted 14 lines · Joe Hershberger
Quoted 13 lines · On Mon, Jan 26, 2015 at 8:54 PM, <[email protected]> wrote:

From: Sonic Zhang <[email protected]>

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

---

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

drivers/net/designware.c static int dw_eth_init(struct eth_device *dev, bd_t · line 258

Quoted 8 lines
drivers/net/designware.c +0 -0
index 9ded895..d8d6792 100644
@@ -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);

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

This should probably include:
+#if CONFIG_DW_AXI_BURST_LEN
so that this register is only accessed if configured.

CONFIG_DW_AXI_BURST_LEN is always defined in designware.h in the same

patch.

drivers/net/designware.h struct eth_dma_regs { · line 109

Quoted 6 lines
drivers/net/designware.h +5 -0
+/* Default AXI BUS Burst length */
+#ifndef CONFIG_DW_AXI_BURST_LEN
+#define CONFIG_DW_AXI_BURST_LEN 0
+#endif
+

Yes, I saw that... sorry I wasn't clear. I meant don't we want to avoid the write (preserving existing behavior) instead of ensuring that it is set, and still adding a register write that is (presumably) a NOP?

-Joe

#4 lore raw

PATCH 1/1 net: configure DWMAC DMA by default AXI burst length

Hi Joe,

Quoted 37 lines · Joe Hershberger
Quoted 36 lines · Sonic Zhang

Hi Joe,

Quoted 21 lines · Joe Hershberger
Quoted 20 lines · On Mon, Jan 26, 2015 at 8:54 PM, <[email protected]> wrote:

From: Sonic Zhang <[email protected]>

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

---

 drivers/net/designware.c |    2 ++
 drivers/net/designware.h |    5 +++++
 2 files changed, 7 insertions(+)
drivers/net/designware.c +0 -0
index 9ded895..d8d6792 100644
@@ -256,6 +256,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t
 *bis)
 
Quoted 6 lines

drivers/net/designware.c static int dw_eth_init(struct eth_device *dev, bd_t · line 260

Quoted 3 lines
drivers/net/designware.c +0 -0
        writel(readl(&dma_p->opmode) | RXSTART | TXSTART,
 &dma_p->opmode);
 

This should probably include:
+#if CONFIG_DW_AXI_BURST_LEN
so that this register is only accessed if configured.

CONFIG_DW_AXI_BURST_LEN is always defined in designware.h in the same patch.

Quoted 9 lines

drivers/net/designware.h struct eth_dma_regs { · line 109

Quoted 5 lines
drivers/net/designware.h +5 -0
+/* Default AXI BUS Burst length */
+#ifndef CONFIG_DW_AXI_BURST_LEN
+#define CONFIG_DW_AXI_BURST_LEN 0
+#endif
+

Yes, I saw that... sorry I wasn't clear. I meant don't we want to avoid the write (preserving existing behavior) instead of ensuring that it is set, and still adding a register write that is (presumably) a NOP?

OK, I will update the patch.

Sonic