All of lore.kernel.org
 help / color / mirror / Atom feed
* RX problem in ibm_newemac driver
@ 2009-03-10 19:50 Felix Radensky
  2009-03-10 20:50 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Felix Radensky @ 2009-03-10 19:50 UTC (permalink / raw)
  To: netdev, Benjamin Herrenschmidt

Hi,

I'm experiencing RX problem on custom board based on AMCC
405EXr processor. Channel 0 of EMAC is connected to 10/100
Micrel KSZ8041NL PHY in MII mode. Ethernet works fine in
u-boot (version 2009.01). In Linux (2.6.27) Ethernet works fine
as well if EMAC was initialized in u-boot. It is enough to send
ping from u-boot (even to non-existing host) to make things work
in linux. But if u-boot takes kernel and ramdisk images from flash
and does not initialize EMAC only TX side works in linux.

I can see that TX counters are incremented when pinging from
EMAC side, but RX counters remain zero.  RX error counter
in PHY is zero as well.  I've enabled debugging in EMAC
driver and verified that RX EOB interrupt is not triggered.
FER register in RGMII bridge is properly configured for MII
mode on channel 0.  I've tried to dump EMAC registers using
ethtool and got machine check exception.

I don't know what else could be done to identify the source of
the problem. Any tips would be greatly appreciated.

Thanks.

Felix.

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

* Re: RX problem in ibm_newemac driver
  2009-03-10 19:50 RX problem in ibm_newemac driver Felix Radensky
@ 2009-03-10 20:50 ` Benjamin Herrenschmidt
  2009-03-10 22:14   ` Felix Radensky
  0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2009-03-10 20:50 UTC (permalink / raw)
  To: Felix Radensky; +Cc: netdev

On Tue, 2009-03-10 at 21:50 +0200, Felix Radensky wrote:
> Hi,
> 
> I'm experiencing RX problem on custom board based on AMCC
> 405EXr processor. Channel 0 of EMAC is connected to 10/100
> Micrel KSZ8041NL PHY in MII mode. Ethernet works fine in
> u-boot (version 2009.01). In Linux (2.6.27) Ethernet works fine
> as well if EMAC was initialized in u-boot. It is enough to send
> ping from u-boot (even to non-existing host) to make things work
> in linux. But if u-boot takes kernel and ramdisk images from flash
> and does not initialize EMAC only TX side works in linux.

You should CC linuxppc-dev where you are more likely to find people to
help here.

> I can see that TX counters are incremented when pinging from
> EMAC side, but RX counters remain zero.  RX error counter
> in PHY is zero as well.  I've enabled debugging in EMAC
> driver and verified that RX EOB interrupt is not triggered.
> FER register in RGMII bridge is properly configured for MII
> mode on channel 0.  I've tried to dump EMAC registers using
> ethtool and got machine check exception.
> 
> I don't know what else could be done to identify the source of
> the problem. Any tips would be greatly appreciated.

I don't have a 405EXr here, but it smells like the old reset problem
when the link is down. Maybe we are missing code to force clocks on
405EXr when there's no link ?

Ben.



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

* Re: RX problem in ibm_newemac driver
  2009-03-10 20:50 ` Benjamin Herrenschmidt
@ 2009-03-10 22:14   ` Felix Radensky
  2009-03-10 22:57     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Felix Radensky @ 2009-03-10 22:14 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: netdev

Benjamin Herrenschmidt wrote:
> On Tue, 2009-03-10 at 21:50 +0200, Felix Radensky wrote:
>   
>> Hi,
>>
>> I'm experiencing RX problem on custom board based on AMCC
>> 405EXr processor. Channel 0 of EMAC is connected to 10/100
>> Micrel KSZ8041NL PHY in MII mode. Ethernet works fine in
>> u-boot (version 2009.01). In Linux (2.6.27) Ethernet works fine
>> as well if EMAC was initialized in u-boot. It is enough to send
>> ping from u-boot (even to non-existing host) to make things work
>> in linux. But if u-boot takes kernel and ramdisk images from flash
>> and does not initialize EMAC only TX side works in linux.
>>     
>
> You should CC linuxppc-dev where you are more likely to find people to
> help here.
>
>   

I've sent a message to linuxppc-dev yesterday, but didn't get any reply 
so far.
>> I can see that TX counters are incremented when pinging from
>> EMAC side, but RX counters remain zero.  RX error counter
>> in PHY is zero as well.  I've enabled debugging in EMAC
>> driver and verified that RX EOB interrupt is not triggered.
>> FER register in RGMII bridge is properly configured for MII
>> mode on channel 0.  I've tried to dump EMAC registers using
>> ethtool and got machine check exception.
>>
>> I don't know what else could be done to identify the source of
>> the problem. Any tips would be greatly appreciated.
>>     
>
> I don't have a 405EXr here, but it smells like the old reset problem
> when the link is down. Maybe we are missing code to force clocks on
> 405EXr when there's no link ?
>   

