Skip to contentSkip to conversation

net, fec: fix "Warning: eth device name has a space!" for FEC devices

PATCH Superseded Heiko Schocher 5 participants 6 messages Jul 19, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 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(-)
arch/powerpc/cpu/mpc8220/fec.c +1 -1
index 5df9735..cf0ce4a 100644
@@ -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)
arch/powerpc/cpu/mpc8xx/fec.c +2 -2
index 89c1ff9..73f1f98 100644
@@ -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);
 		}
 
board/motionpro/motionpro.c +2 -2
index b369219..3616791 100644
@@ -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;
 }
board/stx/stxxtc/stxxtc.c +3 -3
index 717dbe2..d9f7a2d 100644
@@ -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);
 	}
 }
board/tqc/tqm8xx/tqm8xx.c +2 -2
index 53f79e8..3ca2ee7 100644
@@ -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, &reg);
+		ret = miiphy_read("FEC_ETHERNET", phy[i], PHY_BMCR, &reg);
 		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) {
drivers/net/mpc512x_fec.c +1 -1
index c580c82..1f7392e 100644
@@ -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)
drivers/net/mpc5xxx_fec.c +1 -1
index 1681e26..94c9277 100644
@@ -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)
include/configs/NSCU.h +0 -1
index 5724f45..6a4c47d 100644
@@ -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
include/configs/TK885D.h +3 -3
index 0df1b6e..f34039c 100644
@@ -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
include/configs/idmr.h +1 -1
index 61e3bad..d3017e2 100644
@@ -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"				\
include/configs/v38b.h +1 -1
index d462ed0..4d19d98 100644
@@ -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);"			\
Signature · 5 lines
1.6.2.5

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#1 lore raw

PATCH 1/1 net, fec: fix "Warning: eth device name has a space!" for FEC devices

Dear Heiko Schocher,

Quoted 7 lines · In message <[email protected]> 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 ...

Quoted 4 lines
 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 +++---
Quoted 8 lines
 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

arch/powerpc/cpu/mpc8220/fec.c int mpc8220_fec_initialize (bd_t * bis) · line 845

Quoted 12 lines
arch/powerpc/cpu/mpc8220/fec.c +1 -1
index 5df9735..cf0ce4a 100644
@@ -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

Signature · 5 lines
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
The nice thing about  standards  is that there are  so many to choose
from.                                           - Andrew S. Tanenbaum
#2 lore raw

PATCH 1/1 net, fec: fix "Warning: eth device name has a space!" for FEC devices

Quoted 3 lines · Wolfgang Denk

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

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#3 lore raw

PATCH 1/1 net, fec: fix "Warning: eth device name has a space!" for FEC devices

Hi Stefano,

Quoted 5 lines · Stefano Babic
Quoted 3 lines · Wolfgang Denk

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" ?

Quoted 8 lines

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

#4 lore raw

PATCH 1/1 net, fec: fix "Warning: eth device name has a space!" for FEC devices

In reply to Stefano Babic

Dear Stefano Babic,

Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 4 lines

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.

Quoted 3 lines

"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

Signature · 5 lines
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
Let's say the docs present a simplified view of reality...    :-)
                      - Larry Wall in  <[email protected]>
#5 lore raw

PATCH 1/1 net, fec: fix "Warning: eth device name has a space!" for FEC devices

In reply to Wolfgang Denk
Quoted 3 lines · 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100719/ac2b1d3a/attachment.pgp