public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275
@ 2008-03-17 22:08 Tsi-Chung Liew
  2008-03-18 21:29 ` Wolfgang Denk
  2008-03-30  4:18 ` Ben Warren
  0 siblings, 2 replies; 7+ messages in thread
From: Tsi-Chung Liew @ 2008-03-17 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
---
 drivers/net/mcffec.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 3b81258..71d1960 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -166,6 +166,13 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
 	/* Activate transmit Buffer Descriptor polling */
 	fecp->tdar = 0x01000000;	/* Descriptor polling active    */
 
+	/* FEC fix for MCF5275, FEC unable to initial transmit data packet.
+	 * A nop will ensure the descriptor polling active completed.
+	 */
+#ifdef CONFIG_M5275
+	__asm__ ("nop");
+#endif
+
 #ifdef CFG_UNIFY_CACHE
 	icache_invalid();
 #endif
-- 
1.5.4.1

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

* [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275
  2008-03-17 22:08 [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275 Tsi-Chung Liew
@ 2008-03-18 21:29 ` Wolfgang Denk
  2008-03-30  4:18 ` Ben Warren
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2008-03-18 21:29 UTC (permalink / raw)
  To: u-boot

In message <1205791696-17263-1-git-send-email-Tsi-Chung.Liew@freescale.com> you wrote:
> Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
> ---
>  drivers/net/mcffec.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
> index 3b81258..71d1960 100644
> --- a/drivers/net/mcffec.c
> +++ b/drivers/net/mcffec.c
> @@ -166,6 +166,13 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
>  	/* Activate transmit Buffer Descriptor polling */
>  	fecp->tdar = 0x01000000;	/* Descriptor polling active    */
>  
> +	/* FEC fix for MCF5275, FEC unable to initial transmit data packet.
> +	 * A nop will ensure the descriptor polling active completed.
> +	 */

Please note:

The preferred style for long (multi-line) comments is: 

        /*
         * This is the preferred style for multi-line
         * comments in the Linux kernel source code.
         * Please use it consistently.
         *
         * Description:  A column of asterisks on the left side,
         * with beginning and ending almost-blank lines.
         */


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A meeting is an event at which the minutes are kept and the hours are
lost.

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

* [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275
@ 2008-03-18 22:29 Tsi-Chung Liew
  2008-03-19 14:05 ` Jon Loeliger
  0 siblings, 1 reply; 7+ messages in thread
From: Tsi-Chung Liew @ 2008-03-18 22:29 UTC (permalink / raw)
  To: u-boot

Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
---
 drivers/net/mcffec.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 3b81258..40d7bf2 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -166,6 +166,14 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
 	/* Activate transmit Buffer Descriptor polling */
 	fecp->tdar = 0x01000000;	/* Descriptor polling active    */
 
+	/*
+	 * FEC fix for MCF5275, FEC unable to initial transmit data packet.
+	 * A nop will ensure the descriptor polling active completed.
+	 */
+#ifdef CONFIG_M5275
+	__asm__ ("nop");
+#endif
+
 #ifdef CFG_UNIFY_CACHE
 	icache_invalid();
 #endif
-- 
1.5.4.1

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

* [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275
  2008-03-18 22:29 Tsi-Chung Liew
@ 2008-03-19 14:05 ` Jon Loeliger
  2008-03-19 15:18   ` Scott Wood
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Loeliger @ 2008-03-19 14:05 UTC (permalink / raw)
  To: u-boot

Tsi-Chung Liew wrote:

> +	/*
> +	 * FEC fix for MCF5275, FEC unable to initial transmit data packet.
> +	 * A nop will ensure the descriptor polling active completed.
> +	 */
> +#ifdef CONFIG_M5275
> +	__asm__ ("nop");
> +#endif
> +
>  #ifdef CFG_UNIFY_CACHE
>  	icache_invalid();
>  #endif

At the risk of being very picky, I think this should be
written to have the comment inside the #ifdef so that
the code and comment are not accidentally separated.

#if defined(CONFIG_M5275)
	/*
	 * FEC ...
	 */
	__asm__("nop");
#endif

But, that may be just me.  Take it or leave it. :-)

jdl

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

* [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275
  2008-03-19 14:05 ` Jon Loeliger
@ 2008-03-19 15:18   ` Scott Wood
  0 siblings, 0 replies; 7+ messages in thread
From: Scott Wood @ 2008-03-19 15:18 UTC (permalink / raw)
  To: u-boot

On Wed, Mar 19, 2008 at 09:05:27AM -0500, Jon Loeliger wrote:
> Tsi-Chung Liew wrote:
> 
> > +	/*
> > +	 * FEC fix for MCF5275, FEC unable to initial transmit data packet.
> > +	 * A nop will ensure the descriptor polling active completed.
> > +	 */
> > +#ifdef CONFIG_M5275
> > +	__asm__ ("nop");
> > +#endif
> > +
> >  #ifdef CFG_UNIFY_CACHE
> >  	icache_invalid();
> >  #endif
> 
> At the risk of being very picky, I think this should be
> written to have the comment inside the #ifdef so that
> the code and comment are not accidentally separated.

At the risk of being somewhat less picky, I think there should be more
explanation of why a nop solves anything in a robust manner.

-Scott

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

* [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275
@ 2008-03-20  0:55 Tsi-Chung Liew
  0 siblings, 0 replies; 7+ messages in thread
From: Tsi-Chung Liew @ 2008-03-20  0:55 UTC (permalink / raw)
  To: u-boot

Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
---
 drivers/net/mcffec.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 3b81258..10afa93 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -166,6 +166,18 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
 	/* Activate transmit Buffer Descriptor polling */
 	fecp->tdar = 0x01000000;	/* Descriptor polling active    */
 
+#ifdef CONFIG_M5275
+	/*
+	 * FEC fix for MCF5275. This issue is only happened in cpu polling
+	 * but does not show up in interrupt. It is believe that there is
+	 * a sync issue when accessing from DRAM. This causes FEC unable
+	 * to initial transmit data packet. A NOP instruction will
+	 * ensure the transmit descriptor polling active completed before
+	 * the next instruction begin.
+	 */
+	__asm__ ("nop");
+#endif
+
 #ifdef CFG_UNIFY_CACHE
 	icache_invalid();
 #endif
-- 
1.5.4.1

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

* [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275
  2008-03-17 22:08 [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275 Tsi-Chung Liew
  2008-03-18 21:29 ` Wolfgang Denk
@ 2008-03-30  4:18 ` Ben Warren
  1 sibling, 0 replies; 7+ messages in thread
From: Ben Warren @ 2008-03-30  4:18 UTC (permalink / raw)
  To: u-boot

Tsi-Chung Liew wrote:
> Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
> ---
>  drivers/net/mcffec.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
> index 3b81258..71d1960 100644
> --- a/drivers/net/mcffec.c
> +++ b/drivers/net/mcffec.c
> @@ -166,6 +166,13 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
>  	/* Activate transmit Buffer Descriptor polling */
>  	fecp->tdar = 0x01000000;	/* Descriptor polling active    */
>  
> +	/* FEC fix for MCF5275, FEC unable to initial transmit data packet.
> +	 * A nop will ensure the descriptor polling active completed.
> +	 */
> +#ifdef CONFIG_M5275
> +	__asm__ ("nop");
> +#endif
> +
>  #ifdef CFG_UNIFY_CACHE
>  	icache_invalid();
>  #endif
>   
Applied to net tree. As others have noted, adding a NOP here seems like 
a band-aid, but I can't really dispute it.

thanks,
Ben

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

end of thread, other threads:[~2008-03-30  4:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-17 22:08 [U-Boot-Users] [PATCH] ColdFire: Fix FEC transmit issue for MCF5275 Tsi-Chung Liew
2008-03-18 21:29 ` Wolfgang Denk
2008-03-30  4:18 ` Ben Warren
  -- strict thread matches above, loose matches on Subject: below --
2008-03-18 22:29 Tsi-Chung Liew
2008-03-19 14:05 ` Jon Loeliger
2008-03-19 15:18   ` Scott Wood
2008-03-20  0:55 Tsi-Chung Liew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox