[PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE6685d

7 messages, 3 authors, 2008-04-22 · open the first message on its own page

[PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

From: Stefan Roese <sr@denx.de>
Date: 2008-02-22 08:32:58

405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
the internal loopback mode. Clear these bits so that both EMACs
don't use loopback mode as default.

Signed-off-by: Stefan Roese <sr@denx.de>
---
I'm not sure if this should be done here in the board platform code,
or in the newemac driver or perhaps in some code common for 405EX.

Any thoughts on this welcome.

Thanks.

 arch/powerpc/platforms/40x/kilauea.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
index f9206a7..b5456cc 100644
--- a/arch/powerpc/platforms/40x/kilauea.c
+++ b/arch/powerpc/platforms/40x/kilauea.c
@@ -1,7 +1,7 @@
 /*
  * Kilauea board specific routines
  *
- * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ * Copyright 2007-2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
  *
  * Based on the Walnut code by
  * Josh Boyer <jwboyer@linux.vnet.ibm.com>
@@ -20,6 +20,8 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
+#include <asm/dcr.h>
+#include <asm/dcr-regs.h>
 
 static __initdata struct of_device_id kilauea_of_bus[] = {
 	{ .compatible = "ibm,plb4", },
@@ -45,6 +47,13 @@ static int __init kilauea_probe(void)
 
 	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
 
+	/*
+	 * 405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
+	 * the internal loopback mode. Clear these bits so that both EMACs
+	 * don't use loopback mode as deafult.
+	 */
+	mtdcri(SDR0, SDR0_MFR, mfdcri(SDR0, SDR0_MFR) & ~0x0c000000);
+
 	return 1;
 }
 
-- 
1.5.4.2

Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

From: Josh Boyer <hidden>
Date: 2008-02-22 20:36:53

On Fri, 22 Feb 2008 09:32:12 +0100
Stefan Roese [off-list ref] wrote:
405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
the internal loopback mode. Clear these bits so that both EMACs
don't use loopback mode as default.

Signed-off-by: Stefan Roese <sr@denx.de>
---
I'm not sure if this should be done here in the board platform code,
or in the newemac driver or perhaps in some code common for 405EX.

Any thoughts on this welcome.
Why isn't this done in U-Boot?  Or is it done if the network interface
is used?  I know I've tftp'd a kernel onto my 405EXr board, so I'm
slightly confused why this is needed in the kernel.

Aside from that, I'm OK with it living in the platform code for Kilauea
(an Haleakala by inheritance).  Particularly given the fact that this
should be fixing in U-Boot for any further boards that use 405EX(r)...
right?

josh

Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-02-22 21:37:45

On Fri, 2008-02-22 at 09:32 +0100, Stefan Roese wrote:
405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
the internal loopback mode. Clear these bits so that both EMACs
don't use loopback mode as default.

Signed-off-by: Stefan Roese <sr@denx.de>
---
I'm not sure if this should be done here in the board platform code,
or in the newemac driver or perhaps in some code common for 405EX.

Any thoughts on this welcome.
This should be done in EMAC since we also need to force internal
loopback & clocking when probing the PHY or we might not probe
it properly (and fail reset) if there is no link.

I need to work on that.

Ben.

quoted hunk
Thanks.

 arch/powerpc/platforms/40x/kilauea.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
index f9206a7..b5456cc 100644
--- a/arch/powerpc/platforms/40x/kilauea.c
+++ b/arch/powerpc/platforms/40x/kilauea.c
@@ -1,7 +1,7 @@
 /*
  * Kilauea board specific routines
  *
- * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ * Copyright 2007-2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
  *
  * Based on the Walnut code by
  * Josh Boyer <jwboyer@linux.vnet.ibm.com>
@@ -20,6 +20,8 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
+#include <asm/dcr.h>
+#include <asm/dcr-regs.h>
 
 static __initdata struct of_device_id kilauea_of_bus[] = {
 	{ .compatible = "ibm,plb4", },
@@ -45,6 +47,13 @@ static int __init kilauea_probe(void)
 
 	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
 
+	/*
+	 * 405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
+	 * the internal loopback mode. Clear these bits so that both EMACs
+	 * don't use loopback mode as deafult.
+	 */
+	mtdcri(SDR0, SDR0_MFR, mfdcri(SDR0, SDR0_MFR) & ~0x0c000000);
+
 	return 1;
 }
 

Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

