All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length
@ 2015-01-27  2:54 sonic.adi at gmail.com
  2015-01-27 20:43 ` Joe Hershberger
  0 siblings, 1 reply; 5+ messages in thread
From: sonic.adi at gmail.com @ 2015-01-27  2:54 UTC (permalink / raw)
  To: u-boot

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

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

Signed-off-by: Sonic Zhang <sonic.zhang@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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length
  2015-01-27  2:54 [U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length sonic.adi at gmail.com
@ 2015-01-27 20:43 ` Joe Hershberger
  2015-01-28  3:24   ` Sonic Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Hershberger @ 2015-01-27 20:43 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 26, 2015 at 8:54 PM, <sonic.adi@gmail.com> wrote:
>
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> Board can define its own AXI burst length to improve DWMAC DMA
performance.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@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);
>
This should probably include:
+#if CONFIG_DW_AXI_BURST_LEN
so that this register is only accessed if configured.
> +       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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length
  2015-01-27 20:43 ` Joe Hershberger
@ 2015-01-28  3:24   ` Sonic Zhang
  2015-01-28  9:42     ` Joe Hershberger
  0 siblings, 1 reply; 5+ messages in thread
From: Sonic Zhang @ 2015-01-28  3:24 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On Wed, Jan 28, 2015 at 4:43 AM, Joe Hershberger
<joe.hershberger@gmail.com> wrote:
> On Mon, Jan 26, 2015 at 8:54 PM, <sonic.adi@gmail.com> wrote:
>>
>> From: Sonic Zhang <sonic.zhang@analog.com>
>>
>> Board can define its own AXI burst length to improve DWMAC DMA
>> performance.
>>
>> Signed-off-by: Sonic Zhang <sonic.zhang@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);
>>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length
  2015-01-28  3:24   ` Sonic Zhang
@ 2015-01-28  9:42     ` Joe Hershberger
  2015-01-29  5:15       ` Sonic Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Hershberger @ 2015-01-28  9:42 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 27, 2015 at 9:24 PM, Sonic Zhang <sonic.adi@gmail.com> wrote:
>
> Hi Joe,
>
> On Wed, Jan 28, 2015 at 4:43 AM, Joe Hershberger
> <joe.hershberger@gmail.com> wrote:
> > On Mon, Jan 26, 2015 at 8:54 PM, <sonic.adi@gmail.com> wrote:
> >>
> >> From: Sonic Zhang <sonic.zhang@analog.com>
> >>
> >> Board can define its own AXI burst length to improve DWMAC DMA
> >> performance.
> >>
> >> Signed-off-by: Sonic Zhang <sonic.zhang@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);
> >>
> > 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
> +

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length
  2015-01-28  9:42     ` Joe Hershberger
@ 2015-01-29  5:15       ` Sonic Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Sonic Zhang @ 2015-01-29  5:15 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On Wed, Jan 28, 2015 at 5:42 PM, Joe Hershberger
<joe.hershberger@gmail.com> wrote:
> On Tue, Jan 27, 2015 at 9:24 PM, Sonic Zhang <sonic.adi@gmail.com> wrote:
>>
>> Hi Joe,
>>
>> On Wed, Jan 28, 2015 at 4:43 AM, Joe Hershberger
>> <joe.hershberger@gmail.com> wrote:
>> > On Mon, Jan 26, 2015 at 8:54 PM, <sonic.adi@gmail.com> wrote:
>> >>
>> >> From: Sonic Zhang <sonic.zhang@analog.com>
>> >>
>> >> Board can define its own AXI burst length to improve DWMAC DMA
>> >> performance.
>> >>
>> >> Signed-off-by: Sonic Zhang <sonic.zhang@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);
>> >>
>> > 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
>> +
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-29  5:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27  2:54 [U-Boot] [PATCH] net: configure DWMAC DMA by default AXI burst length sonic.adi at gmail.com
2015-01-27 20:43 ` Joe Hershberger
2015-01-28  3:24   ` Sonic Zhang
2015-01-28  9:42     ` Joe Hershberger
2015-01-29  5:15       ` Sonic Zhang

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.