Yes, seems logical. U-boot has code to enable and disable loopback clock
for 440SPE, 440EPX,440GRX,405EX, 460EX and 460GT.

I can test patches on my board. Alternatively, I can try something myself
if you can provide some guidance. I guess you are referring to the code 
using
EMAC_FTR_440GX_PHY_CLK_FIX and EMAC_FTR_440EP_PHY_CLK_FIX.

Thanks.

Felix.


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

* Re: RX problem in ibm_newemac driver
  2009-03-10 22:14   ` Felix Radensky
@ 2009-03-10 22:57     ` Benjamin Herrenschmidt
       [not found]       ` <49B6FA3B.8030509@embedded-sol.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2009-03-10 22:57 UTC (permalink / raw)
  To: Felix Radensky; +Cc: netdev

On Wed, 2009-03-11 at 00:14 +0200, Felix Radensky wrote:
> Yes, seems logical. U-boot has code to enable and disable loopback clock
> for 440SPE, 440EPX,440GRX,405EX, 460EX and 460GT.
> 
> I can test patches on my board. Alternatively, I can try something myself
> if you can provide some guidance. I guess you are referring to the code 
> using
> EMAC_FTR_440GX_PHY_CLK_FIX and EMAC_FTR_440EP_PHY_CLK_FIX.

It would be nice if you could try something as I don't have anything to
test here.

And yes, it's probably one of those 2 fixes that need to be extended.

I'll have a look later today if I can find the 405EXr user manual and
give you more precise guidance.

Cheers,
Ben.



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

* Re: RX problem in ibm_newemac driver
       [not found]       ` <49B6FA3B.8030509@embedded-sol.com>
@ 2009-03-11  0:21         ` Benjamin Herrenschmidt
  2009-03-11  8:56           ` Felix Radensky
  0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2009-03-11  0:21 UTC (permalink / raw)
  To: Felix Radensky; +Cc: netdev, linuxppc-dev list

On Wed, 2009-03-11 at 01:39 +0200, Felix Radensky wrote:
> Benjamin Herrenschmidt wrote:
> > On Wed, 2009-03-11 at 00:14 +0200, Felix Radensky wrote:
> >   
> >> Yes, seems logical. U-boot has code to enable and disable loopback clock
> >> for 440SPE, 440EPX,440GRX,405EX, 460EX and 460GT.
> >>
> >> I can test patches on my board. Alternatively, I can try something myself
> >> if you can provide some guidance. I guess you are referring to the code 
> >> using
> >> EMAC_FTR_440GX_PHY_CLK_FIX and EMAC_FTR_440EP_PHY_CLK_FIX.
> >>     
> >
> > It would be nice if you could try something as I don't have anything to
> > test here.
> >
> > And yes, it's probably one of those 2 fixes that need to be extended.
> >
> > I'll have a look later today if I can find the 405EXr user manual and
> > give you more precise guidance.

>From the doc, it looks like it needs the 440 type workaround (and the
405EX as well). Can you try this patch:

emac: Fix clock control for 405EX and 405EXr chips