From: Stefan Roese <sr@denx.de>
Date: 2008-02-22 21:50:11

On Friday 22 February 2008, Josh Boyer wrote:
On Fri, 22 Feb 2008 09:32:12 +0100

Stefan Roese [off-list ref] wrote:
quoted
405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
the internal loopback mode. Clear these bits so that both EMACs
don't use loopback mode as default.

Signed-off-by: Stefan Roese <sr@denx.de>
---
I'm not sure if this should be done here in the board platform code,
or in the newemac driver or perhaps in some code common for 405EX.

Any thoughts on this welcome.
Why isn't this done in U-Boot?  Or is it done if the network interface
is used?
Correct. It's only done upon EMAC usage in U-Boot. So when booting completely 
from FLASH, EMAC in Linux is not working.

Best regards,
Stefan

Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

From: Stefan Roese <sr@denx.de>
Date: 2008-02-22 21:55:03

On Friday 22 February 2008, Benjamin Herrenschmidt wrote:
On Fri, 2008-02-22 at 09:32 +0100, Stefan Roese wrote:
quoted
405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
the internal loopback mode. Clear these bits so that both EMACs
don't use loopback mode as default.

Signed-off-by: Stefan Roese <sr@denx.de>
---
I'm not sure if this should be done here in the board platform code,
or in the newemac driver or perhaps in some code common for 405EX.

Any thoughts on this welcome.
This should be done in EMAC since we also need to force internal
loopback & clocking when probing the PHY or we might not probe
it properly (and fail reset) if there is no link.
Yes. Valentines patches are a first step to this.
I need to work on that.
That would be great. Thanks.

BTW: Any news on the generic phy-lib plans for ibm_newemac?

Best regards,
Stefan

Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-04-21 23:46:19

On Sat, 2008-02-23 at 08:27 +1100, Benjamin Herrenschmidt wrote:
On Fri, 2008-02-22 at 09:32 +0100, Stefan Roese wrote:
quoted
405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
the internal loopback mode. Clear these bits so that both EMACs
don't use loopback mode as default.

Signed-off-by: Stefan Roese <sr@denx.de>
---
I'm not sure if this should be done here in the board platform code,
or in the newemac driver or perhaps in some code common for 405EX.

Any thoughts on this welcome.
This should be done in EMAC since we also need to force internal
loopback & clocking when probing the PHY or we might not probe
it properly (and fail reset) if there is no link.
Is that patch still needed if I apply Valentine patches ? I'm fixing
them up so they don't break DCR MMIO anymore.

Cheers,
Ben.

Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode

From: Stefan Roese <sr@denx.de>
Date: 2008-04-22 05:16:01

On Tuesday 22 April 2008, Benjamin Herrenschmidt wrote:
On Sat, 2008-02-23 at 08:27 +1100, Benjamin Herrenschmidt wrote:
quoted
On Fri, 2008-02-22 at 09:32 +0100, Stefan Roese wrote:
quoted
405EX(r) has SDR0_MFR[E0CS/E1CS] set after reset. This selects
the internal loopback mode. Clear these bits so that both EMACs
don't use loopback mode as default.

Signed-off-by: Stefan Roese <sr@denx.de>
---
I'm not sure if this should be done here in the board platform code,
or in the newemac driver or perhaps in some code common for 405EX.

Any thoughts on this welcome.
This should be done in EMAC since we also need to force internal
loopback & clocking when probing the PHY or we might not probe
it properly (and fail reset) if there is no link.
Is that patch still needed if I apply Valentine patches ? I'm fixing
them up so they don't break DCR MMIO anymore.
Great. I will send an additional patch to take care of this 405EX(r) loopback 
issue once your version of Valentines patches is available.

Best regards,
Stefan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help