public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] MPC512x FEC/MII
@ 2011-09-09  9:51 Schneider, Kolja
  2011-09-12 21:01 ` Bernhard Kaindl
  0 siblings, 1 reply; 5+ messages in thread
From: Schneider, Kolja @ 2011-09-09  9:51 UTC (permalink / raw)
  To: u-boot

Hi all,

I have recently updated the U-Boot on one of our MPC512x-based boards from 2009.11 (+some patches) to a current u-boot build and noticed that the git commit  525856d59910c72687ab6201f39cdf1c04cfc15 apparenty broke the mii commands (see below) on this board. The patch moved PHY initialization from probe into init routine. The mii read commands return zero values regardless of previous FEC usage. Has anyone else come across similar behavior?

Thanks a lot,
Kolja

/* with git commit  525856d59910c72687ab6201f39cdf1c04cfc15 */
EM10A=> mii i
PHY 0x00: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x01: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x02: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x03: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
/* snip */

/* without git commit  525856d59910c72687ab6201f39cdf1c04cfc15 */
EM10A=> mii i
PHY 0x00: OUI = 0x0885, Model = 0x11, Rev = 0x03, 100baseT, FDX
PHY 0x01: OUI = 0x0885, Model = 0x11, Rev = 0x03, 100baseT, FDX

=== modified file 'drivers/net/mpc512x_fec.c'
--- drivers/net/mpc512x_fec.c	2010-05-03 21:52:48 +0000
+++ drivers/net/mpc512x_fec.c	2010-05-03 21:52:48 +0000
@@ -160,7 +160,7 @@
 }
 
 /********************************************************************/
-static void mpc512x_fec_set_hwaddr (mpc512x_fec_priv *fec, char *mac)
+static void mpc512x_fec_set_hwaddr (mpc512x_fec_priv *fec, unsigned char *mac)
 {
 	u8 currByte;			/* byte for which to compute the CRC */
 	int byte;			/* loop - counter */
@@ -226,6 +226,12 @@
 	printf ("mpc512x_fec_init... Begin\n");
 #endif
 
+	mpc512x_fec_set_hwaddr (fec, dev->enetaddr);
+	out_be32(&fec->eth->gaddr1, 0x00000000);
+	out_be32(&fec->eth->gaddr2, 0x00000000);
+
+	mpc512x_fec_init_phy (dev, bis);
+
 	/* Set interrupt mask register */
 	out_be32(&fec->eth->imask, 0x00000000);
 
@@ -611,8 +617,6 @@
 	volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
 	mpc512x_fec_priv *fec;
 	struct eth_device *dev;
-	int i;
-	char *tmp, *end, env_enetaddr[6];
 	void * bd;
 
 	fec = (mpc512x_fec_priv *) malloc (sizeof(*fec));
@@ -663,25 +667,6 @@
 	 */
 	out_be32(&fec->eth->ievent, 0xffffffff);
 
-	/*
-	 * Try to set the mac address now. The fec mac address is
-	 * a garbage after reset. When not using fec for booting
-	 * the Linux fec driver will try to work with this garbage.
-	 */
-	tmp = getenv ("ethaddr");
-	if (tmp) {
-		for (i=0; i<6; i++) {
-			env_enetaddr[i] = tmp ? simple_strtoul (tmp, &end, 16) : 0;
-			if (tmp)
-				tmp = (*end) ? end+1 : end;
-		}
-		mpc512x_fec_set_hwaddr (fec, env_enetaddr);
-		out_be32(&fec->eth->gaddr1, 0x00000000);
-		out_be32(&fec->eth->gaddr2, 0x00000000);
-	}
-
-	mpc512x_fec_init_phy (dev, bis);
-
 	return 1;
 }

Kolja Schneider, Software Design
MEN Mikro Elektronik GmbH
Neuwieder Stra?e 5-7
90411 N?rnberg, Germany
Phone +49-911-99 33 5-251
Fax +49-911-99 33 5-910
Kolja.Schneider at men.de
www.men.de



MEN Mikro Elektronik GmbH - Manfred Schmitz (CTO), Udo Fuchs (CFO) - Handelsregister/Trade Register AG N?rnberg HRB 5540
Please consider the environment before printing this e-mail

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

end of thread, other threads:[~2011-09-27 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-09  9:51 [U-Boot] MPC512x FEC/MII Schneider, Kolja
2011-09-12 21:01 ` Bernhard Kaindl
2011-09-27 14:27   ` Detlev Zundel
2011-09-27 14:57     ` Schneider, Kolja
2011-09-27 15:21       ` Detlev Zundel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox