* [U-Boot] [PATCH] MPC5200 FEC MII speed register
@ 2009-03-11 19:08 Jon
2009-03-13 3:26 ` Jon Smirl
2009-03-13 13:23 ` [U-Boot] Fwd: " Jon Smirl
0 siblings, 2 replies; 5+ messages in thread
From: Jon @ 2009-03-11 19:08 UTC (permalink / raw)
To: u-boot
From: Jon Smirl <jonsmirl@gmail.com>
Set a non-zero speed in the MII register so that MII commands will work.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---
drivers/net/mpc5xxx_fec.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
index 89e91c3..1876b76 100644
--- a/drivers/net/mpc5xxx_fec.c
+++ b/drivers/net/mpc5xxx_fec.c
@@ -285,13 +285,6 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
}
fec->eth->x_cntrl = 0x00000000; /* half-duplex, heartbeat disabled */
- if (fec->xcv_type != SEVENWIRE) {
- /*
- * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
- * and do not drop the Preamble.
- */
- fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
- }
/*
* Set Opcode/Pause Duration Register
@@ -649,6 +642,15 @@ static void mpc5xxx_fec_halt(struct eth_device *dev)
*/
udelay(10);
+ /* don't leave the MII speed set to zero */
+ if (fec->xcv_type != SEVENWIRE) {
+ /*
+ * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
+ * and do not drop the Preamble.
+ */
+ fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
+ }
+
#if (DEBUG & 0x3)
printf("Ethernet task stopped\n");
#endif
@@ -906,6 +908,13 @@ int mpc5xxx_fec_initialize(bd_t * bis)
#else
#error fec->xcv_type not initialized.
#endif
+ if (fec->xcv_type != SEVENWIRE) {
+ /*
+ * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
+ * and do not drop the Preamble.
+ */
+ fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
+ }
dev->priv = (void *)fec;
dev->iobase = MPC5XXX_FEC;
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] [PATCH] MPC5200 FEC MII speed register
2009-03-11 19:08 [U-Boot] [PATCH] MPC5200 FEC MII speed register Jon
@ 2009-03-13 3:26 ` Jon Smirl
2009-03-13 7:26 ` Wolfgang Denk
2009-03-13 13:23 ` [U-Boot] Fwd: " Jon Smirl
1 sibling, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2009-03-13 3:26 UTC (permalink / raw)
To: u-boot
On Wed, Mar 11, 2009 at 3:08 PM, Jon <jonsmirl@gmail.com> wrote:
> From: Jon Smirl <jonsmirl@gmail.com>
Who's the maintainer for the mpc5200 core code? It isn't clear from
the MAINTAINERS file.
> Set a non-zero speed in the MII register so that MII commands will work.
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
> ?drivers/net/mpc5xxx_fec.c | ? 23 ++++++++++++++++-------
> ?1 files changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
> index 89e91c3..1876b76 100644
> --- a/drivers/net/mpc5xxx_fec.c
> +++ b/drivers/net/mpc5xxx_fec.c
> @@ -285,13 +285,6 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
> ? ? ? ?}
>
> ? ? ? ?fec->eth->x_cntrl = 0x00000000; /* half-duplex, heartbeat disabled */
> - ? ? ? if (fec->xcv_type != SEVENWIRE) {
> - ? ? ? ? ? ? ? /*
> - ? ? ? ? ? ? ? ?* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
> - ? ? ? ? ? ? ? ?* and do not drop the Preamble.
> - ? ? ? ? ? ? ? ?*/
> - ? ? ? ? ? ? ? fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
> - ? ? ? }
>
> ? ? ? ?/*
> ? ? ? ? * Set Opcode/Pause Duration Register
> @@ -649,6 +642,15 @@ static void mpc5xxx_fec_halt(struct eth_device *dev)
> ? ? ? ? */
> ? ? ? ?udelay(10);
>
> + ? ? ? /* don't leave the MII speed set to zero */
> + ? ? ? if (fec->xcv_type != SEVENWIRE) {
> + ? ? ? ? ? ? ? /*
> + ? ? ? ? ? ? ? ?* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
> + ? ? ? ? ? ? ? ?* and do not drop the Preamble.
> + ? ? ? ? ? ? ? ?*/
> + ? ? ? ? ? ? ? fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
> + ? ? ? }
> +
> ?#if (DEBUG & 0x3)
> ? ? ? ?printf("Ethernet task stopped\n");
> ?#endif
> @@ -906,6 +908,13 @@ int mpc5xxx_fec_initialize(bd_t * bis)
> ?#else
> ?#error fec->xcv_type not initialized.
> ?#endif
> + ? ? ? if (fec->xcv_type != SEVENWIRE) {
> + ? ? ? ? ? ? ? /*
> + ? ? ? ? ? ? ? ?* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
> + ? ? ? ? ? ? ? ?* and do not drop the Preamble.
> + ? ? ? ? ? ? ? ?*/
> + ? ? ? ? ? ? ? fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
> + ? ? ? }
>
> ? ? ? ?dev->priv = (void *)fec;
> ? ? ? ?dev->iobase = MPC5XXX_FEC;
>
>
--
Jon Smirl
jonsmirl at gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread* [U-Boot] [PATCH] MPC5200 FEC MII speed register
2009-03-13 3:26 ` Jon Smirl
@ 2009-03-13 7:26 ` Wolfgang Denk
0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2009-03-13 7:26 UTC (permalink / raw)
To: u-boot
Dear Jon Smirl,
In message <9e4733910903122026h638e6cbfl89fa30664dcffd2@mail.gmail.com> you wrote:
> On Wed, Mar 11, 2009 at 3:08 PM, Jon <jonsmirl@gmail.com> wrote:
> > From: Jon Smirl <jonsmirl@gmail.com>
>
> Who's the maintainer for the mpc5200 core code? It isn't clear from
> the MAINTAINERS file.
If in doubt, contact the respective custodian.
See http://www.denx.de/wiki/U-Boot/Custodians
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
"It's when they say 2 + 2 = 5 that I begin to argue." - Eric Pepke
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Fwd: [PATCH] MPC5200 FEC MII speed register
2009-03-11 19:08 [U-Boot] [PATCH] MPC5200 FEC MII speed register Jon
2009-03-13 3:26 ` Jon Smirl
@ 2009-03-13 13:23 ` Jon Smirl
2009-03-13 16:28 ` John Rigby
1 sibling, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2009-03-13 13:23 UTC (permalink / raw)
To: u-boot
John, could you please apply this.
Without this the MII commands don't work on any of the mpc5200
platforms. mpc5xxx_fec_halt() sets the mii speed register to zero it
needs to left at a non-zero speed for the commands to function.
---------- Forwarded message ----------
From: Jon <jonsmirl@gmail.com>
Date: Wed, Mar 11, 2009 at 3:08 PM
Subject: [PATCH] MPC5200 FEC MII speed register
To: u-boot at lists.denx.de
From: Jon Smirl <jonsmirl@gmail.com>
Set a non-zero speed in the MII register so that MII commands will work.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---
?drivers/net/mpc5xxx_fec.c | ? 23 ++++++++++++++++-------
?1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
index 89e91c3..1876b76 100644
--- a/drivers/net/mpc5xxx_fec.c
+++ b/drivers/net/mpc5xxx_fec.c
@@ -285,13 +285,6 @@ static int mpc5xxx_fec_init(struct eth_device
*dev, bd_t * bis)
? ? ? ?}
? ? ? ?fec->eth->x_cntrl = 0x00000000; /* half-duplex, heartbeat disabled */
- ? ? ? if (fec->xcv_type != SEVENWIRE) {
- ? ? ? ? ? ? ? /*
- ? ? ? ? ? ? ? ?* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
- ? ? ? ? ? ? ? ?* and do not drop the Preamble.
- ? ? ? ? ? ? ? ?*/
- ? ? ? ? ? ? ? fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) <<
1); /* No MII for 7-wire mode */
- ? ? ? }
? ? ? ?/*
? ? ? ? * Set Opcode/Pause Duration Register
@@ -649,6 +642,15 @@ static void mpc5xxx_fec_halt(struct eth_device *dev)
? ? ? ? */
? ? ? ?udelay(10);
+ ? ? ? /* don't leave the MII speed set to zero */
+ ? ? ? if (fec->xcv_type != SEVENWIRE) {
+ ? ? ? ? ? ? ? /*
+ ? ? ? ? ? ? ? ?* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
+ ? ? ? ? ? ? ? ?* and do not drop the Preamble.
+ ? ? ? ? ? ? ? ?*/
+ ? ? ? ? ? ? ? fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) <<
1); /* No MII for 7-wire mode */
+ ? ? ? }
+
?#if (DEBUG & 0x3)
? ? ? ?printf("Ethernet task stopped\n");
?#endif
@@ -906,6 +908,13 @@ int mpc5xxx_fec_initialize(bd_t * bis)
?#else
?#error fec->xcv_type not initialized.
?#endif
+ ? ? ? if (fec->xcv_type != SEVENWIRE) {
+ ? ? ? ? ? ? ? /*
+ ? ? ? ? ? ? ? ?* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
+ ? ? ? ? ? ? ? ?* and do not drop the Preamble.
+ ? ? ? ? ? ? ? ?*/
+ ? ? ? ? ? ? ? fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) <<
1); /* No MII for 7-wire mode */
+ ? ? ? }
? ? ? ?dev->priv = (void *)fec;
? ? ? ?dev->iobase = MPC5XXX_FEC;
--
Jon Smirl
jonsmirl at gmail.com
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] Fwd: [PATCH] MPC5200 FEC MII speed register
2009-03-13 13:23 ` [U-Boot] Fwd: " Jon Smirl
@ 2009-03-13 16:28 ` John Rigby
0 siblings, 0 replies; 5+ messages in thread
From: John Rigby @ 2009-03-13 16:28 UTC (permalink / raw)
To: u-boot
Jon Smirl wrote:
> John, could you please apply this.
>
> Without this the MII commands don't work on any of the mpc5200
> platforms. mpc5xxx_fec_halt() sets the mii speed register to zero it
> needs to left at a non-zero speed for the commands to function.
>
> ---------- Forwarded message ----------
> From: Jon <jonsmirl@gmail.com>
> Date: Wed, Mar 11, 2009 at 3:08 PM
> Subject: [PATCH] MPC5200 FEC MII speed register
> To: u-boot at lists.denx.de
>
>
> From: Jon Smirl <jonsmirl@gmail.com>
>
> Set a non-zero speed in the MII register so that MII commands will work.
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
> drivers/net/mpc5xxx_fec.c | 23 ++++++++++++++++-------
> 1 files changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
> index 89e91c3..1876b76 100644
> --- a/drivers/net/mpc5xxx_fec.c
> +++ b/drivers/net/mpc5xxx_fec.c
> @@ -285,13 +285,6 @@ static int mpc5xxx_fec_init(struct eth_device
> *dev, bd_t * bis)
> }
>
> fec->eth->x_cntrl = 0x00000000; /* half-duplex, heartbeat disabled */
> - if (fec->xcv_type != SEVENWIRE) {
> - /*
> - * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
> - * and do not drop the Preamble.
> - */
> - fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) <<
> 1); /* No MII for 7-wire mode */
> - }
>
> /*
> * Set Opcode/Pause Duration Register
> @@ -649,6 +642,15 @@ static void mpc5xxx_fec_halt(struct eth_device *dev)
> */
> udelay(10);
>
> + /* don't leave the MII speed set to zero */
> + if (fec->xcv_type != SEVENWIRE) {
> + /*
> + * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
> + * and do not drop the Preamble.
> + */
> + fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) <<
> 1); /* No MII for 7-wire mode */
> + }
> +
> #if (DEBUG & 0x3)
> printf("Ethernet task stopped\n");
> #endif
> @@ -906,6 +908,13 @@ int mpc5xxx_fec_initialize(bd_t * bis)
> #else
> #error fec->xcv_type not initialized.
> #endif
> + if (fec->xcv_type != SEVENWIRE) {
> + /*
> + * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
> + * and do not drop the Preamble.
> + */
> + fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) <<
> 1); /* No MII for 7-wire mode */
> + }
>
> dev->priv = (void *)fec;
> dev->iobase = MPC5XXX_FEC;
>
>
>
>
>
done
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-03-13 16:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 19:08 [U-Boot] [PATCH] MPC5200 FEC MII speed register Jon
2009-03-13 3:26 ` Jon Smirl
2009-03-13 7:26 ` Wolfgang Denk
2009-03-13 13:23 ` [U-Boot] Fwd: " Jon Smirl
2009-03-13 16:28 ` John Rigby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox