[U-Boot] [PATCH] net, fec: fix "Warning: eth device name has a space!" for FEC devices

since commit 1384f3bb8a4f9066805b70c1418eda78ecb73fdd ethernet names with spaces drop a
Warning: eth device name has a space!
message. This patch fix it for "FEC ETHERNET" devices found on mpc512x, mpc5xxx, mpc8xx and mpc8220 boards.
Tested on the kup4k board.
Signed-off-by: Heiko Schocher hs@denx.de
--- arch/powerpc/cpu/mpc8220/fec.c | 2 +- arch/powerpc/cpu/mpc8xx/fec.c | 4 ++-- board/motionpro/motionpro.c | 4 ++-- board/stx/stxxtc/stxxtc.c | 6 +++--- board/tqc/tqm8xx/tqm8xx.c | 4 ++-- drivers/net/mpc512x_fec.c | 2 +- drivers/net/mpc5xxx_fec.c | 2 +- include/configs/NSCU.h | 1 - include/configs/TK885D.h | 6 +++--- include/configs/idmr.h | 2 +- include/configs/v38b.h | 2 +- 11 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/cpu/mpc8220/fec.c b/arch/powerpc/cpu/mpc8220/fec.c index 5df9735..cf0ce4a 100644 --- a/arch/powerpc/cpu/mpc8220/fec.c +++ b/arch/powerpc/cpu/mpc8220/fec.c @@ -840,7 +840,7 @@ int mpc8220_fec_initialize (bd_t * bis) dev->send = mpc8220_fec_send; dev->recv = mpc8220_fec_recv;
- sprintf (dev->name, "FEC ETHERNET"); + sprintf (dev->name, "FEC_ETHERNET"); eth_register (dev);
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c index 89c1ff9..73f1f98 100644 --- a/arch/powerpc/cpu/mpc8xx/fec.c +++ b/arch/powerpc/cpu/mpc8xx/fec.c @@ -164,9 +164,9 @@ int fec_initialize(bd_t *bis) /* for FEC1 make sure that the name of the interface is the same as the old one for compatibility reasons */ if (i == 0) { - sprintf (dev->name, "FEC ETHERNET"); + sprintf (dev->name, "FEC_ETHERNET"); } else { - sprintf (dev->name, "FEC%d ETHERNET", + sprintf (dev->name, "FEC%d_ETHERNET", ether_fcc_info[i].ether_index + 1); }
diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index b369219..3616791 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -90,8 +90,8 @@ void reset_phy(void) { unsigned short mode_control;
- miiphy_read("FEC ETHERNET", CONFIG_PHY_ADDR, 0x15, &mode_control); - miiphy_write("FEC ETHERNET", CONFIG_PHY_ADDR, 0x15, + miiphy_read("FEC_ETHERNET", CONFIG_PHY_ADDR, 0x15, &mode_control); + miiphy_write("FEC_ETHERNET", CONFIG_PHY_ADDR, 0x15, mode_control & 0xfffe); return; } diff --git a/board/stx/stxxtc/stxxtc.c b/board/stx/stxxtc/stxxtc.c index 717dbe2..d9f7a2d 100644 --- a/board/stx/stxxtc/stxxtc.c +++ b/board/stx/stxxtc/stxxtc.c @@ -481,12 +481,12 @@ void reset_phys(void) mii_init();
for (phyno = 0; phyno < 32; ++phyno) { - miiphy_read("FEC ETHERNET", phyno, PHY_PHYIDR1, &v); + miiphy_read("FECETHERNET", phyno, PHY_PHYIDR1, &v); if (v == 0xFFFF) continue; - miiphy_write("FEC ETHERNET", phyno, PHY_BMCR, PHY_BMCR_POWD); + miiphy_write("FEC_ETHERNET", phyno, PHY_BMCR, PHY_BMCR_POWD); udelay(10000); - miiphy_write("FEC ETHERNET", phyno, PHY_BMCR, PHY_BMCR_RESET | PHY_BMCR_AUTON); + miiphy_write("FEC_ETHERNET", phyno, PHY_BMCR, PHY_BMCR_RESET | PHY_BMCR_AUTON); udelay(10000); } } diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c index 53f79e8..3ca2ee7 100644 --- a/board/tqc/tqm8xx/tqm8xx.c +++ b/board/tqc/tqm8xx/tqm8xx.c @@ -745,13 +745,13 @@ int last_stage_init(void) return 0;
for (i = 0; i < 2; i++) { - ret = miiphy_read("FEC ETHERNET", phy[i], PHY_BMCR, ®); + ret = miiphy_read("FEC_ETHERNET", phy[i], PHY_BMCR, ®); if (ret) { printf("Cannot read BMCR on PHY %d\n", phy[i]); return 0; } /* Auto-negotiation off, hard set full duplex, 100Mbps */ - ret = miiphy_write("FEC ETHERNET", phy[i], + ret = miiphy_write("FEC_ETHERNET", phy[i], PHY_BMCR, (reg | PHY_BMCR_100MB | PHY_BMCR_DPLX) & ~PHY_BMCR_AUTON); if (ret) { diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index c580c82..1f7392e 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -637,7 +637,7 @@ int mpc512x_fec_initialize (bd_t * bis) dev->send = mpc512x_fec_send; dev->recv = mpc512x_fec_recv;
- sprintf (dev->name, "FEC ETHERNET"); + sprintf (dev->name, "FEC_ETHERNET"); eth_register (dev);
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c index 1681e26..94c9277 100644 --- a/drivers/net/mpc5xxx_fec.c +++ b/drivers/net/mpc5xxx_fec.c @@ -913,7 +913,7 @@ int mpc5xxx_fec_initialize(bd_t * bis) dev->send = mpc5xxx_fec_send; dev->recv = mpc5xxx_fec_recv;
- sprintf(dev->name, "FEC ETHERNET"); + sprintf(dev->name, "FEC_ETHERNET"); eth_register(dev);
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) diff --git a/include/configs/NSCU.h b/include/configs/NSCU.h index 5724f45..6a4c47d 100644 --- a/include/configs/NSCU.h +++ b/include/configs/NSCU.h @@ -485,7 +485,6 @@
#undef CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -/* #define CONFIG_ETHPRIME "FEC ETHERNET" */
/* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TK885D.h b/include/configs/TK885D.h index 0df1b6e..f34039c 100644 --- a/include/configs/TK885D.h +++ b/include/configs/TK885D.h @@ -65,8 +65,8 @@ #undef CONFIG_BOOTARGS
#define CONFIG_EXTRA_ENV_SETTINGS \ - "ethprime=FEC ETHERNET\0" \ - "ethact=FEC ETHERNET\0" \ + "ethprime=FEC_ETHERNET\0" \ + "ethact=FEC_ETHERNET\0" \ "netdev=eth0\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=${serverip}:${rootpath}\0" \ @@ -514,7 +514,7 @@ #define CONFIG_MII_INIT 1
#define CONFIG_NET_RETRY_COUNT 3 -#define CONFIG_ETHPRIME "FEC ETHERNET" +#define CONFIG_ETHPRIME "FEC_ETHERNET"
/* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/idmr.h b/include/configs/idmr.h index 61e3bad..d3017e2 100644 --- a/include/configs/idmr.h +++ b/include/configs/idmr.h @@ -74,7 +74,7 @@ "net_nfs=tftp 200000 $(bootfile);run nfsargs addip;bootm\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=$(serverip):$(rootpath)\0" \ - "ethact=FEC ETHERNET\0" \ + "ethact=FEC_ETHERNET\0" \ "update=prot off ff800000 ff81ffff; era ff800000 ff81ffff; " \ "cp.b 200000 ff800000 $(filesize);" \ "prot on ff800000 ff81ffff\0" \ diff --git a/include/configs/v38b.h b/include/configs/v38b.h index d462ed0..4d19d98 100644 --- a/include/configs/v38b.h +++ b/include/configs/v38b.h @@ -154,7 +154,7 @@ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=$(serverip):$(rootpath) wdt=off\0" \ "hostname=v38b\0" \ - "ethact=FEC ETHERNET\0" \ + "ethact=FEC_ETHERNET\0" \ "rootpath=/opt/eldk-3.1.1/ppc_6xx\0" \ "update=prot off ff000000 ff03ffff; era ff000000 ff03ffff; " \ "cp.b 200000 ff000000 $(filesize);" \

Dear Heiko Schocher,
In message 4C4441D1.7080802@denx.de you wrote:
since commit 1384f3bb8a4f9066805b70c1418eda78ecb73fdd ethernet names with spaces drop a
Warning: eth device name has a space!
message. This patch fix it for "FEC ETHERNET" devices found on mpc512x, mpc5xxx, mpc8xx and mpc8220 boards.
Thanks, but ...
arch/powerpc/cpu/mpc8220/fec.c | 2 +- arch/powerpc/cpu/mpc8xx/fec.c | 4 ++-- board/motionpro/motionpro.c | 4 ++-- board/stx/stxxtc/stxxtc.c | 6 +++--- board/tqc/tqm8xx/tqm8xx.c | 4 ++-- drivers/net/mpc512x_fec.c | 2 +- drivers/net/mpc5xxx_fec.c | 2 +- include/configs/NSCU.h | 1 - include/configs/TK885D.h | 6 +++--- include/configs/idmr.h | 2 +- include/configs/v38b.h | 2 +- 11 files changed, 17 insertions(+), 18 deletions(-)
...
I think we should update the occurence of this string in the documentation as well, i. e. also update the README.
While doing this, we should then fix the similar "SCC ETHERNET" as well; potentially affected files:
README arch/powerpc/cpu/mpc8260/ether_scc.c arch/powerpc/cpu/mpc8xx/scc.c board/LEOX/elpt860/README.LEOX board/RPXlite_dw/README doc/README.PlanetCore include/configs/TQM855L.h include/configs/TQM855M.h include/configs/TQM860L.h include/configs/TQM860M.h include/configs/TQM862L.h include/configs/TQM862M.h include/configs/TQM866M.h include/configs/TQM885D.h include/configs/keymile-common.h include/configs/km8xx.h
Add ditto for "FCC* ETHERNET"; potentially affected files:
arch/powerpc/cpu/mpc8260/ether_fcc.c arch/powerpc/cpu/mpc85xx/ether_fcc.c
diff --git a/arch/powerpc/cpu/mpc8220/fec.c b/arch/powerpc/cpu/mpc8220/fec.c index 5df9735..cf0ce4a 100644 --- a/arch/powerpc/cpu/mpc8220/fec.c +++ b/arch/powerpc/cpu/mpc8220/fec.c @@ -840,7 +840,7 @@ int mpc8220_fec_initialize (bd_t * bis) dev->send = mpc8220_fec_send; dev->recv = mpc8220_fec_recv;
- sprintf (dev->name, "FEC ETHERNET");
- sprintf (dev->name, "FEC_ETHERNET"); eth_register (dev);
I always wondered why we need such a long (and slow to type) name. I suggest we use this opportunity and change the name into a plain and simple "FEC" resp. "SCC" and "FCC" ?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
I always wondered why we need such a long (and slow to type) name. I suggest we use this opportunity and change the name into a plain and simple "FEC" resp. "SCC" and "FCC" ?
Then probably unify the rule even for other architectures. We have a "FEC_MXC", too, for Freescale's i.MX processors. We can use "FEC_PPC", "SCC_PPC" if we want to add the architecture name (I do not think is useful), or better set the name to "FEC" for fec_mxc.c, too.
Best regards, Stefano Babic

Hi Stefano,
On 7/19/2010 12:11 PM, Stefano Babic wrote:
Wolfgang Denk wrote:
I always wondered why we need such a long (and slow to type) name. I suggest we use this opportunity and change the name into a plain and simple "FEC" resp. "SCC" and "FCC" ?
Then probably unify the rule even for other architectures. We have a "FEC_MXC", too, for Freescale's i.MX processors. We can use "FEC_PPC", "SCC_PPC" if we want to add the architecture name (I do not think is useful), or better set the name to "FEC" for fec_mxc.c, too.
Best regards, Stefano Babic
Unless you have a chip with both MXC and PPC FECs, which I doubt, I don't think the extra namespace buys anything. Saving a few keystrokes, on the other hand (no pun intended) is a good thing.
regards, Ben

Dear Stefano Babic,
In message 4C44A356.7090001@denx.de you wrote:
I always wondered why we need such a long (and slow to type) name. I suggest we use this opportunity and change the name into a plain and simple "FEC" resp. "SCC" and "FCC" ?
Then probably unify the rule even for other architectures. We have a
Agreed.
"FEC_MXC", too, for Freescale's i.MX processors. We can use "FEC_PPC", "SCC_PPC" if we want to add the architecture name (I do not think is useful), or better set the name to "FEC" for fec_mxc.c, too.
Sounds good to me. Would you like to submit a patch? :-)
Best regards,
Wolfgang Denk

On Monday, July 19, 2010 14:52:35 Wolfgang Denk wrote:
I always wondered why we need such a long (and slow to type) name. I suggest we use this opportunity and change the name into a plain and simple "FEC" resp. "SCC" and "FCC" ?
+1 -mike
participants (5)
-
Ben Warren
-
Heiko Schocher
-
Mike Frysinger
-
Stefano Babic
-
Wolfgang Denk