The EMAC variant in the 405EX and 405EXr chips needs the "440EP" type clock
control workaround to avoid lockups of the Rx side during reset.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.c	2009-03-11 11:13:37.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.c	2009-03-11 11:14:00.000000000 +1100
@@ -2594,6 +2594,9 @@ static int __devinit emac_init_config(st
 		if (of_device_is_compatible(np, "ibm,emac-460ex") ||
 		    of_device_is_compatible(np, "ibm,emac-460gt"))
 			dev->features |= EMAC_FTR_460EX_PHY_CLK_FIX;
+		if (of_device_is_compatible(np, "ibm,emac-405ex") ||
+		    of_device_is_compatible(np, "ibm,emac-405exr"))
+			dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX;
 	} else if (of_device_is_compatible(np, "ibm,emac4")) {
 		dev->features |= EMAC_FTR_EMAC4;
 		if (of_device_is_compatible(np, "ibm,emac-440gx"))



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

* Re: RX problem in ibm_newemac driver
  2009-03-11  0:21         ` Benjamin Herrenschmidt
@ 2009-03-11  8:56           ` Felix Radensky
  2009-03-13 20:49               ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Felix Radensky @ 2009-03-11  8:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: netdev, linuxppc-dev list

Benjamin Herrenschmidt wrote:
> On Wed, 2009-03-11 at 01:39 +0200, Felix Radensky wrote:
>   
>> Benjamin Herrenschmidt wrote:
>>     
>>> On Wed, 2009-03-11 at 00:14 +0200, Felix Radensky wrote:
>>>   
>>>       
>>>> Yes, seems logical. U-boot has code to enable and disable loopback clock
>>>> for 440SPE, 440EPX,440GRX,405EX, 460EX and 460GT.
>>>>
>>>> I can test patches on my board. Alternatively, I can try something myself
>>>> if you can provide some guidance. I guess you are referring to the code 
>>>> using
>>>> EMAC_FTR_440GX_PHY_CLK_FIX and EMAC_FTR_440EP_PHY_CLK_FIX.
>>>>     
>>>>         
>>> It would be nice if you could try something as I don't have anything to
>>> test here.
>>>
>>> And yes, it's probably one of those 2 fixes that need to be extended.
>>>
>>> I'll have a look later today if I can find the 405EXr user manual and
>>> give you more precise guidance.
>>>       
>
> >From the doc, it looks like it needs the 440 type workaround (and the
> 405EX as well). Can you try this patch:
>
> emac: Fix clock control for 405EX and 405EXr chips
>
> The EMAC variant in the 405EX and 405EXr chips needs the "440EP" type clock
> control workaround to avoid lockups of the Rx side during reset.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> Index: linux-work/drivers/net/ibm_newemac/core.c
> ===================================================================
> --- linux-work.orig/drivers/net/ibm_newemac/core.c	2009-03-11 11:13:37.000000000 +1100
> +++ linux-work/drivers/net/ibm_newemac/core.c	2009-03-11 11:14:00.000000000 +1100
> @@ -2594,6 +2594,9 @@ static int __devinit emac_init_config(st
>  		if (of_device_is_compatible(np, "ibm,emac-460ex") ||
>  		    of_device_is_compatible(np, "ibm,emac-460gt"))
>  			dev->features |= EMAC_FTR_460EX_PHY_CLK_FIX;
> +		if (of_device_is_compatible(np, "ibm,emac-405ex") ||
> +		    of_device_is_compatible(np, "ibm,emac-405exr"))
> +			dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX;
>  	} else if (of_device_is_compatible(np, "ibm,emac4")) {
>  		dev->features |= EMAC_FTR_EMAC4;
>  		if (of_device_is_compatible(np, "ibm,emac-440gx"))
>
>
>   
Hi, Ben

This patch fixes a problem for me. Thank you very much for a quick fix.

Felix.

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

* Re: RX problem in ibm_newemac driver
  2009-03-11  8:56           ` Felix Radensky
@ 2009-03-13 20:49               ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-03-13 20:49 UTC (permalink / raw)
  To: felix; +Cc: benh, netdev, linuxppc-dev

From: Felix Radensky <felix@embedded-sol.com>
Date: Wed, 11 Mar 2009 10:56:31 +0200

> Benjamin Herrenschmidt wrote:
> > emac: Fix clock control for 405EX and 405EXr chips
> >
> > The EMAC variant in the 405EX and 405EXr chips needs the "440EP" type clock
> > control workaround to avoid lockups of the Rx side during reset.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
 ...
> This patch fixes a problem for me. Thank you very much for a quick fix.

Patch applied, thanks everyone.

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

* Re: RX problem in ibm_newemac driver
@ 2009-03-13 20:49               ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-03-13 20:49 UTC (permalink / raw)
  To: felix; +Cc: linuxppc-dev, netdev

From: Felix Radensky <felix@embedded-sol.com>
Date: Wed, 11 Mar 2009 10:56:31 +0200

> Benjamin Herrenschmidt wrote:
> > emac: Fix clock control for 405EX and 405EXr chips
> >
> > The EMAC variant in the 405EX and 405EXr chips needs the "440EP" type clock
> > control workaround to avoid lockups of the Rx side during reset.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
 ...
> This patch fixes a problem for me. Thank you very much for a quick fix.

Patch applied, thanks everyone.

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

end of thread, other threads:[~2009-03-13 20:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-10 19:50 RX problem in ibm_newemac driver Felix Radensky
2009-03-10 20:50 ` Benjamin Herrenschmidt
2009-03-10 22:14   ` Felix Radensky
2009-03-10 22:57     ` Benjamin Herrenschmidt
     [not found]       ` <49B6FA3B.8030509@embedded-sol.com>
2009-03-11  0:21         ` Benjamin Herrenschmidt
2009-03-11  8:56           ` Felix Radensky
2009-03-13 20:49             ` David Miller
2009-03-13 20:49               ` David Miller

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.