Domen's MPC5200 FEC cleanup patch.

15 messages, 4 authors, 2007-09-17 · open the first message on its own page

Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-15 03:39:00

This patch doesn't seem to working quite right on my hardware (Phytec
pcm030). At boot I get a long pause.

I have a long pause when Ethernet is initializing

[    0.798529] NET: Registered protocol family 1
[    0.802988] NET: Registered protocol family 17
[    1.313708] net eth0: attached phy 0 to driver Generic PHY
[    2.320013] Sending DHCP requests ...... timed out!
[   81.968863] IP-Config: Retrying forever (NFS root)...
[   82.477527] net eth0: attached phy 0 to driver Generic PHY
[   83.487809] Sending DHCP requests .<6>PHY: f0003000:00 - Link is Up
- 100/Full
[   86.323795] ., OK
[   88.579802] IP-Config: Got DHCP answer from 192.168.1.200, my
address is 192.168.1.5
[   88.587923] IP-Config: Complete:

Reverting back to
0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch the
pause goes away.

[    0.793916] TCP cubic registered
[    0.797309] NET: Registered protocol family 1
[    0.801808] NET: Registered protocol family 17
[    1.309611] eth0: config: auto-negotiation on, 100HDX, 10HDX.
[    2.316014] Sending DHCP requests .., OK
[    7.124005] IP-Config: Got DHCP answer from 192.168.1.200, my
address is 192.168.1.5
[    7.132121] IP-Config: Complete:
[    7.135212]       device=eth0, addr=192.168.1.5,
mask=255.255.255.0, gw=192.168.1.200,
[    7.143192]      host=MPC, domain=home, nis-domain=(none),
[    7.148778]      bootserver=192.168.1.200, rootserver=192.168.1.4, rootpath=

Something not quite right with interrupts maybe? I'm trying to debug it.

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-15 04:28:12

On 9/14/07, Jon Smirl [off-list ref] wrote:
This patch doesn't seem to working quite right on my hardware (Phytec
pcm030). At boot I get a long pause.
It also doesn't compile if  CONFIG_FEC_MPC52xx_MDIO is undefined.

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Domen Puncer <hidden>
Date: 2007-09-15 12:23:22

On 15/09/07 00:28 -0400, Jon Smirl wrote:
On 9/14/07, Jon Smirl [off-list ref] wrote:
quoted
This patch doesn't seem to working quite right on my hardware (Phytec
pcm030). At boot I get a long pause.
It also doesn't compile if  CONFIG_FEC_MPC52xx_MDIO is undefined.
Right, darn.
Try this one: http://coderock.org/tmp/fec-v3rc1/

Does it work without phy-handle in device tree, but
with this part being unconditional (fec.c):
 709 //        if (priv->has_phy)
 710                 rcntrl |= FEC_RCNTRL_MII_MODE;

This effectively disables phy part of the driver,
but still allows hardware to use PHY/MII.

I am puzzled by the symptoms you see.


	Domen
-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-15 15:55:47

On 9/15/07, Domen Puncer [off-list ref] wrote:
On 15/09/07 00:28 -0400, Jon Smirl wrote:
quoted
On 9/14/07, Jon Smirl [off-list ref] wrote:
quoted
This patch doesn't seem to working quite right on my hardware (Phytec
pcm030). At boot I get a long pause.
It also doesn't compile if  CONFIG_FEC_MPC52xx_MDIO is undefined.
Right, darn.
Try this one: http://coderock.org/tmp/fec-v3rc1/
    0.776407] 0x00f40000-0x00f80000 : "oftree"
[    0.782101] 0x00f80000-0x01000000 : "space"
[    0.788100] TCP cubic registered
[    0.791427] NET: Registered protocol family 1
[    0.795904] NET: Registered protocol family 17
[    1.305579] f0003000:00 not found
[    1.308985] net eth0: phy_connect failed
[    1.312961] net eth0: fec_init_phy failed
[    1.317188] IP-Config: Failed to open eth0
[    1.321362] IP-Config: No network devices available.
[    1.326973] Looking up port of RPC 100003/3 on 192.168.1.4


Does it work without phy-handle in device tree, but
with this part being unconditional (fec.c):
 709 //        if (priv->has_phy)
 710                 rcntrl |= FEC_RCNTRL_MII_MODE;

This effectively disables phy part of the driver,
but still allows hardware to use PHY/MII.
Makes no difference
I am puzzled by the symptoms you see.


        Domen
quoted
--
Jon Smirl
jonsmirl@gmail.com

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-16 17:00:21

