AMCC Kilauea (405EX): Disable EMAC loopback mode
PATCH 1/1 AMCC Kilauea (405EX): Disable EMAC loopback mode
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.
---
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(-)
arch/powerpc/platforms/40x/kilauea.c +10 -1
@@ -1,7 +1,7 @@/* * Kilauea board specific routines * -* Copyright 2007 DENX Software Engineering, Stefan Roese <[email protected]> +* Copyright 2007-2008 DENX Software Engineering, Stefan Roese <[email protected]> * * Based on the Walnut code by * Josh Boyer <[email protected]>
@@ -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 ; }
Signature · 1 line
1.5.4.2
Quoted 10 lines · On Fri, 22 Feb 2008 09:32:12 +0100 Stefan Roese <[email protected]> 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 <[email protected]>---
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
Quoted 12 lines · Josh Boyer
On Fri, 22 Feb 2008 09:32:12 +0100
Quoted 9 lines · Stefan Roese
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 <[email protected]>---
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.
Quoted 4 lines
Quoted 1 line
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
Quoted 10 lines · Stefan Roese
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 <[email protected]>---
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 41 lines
Thanks.
arch/powerpc/platforms/40x/kilauea.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)arch/powerpc/platforms/40x/kilauea.c +10
-1@@ -1,7 +1,7 @@/* * Kilauea board specific routines * -* Copyright 2007 DENX Software Engineering, Stefan Roese <[email protected]> +* Copyright 2007-2008 DENX Software Engineering, Stefan Roese <[email protected]> * * Based on the Walnut code by * Josh Boyer <[email protected]> @@ -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 ; }
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 9 lines · Stefan Roese
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 <[email protected]>---
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.
Quoted 5 lines
Quoted 1 line
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.
Quoted 1 line
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
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 9 lines · Stefan Roese
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 <[email protected]>---
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.
Quoted 5 lines
Quoted 1 line
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.
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 9 lines · Stefan Roese
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 <[email protected]>---
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.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
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