* [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode
@ 2008-02-22 8:32 Stefan Roese
2008-02-22 20:36 ` Josh Boyer
2008-02-22 21:27 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 7+ messages in thread
From: Stefan Roese @ 2008-02-22 8:32 UTC (permalink / raw)
To: linuxppc-dev
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode
2008-02-22 8:32 [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode Stefan Roese
@ 2008-02-22 20:36 ` Josh Boyer
2008-02-22 21:49 ` Stefan Roese
2008-02-22 21:27 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 7+ messages in thread
From: Josh Boyer @ 2008-02-22 20:36 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
On Fri, 22 Feb 2008 09:32:12 +0100
Stefan Roese <sr@denx.de> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode
2008-02-22 8:32 [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode Stefan Roese
2008-02-22 20:36 ` Josh Boyer
@ 2008-02-22 21:27 ` Benjamin Herrenschmidt
2008-02-22 21:54 ` Stefan Roese
2008-04-21 23:46 ` Benjamin Herrenschmidt
1 sibling, 2 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2008-02-22 21:27 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
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.
> 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;
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode
2008-02-22 20:36 ` Josh Boyer
@ 2008-02-22 21:49 ` Stefan Roese
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2008-02-22 21:49 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev
On Friday 22 February 2008, Josh Boyer wrote:
> On Fri, 22 Feb 2008 09:32:12 +0100
>
> Stefan Roese <sr@denx.de> 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?
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode
2008-02-22 21:27 ` Benjamin Herrenschmidt
@ 2008-02-22 21:54 ` Stefan Roese
2008-04-21 23:46 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2008-02-22 21:54 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
On Friday 22 February 2008, Benjamin Herrenschmidt wrote:
> 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.
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode
2008-02-22 21:27 ` Benjamin Herrenschmidt
2008-02-22 21:54 ` Stefan Roese
@ 2008-04-21 23:46 ` Benjamin Herrenschmidt
2008-04-22 5:15 ` Stefan Roese
1 sibling, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-21 23:46 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
On Sat, 2008-02-23 at 08:27 +1100, Benjamin Herrenschmidt wrote:
> 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.
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode
2008-04-21 23:46 ` Benjamin Herrenschmidt
@ 2008-04-22 5:15 ` Stefan Roese
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2008-04-22 5:15 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
On Tuesday 22 April 2008, Benjamin Herrenschmidt wrote:
> On Sat, 2008-02-23 at 08:27 +1100, Benjamin Herrenschmidt wrote:
> > 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.
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-04-22 5:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-22 8:32 [PATCH] [POWERPC] AMCC Kilauea (405EX): Disable EMAC loopback mode Stefan Roese
2008-02-22 20:36 ` Josh Boyer
2008-02-22 21:49 ` Stefan Roese
2008-02-22 21:27 ` Benjamin Herrenschmidt
2008-02-22 21:54 ` Stefan Roese
2008-04-21 23:46 ` Benjamin Herrenschmidt
2008-04-22 5:15 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).