On 9/15/07, Jon Smirl [off-list ref] wrote:
On 9/15/07, Domen Puncer [off-list ref] wrote:
quoted
On 15/09/07 00:28 -0400, Jon Smirl wrote:
quoted
On 9/14/07, Jon Smirl [off-list ref] wrote:
quoted
This patch doesn't seem to working quite right on my hardware (Phytec
pcm030). At boot I get a long pause.
It also doesn't compile if  CONFIG_FEC_MPC52xx_MDIO is undefined.
Right, darn.
Try this one: http://coderock.org/tmp/fec-v3rc1/
    0.776407] 0x00f40000-0x00f80000 : "oftree"
[    0.782101] 0x00f80000-0x01000000 : "space"
[    0.788100] TCP cubic registered
[    0.791427] NET: Registered protocol family 1
[    0.795904] NET: Registered protocol family 17
[    1.305579] f0003000:00 not found
[    1.308985] net eth0: phy_connect failed
[    1.312961] net eth0: fec_init_phy failed
[    1.317188] IP-Config: Failed to open eth0
[    1.321362] IP-Config: No network devices available.
[    1.326973] Looking up port of RPC 100003/3 on 192.168.1.4
This fixes the problem....
diff --git a/drivers/net/fec_mpc52xx/fec.c b/drivers/net/fec_mpc52xx/fec.c
index 922e9a8..c4442e0 100644
--- a/drivers/net/fec_mpc52xx/fec.c
+++ b/drivers/net/fec_mpc52xx/fec.c
@@ -1087,11 +1087,13 @@ static struct of_platform_driver mpc52xx_fec_driver = {
 /* ======================================================================== */
 /* Module                                                                   */
 /* ======================================================================== */
+extern int fec_mdio_init(void);
+void fec_mdio_exit(void);

 static int __init
 mpc52xx_fec_init(void)
 {
-#ifdef FEC_MPC52xx_MDIO
+#ifdef CONFIG_FEC_MPC52xx_MDIO
        int ret;
        ret = fec_mdio_init();
        if (ret) {
@@ -1106,7 +1108,7 @@ static void __exit
 mpc52xx_fec_exit(void)
 {
        of_unregister_platform_driver(&mpc52xx_fec_driver);
-#ifdef FEC_MPC52xx_MDIO
+#ifdef CONFIG_FEC_MPC52xx_MDIO
        fec_mdio_exit();
 #endif
 }

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-16 17:05:33

[    1.309662] net eth0: attached phy 0 to driver Generic PHY
[    2.316013] Sending DHCP requests .<6>PHY: f0003000:00 - Link is Up
- 100/Full
[    4.392000] ., OK
[    7.100005] IP-Config: Got DHCP answer from 192.168.1.200, my
address is 192.168.1.5
[    7.108154] IP-Config: Complete:
[    7.111247]       device=eth0, addr=192.168.1.5,
mask=255.255.255.0, gw=192.168.1.200,
[    7.119249]      host=MPC, domain=home, nis-domain=(none),
[    7.124811]      bootserver=192.168.1.200, rootserver=192.168.1.4, rootpath=

DHCP wants to print "Sending DHCP requests .., OK"
But the interrupt from the link coming up printed "<6>PHY: f0003000:00
- Link is Up - 100/Full"
The <6> is visible since it wasn't on the beginning of a line.

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-16 18:00:49

Another problem...

Ifconfig eth0 down

hangs the system.
I'll try debugging it.

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-16 18:25:10

On 9/16/07, Jon Smirl [off-list ref] wrote:
Another problem...

Ifconfig eth0 down

hangs the system.
I'll try debugging it.
The hang is something to do with lockd in NFS, it doesn't appear to
have anything to do with fec. I think I need to build more of NFS into
my kernel.

My DNS servers are not getting set up, but that's probably an issue
with the distro I'm using.

I did some big copy commands and fec seems to working ok.

Next I'll look at how the pcm030 supplies an Ethernet address. It has
an EEPROM on the board that holds it. Is this something that can be
read from of?
--
Jon Smirl
jonsmirl@gmail.com

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Robert Schwebel <hidden>
Date: 2007-09-16 18:34:58

On Sun, Sep 16, 2007 at 02:25:09PM -0400, Jon Smirl wrote:
Next I'll look at how the pcm030 supplies an Ethernet address. It has
an EEPROM on the board that holds it. Is this something that can be
read from of?
If you use our u-boot port, the mac addresses are being written by
u-boot and should already be present when linux comes in.

Robert
-- 
Pengutronix - Linux Solutions for Science and Industry
Entwicklungszentrum Nord     http://www.pengutronix.de

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-16 18:38:56

On 9/16/07, Robert Schwebel [off-list ref] wrote:
On Sun, Sep 16, 2007 at 02:25:09PM -0400, Jon Smirl wrote:
quoted
Next I'll look at how the pcm030 supplies an Ethernet address. It has
an EEPROM on the board that holds it. Is this something that can be
read from of?
If you use our u-boot port, the mac addresses are being written by
u-boot and should already be present when linux comes in.
Your right, it is already there.

Any idea why my DNS servers are getting set up from DHCP?
Robert
--
Pengutronix - Linux Solutions for Science and Industry
Entwicklungszentrum Nord     http://www.pengutronix.de

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Robert Schwebel <hidden>
Date: 2007-09-16 18:50:52

On Sun, Sep 16, 2007 at 02:38:55PM -0400, Jon Smirl wrote:
Any idea why my DNS servers are getting set up from DHCP?
Well, check your DHCP server config :-)

Robert
-- 
Pengutronix - Linux Solutions for Science and Industry
Entwicklungszentrum Nord     http://www.pengutronix.de

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-16 18:54:44

On 9/16/07, Robert Schwebel [off-list ref] wrote:
On Sun, Sep 16, 2007 at 02:38:55PM -0400, Jon Smirl wrote:
quoted
Any idea why my DNS servers are getting set up from DHCP?
Well, check your DHCP server config :-)
My x86/arm boxes are getting it ok from same server.
Robert
--
Pengutronix - Linux Solutions for Science and Industry
Entwicklungszentrum Nord     http://www.pengutronix.de

-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jon Smirl <hidden>
Date: 2007-09-16 19:05:54

This adjustment to the error counting is in the Efika patches and not
in yours, should it be in yours too?
--- a/drivers/net/fec_mpc52xx/fec.c 2007-05-30 16:04:50.000000000 +0200
+++ b/drivers/net/fec_mpc52xx/fec.c 2007-05-30 16:09:02.000000000 +0200
@@ -411,7 +411,9 @@

 	stats->rx_bytes = in_be32(&fec->rmon_r_octets);
 	stats->rx_packets = in_be32(&fec->rmon_r_packets);
-	stats->rx_errors = stats->rx_packets - in_be32(&fec->ieee_r_frame_ok);
+	stats->rx_errors = stats->rx_packets - (
+			in_be32(&fec->ieee_r_frame_ok) +
+			in_be32(&fec->rmon_r_mc_pkt));
 	stats->tx_bytes = in_be32(&fec->rmon_t_octets);
 	stats->tx_packets = in_be32(&fec->rmon_t_packets);
 	stats->tx_errors = stats->tx_packets - (
-- 
Jon Smirl
jonsmirl@gmail.com

Re: Domen's MPC5200 FEC cleanup patch.

From: Jeff Mock <hidden>
Date: 2007-09-16 19:09:58


Jon Smirl wrote:
On 9/16/07, Jon Smirl [off-list ref] wrote:
quoted
Another problem...

Ifconfig eth0 down

hangs the system.
I'll try debugging it.
The hang is something to do with lockd in NFS, it doesn't appear to
have anything to do with fec. I think I need to build more of NFS into
my kernel.
I think the NFS hang has something to do with not having a copy of 
portmap running.  I've had this happen with other embedded systems, and 
can usually work around it by using the "-o nolock" option when doing 
the NFS mount.

jeff

Re: Domen's MPC5200 FEC cleanup patch.

From: Domen Puncer <hidden>
Date: 2007-09-17 05:33:19

On 16/09/07 15:05 -0400, Jon Smirl wrote:
This adjustment to the error counting is in the Efika patches and not
in yours, should it be in yours too?
I know about this patch.

Error counting is reworked in newer anyway (mixing rmon and ieee
counters didn't look very nice to me).


	Domen
quoted hunk
--- a/drivers/net/fec_mpc52xx/fec.c 2007-05-30 16:04:50.000000000 +0200
+++ b/drivers/net/fec_mpc52xx/fec.c 2007-05-30 16:09:02.000000000 +0200
@@ -411,7 +411,9 @@

 	stats->rx_bytes = in_be32(&fec->rmon_r_octets);
 	stats->rx_packets = in_be32(&fec->rmon_r_packets);
-	stats->rx_errors = stats->rx_packets - in_be32(&fec->ieee_r_frame_ok);
+	stats->rx_errors = stats->rx_packets - (
+			in_be32(&fec->ieee_r_frame_ok) +
+			in_be32(&fec->rmon_r_mc_pkt));
 	stats->tx_bytes = in_be32(&fec->rmon_t_octets);
 	stats->tx_packets = in_be32(&fec->rmon_t_packets);
 	stats->tx_errors = stats->tx_packets - (
-- 
Jon Smirl
jonsmirl@gmail.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help