Ethernet doesn't work in linux for PPC440GP?
Hi,
First please forgive me for the cross-list post. I do believe this topic is related to both lists.
I'm playing with UBoot and Linux 2.6.10 on IBM PPC440GP evaluation board (Ebony) and have some issue with ethernet. With Rom Monitor linux 2.6.10 was running successfully using default configuration for Ebony. Here the scree dump for ethernet dection.
emac: IBM EMAC Ethernet driver, version 2.0 Maintained by Benjamin Herrenschmidt <[email protected]>
zmii0: input 0 in RMII mode
eth0: IBM emac, MAC 00:04:ac:e3:1b:bb
eth0: Found Generic MII PHY (0x08)
zmii0: input 1 in RMII mode
eth1: IBM emac, MAC 00:04:ac:e3:1b:bc
eth1: Found Generic MII PHY (0x09)
However with Uboot, the emac driver cannot read MAC addresses from VPD correctly. The original 2.6.10 code didn't recognize uboot's bd_info. After some hack eth0 gets its MAC address from uboot's bd_info and seems initialized correctly. But somehow booting an NFS root fs failed. So I suspect it's due to the ethernet driver. BTW, the same image is used in the two
emac: IBM EMAC Ethernet driver, version 2.0 Maintained by Benjamin Herrenschmidt <[email protected]>
zmii0: input 0 in SMII mode
eth0: IBM emac, MAC 00:04:ac:e3:1b:bb
eth0: Found Generic MII PHY (0x08)
zmii0: input 1 in RMII mode
eth1: IBM emac, MAC FF:FF:FF:FF:FF:FF
eth1: Found Generic MII PHY (0x09)
I know there was discussion about what a linux ethernet driver should expect from boot loader. In fact the driver shouldn't expect anything from a boot loader. Wolfgang has the same opinion in his DULG. What I don't know is if this EMAC driver expects something configured by boot loader? It seems to me that Rom Monitor did configure something for ethernet that the EMAC driver expected.
Anyone has the similar problem before?
Thanks,
-Shawn.
Quoted 6 lines · Shawn Jin
zmii0: input 0 in SMII mode
eth0: IBM emac, MAC 00:04:ac:e3:1b:bb
eth0: Found Generic MII PHY (0x08)
zmii0: input 1 in RMII mode
eth1: IBM emac, MAC FF:FF:FF:FF:FF:FF
eth1: Found Generic MII PHY (0x09)
I already told you that this is wrong, why are you asking again? Please, if you asking questions, spend some time reading answers given to you, before asking again.
ZMII bridge cannot have inputs in different modes (SMII and RMII).
Ebony uses RMII, so SMII is obviously wrong. Most probably your firmware doesn't set correct mode and autodetection in the EMAC driver fails.
--
Eugene.
Quoted 10 lines
Quoted 6 lines
zmii0: input 0 in SMII mode
eth0: IBM emac, MAC 00:04:ac:e3:1b:bb
eth0: Found Generic MII PHY (0x08)
zmii0: input 1 in RMII mode
eth1: IBM emac, MAC FF:FF:FF:FF:FF:FF
eth1: Found Generic MII PHY (0x09)I already told you that this is wrong, why are you asking again? Please, if you asking questions, spend some time reading answers given to you, before asking again.
Well, don't be mad at me first. The question may bring out another round of arguments whether it's a bug related to uboot or linux EMAC driver. Wolfgang makes it very clear that this is a bug in linux ethernet driver. And I agree with him. This argument happened before and I just forgot what specific ethernet driver was in the argument.
Quoted 3 lines
Ebony uses RMII, so SMII is obviously wrong. Most probably your firmware doesn't set correct mode and autodetection in the EMAC driver fails.
So the EMAC driver does expect a boot loader (the firmware you mentioned here) to set something for it. Then I think I need to fix it in this driver instead of in uboot.
-Shawn.
Quoted 11 lines · Shawn Jin
Quoted 10 lines
Quoted 6 lines
zmii0: input 0 in SMII mode
eth0: IBM emac, MAC 00:04:ac:e3:1b:bb
eth0: Found Generic MII PHY (0x08)
zmii0: input 1 in RMII mode
eth1: IBM emac, MAC FF:FF:FF:FF:FF:FF
eth1: Found Generic MII PHY (0x09)I already told you that this is wrong, why are you asking again? Please, if you asking questions, spend some time reading answers given to you, before asking again.
Quoted 5 lines
Well, don't be mad at me first. The question may bring out another round of arguments whether it's a bug related to uboot or linux EMAC driver. Wolfgang makes it very clear that this is a bug in linux ethernet driver. And I agree with him. This argument happened before and I just forgot what specific ethernet driver was in the argument.
This is really irrelevant.
Quoted 8 lines
Quoted 4 lines
Ebony uses RMII, so SMII is obviously wrong. Most probably your firmware doesn't set correct mode and autodetection in the EMAC driver fails.
So the EMAC driver does expect a boot loader (the firmware you mentioned here) to set something for it. Then I think I need to fix it in this driver instead of in uboot.
Current EMAC driver uses autodetection logic if PHY mode wasn't specified by the board support code. It works for Ebony + OpenBIOS. You can try the following patch (untested) to set PHY mode explicitly:
===== arch/ppc/platforms/4xx/ebony.c 1.10 vs edited =====
arch/ppc/platforms/4xx/ebony.c +9 -0
@@ -52,6 +52,13 @@#include <syslib/gen550.h> +/* +* This is a horrible kludge, we eventually need to abstract this +* generic PHY stuff, so the standard phy mode defines can be +* easily used from arch code. +*/ +#include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h" +static struct ibm44x_clocks clocks__initdata ;/*
@@ -267,9 +274,11 @@ def =ocp_get_one_device (OCP_VENDOR_IBM ,OCP_FUNC_EMAC ,0 ); emacdata = def->additions;memcpy (emacdata->mac_addr,EBONY_NA0_ADDR (vpd_base),6 ); + emacdata->phy_mode =PHY_MODE_RMII ; def =ocp_get_one_device (OCP_VENDOR_IBM ,OCP_FUNC_EMAC ,1 ); emacdata = def->additions;memcpy (emacdata->mac_addr,EBONY_NA1_ADDR (vpd_base),6 ); + emacdata->phy_mode =PHY_MODE_RMII ;iounmap (vpd_base);/*
--
Eugene
Quoted 2 lines · Shawn Jin
However with Uboot, the emac driver cannot read MAC addresses from VPD correctly. The original 2.6.10 code didn't recognize uboot's
bd_info.
You are welcome to submit patch with U-Boot support for Ebony. Currently only OpenBIOS is supported.
Look at the way it was done for Ocotea, 2.6 now supports both U-Boot and PIBS.
--
Eugene
Quoted 5 lines
You are welcome to submit patch with U-Boot support for Ebony. Currently only OpenBIOS is supported.
Look at the way it was done for Ocotea, 2.6 now supports both U-Boot and PIBS.
I've done this and will submit it to the list soon.
Regards,
-Shawn.