[U-Boot] [PATCH] net: removed board-specific CONFIGs from MPC5xxx FEC driver

Ben Warren biggerbadderben at gmail.com
Fri Feb 6 08:58:25 CET 2009


Added new CONFIG options for the three type of MAC-PHY interconnect and
applied them all relevant board config files

Signed-off-by: Ben Warren <biggerbadderben at gmail.com>
---

Note: compile tested only, since I don't have any 5xxx hardware

 drivers/net/mpc5xxx_fec.c   |   28 +++-------------------------
 include/configs/BC3450.h    |    5 +++--
 include/configs/IceCube.h   |    8 +++-----
 include/configs/PM520.h     |    5 +++--
 include/configs/TB5200.h    |    5 +++--
 include/configs/TOP5200.h   |    2 +-
 include/configs/TQM5200.h   |    5 +++--
 include/configs/Total5200.h |    1 +
 include/configs/canmb.h     |    1 +
 include/configs/cm5200.h    |    1 +
 include/configs/cpci5200.h  |    1 +
 include/configs/hmi1001.h   |    1 +
 include/configs/inka4x0.h   |    5 +++--
 include/configs/jupiter.h   |    5 +++--
 include/configs/mcc200.h    |    7 ++++---
 include/configs/mecp5200.h  |    5 +++--
 include/configs/motionpro.h |    1 +
 include/configs/mucmc52.h   |    1 +
 include/configs/munices.h   |    1 +
 include/configs/o2dnt.h     |    5 +++--
 include/configs/pf5200.h    |    5 +++--
 include/configs/uc101.h     |    1 +
 include/configs/v38b.h      |    1 +
 23 files changed, 48 insertions(+), 52 deletions(-)

diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
index f8618b1..2bf901e 100644
--- a/drivers/net/mpc5xxx_fec.c
+++ b/drivers/net/mpc5xxx_fec.c
@@ -19,9 +19,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 /* #define DEBUG	0x28 */
 
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
-	defined(CONFIG_MPC5xxx_FEC)
-
 #if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII))
 #error "CONFIG_MII has to be defined!"
 #endif
@@ -891,28 +888,11 @@ int mpc5xxx_fec_initialize(bd_t * bis)
 	fec->eth = (ethernet_regs *)MPC5XXX_FEC;
 	fec->tbdBase = (FEC_TBD *)FEC_BD_BASE;
 	fec->rbdBase = (FEC_RBD *)(FEC_BD_BASE + FEC_TBD_NUM * sizeof(FEC_TBD));
-#if defined(CONFIG_CANMB)		|| \
-	defined(CONFIG_CM5200)		|| \
-	defined(CONFIG_HMI1001)		|| \
-	defined(CONFIG_ICECUBE)		|| \
-	defined(CONFIG_INKA4X0)		|| \
-	defined(CONFIG_JUPITER)		|| \
-	defined(CONFIG_MCC200)		|| \
-	defined(CONFIG_MOTIONPRO)	|| \
-	defined(CONFIG_MUCMC52)		|| \
-	defined(CONFIG_O2DNT)		|| \
-	defined(CONFIG_PM520)		|| \
-	defined(CONFIG_TOP5200)		|| \
-	defined(CONFIG_TQM5200)		|| \
-	defined(CONFIG_UC101)		|| \
-	defined(CONFIG_V38B)		|| \
-	defined(CONFIG_MUNICES)
-# ifndef CONFIG_FEC_10MBIT
+#if defined(CONFIG_MPC5xxx_FEC_MII100)
 	fec->xcv_type = MII100;
-# else
+#elif defined(CONFIG_MPC5xxx_FEC_MII10)
 	fec->xcv_type = MII10;
-# endif
-#elif defined(CONFIG_TOTAL5200)
+#elif defined(CONFIG_MPC5xxx_FEC_SEVENWIRE)
 	fec->xcv_type = SEVENWIRE;
 #else
 #error fec->xcv_type not initialized.
@@ -1064,5 +1044,3 @@ static uint32 local_crc32(char *string, unsigned int crc_value, int len)
 	 /**/ return crc;
 }
 #endif	/* DEBUG */
-
-#endif /* CONFIG_MPC5xxx_FEC */
diff --git a/include/configs/BC3450.h b/include/configs/BC3450.h
index 28be8dd..bced118 100644
--- a/include/configs/BC3450.h
+++ b/include/configs/BC3450.h
@@ -396,10 +396,11 @@
 /*
  * Ethernet configuration
  *
- * Define CONFIG_FEC10MBIT to force FEC at 10MBIT
+ * Define CONFIG_MPC5xxx_MII10 to force FEC at 10MBIT
  */
 #define CONFIG_MPC5xxx_FEC	1
-#undef CONFIG_FEC_10MBIT
+#define CONFIG_MPC5xxx_FEC_MII100
+#undef CONFIG_MPC5xxx_MII10
 #define CONFIG_PHY_ADDR		0x00
 
 /*
diff --git a/include/configs/IceCube.h b/include/configs/IceCube.h
index f8c94ec..5ef0b77 100644
--- a/include/configs/IceCube.h
+++ b/include/configs/IceCube.h
@@ -293,14 +293,12 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
-#if defined(CONFIG_LITE5200B)
-#define CONFIG_FEC_MII100	1
-#endif
 
 /*
  * GPIO configuration
diff --git a/include/configs/PM520.h b/include/configs/PM520.h
index e250e03..ff73ef9 100644
--- a/include/configs/PM520.h
+++ b/include/configs/PM520.h
@@ -279,10 +279,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 
 /*
diff --git a/include/configs/TB5200.h b/include/configs/TB5200.h
index 6010246..b42d3d9 100644
--- a/include/configs/TB5200.h
+++ b/include/configs/TB5200.h
@@ -344,10 +344,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 
 /*
diff --git a/include/configs/TOP5200.h b/include/configs/TOP5200.h
index 046948e..50197f4 100644
--- a/include/configs/TOP5200.h
+++ b/include/configs/TOP5200.h
@@ -312,7 +312,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
-#define CONFIG_FEC_10MBIT	1		/* Workaround for FEC 100Mbit problem */
+#define CONFIG_MPC5xxx_FEC_MII10	/* Workaround for FEC 100Mbit problem */
 #define	CONFIG_PHY_ADDR		0x1f
 #define	CONFIG_PHY_TYPE		0x79c874
 /*
diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h
index db7f51d..6850eba 100644
--- a/include/configs/TQM5200.h
+++ b/include/configs/TQM5200.h
@@ -507,10 +507,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 
 /*
diff --git a/include/configs/Total5200.h b/include/configs/Total5200.h
index 75d1985..9a75848 100644
--- a/include/configs/Total5200.h
+++ b/include/configs/Total5200.h
@@ -268,6 +268,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_SEVENWIRE
 /* dummy, 7-wire FEC does not have phy address */
 #define CONFIG_PHY_ADDR		0x00
 
diff --git a/include/configs/canmb.h b/include/configs/canmb.h
index ff7b6e5..1f275e5 100644
--- a/include/configs/canmb.h
+++ b/include/configs/canmb.h
@@ -173,6 +173,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define	CONFIG_PHY_ADDR		0x0
 /*
  * GPIO configuration:
diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h
index 620ffea..ddcc6aa 100644
--- a/include/configs/cm5200.h
+++ b/include/configs/cm5200.h
@@ -65,6 +65,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define CONFIG_PHY_ADDR		0x00
 #define CONFIG_ENV_OVERWRITE	1	/* allow overwriting of ethaddr */
 /* use misc_init_r() to read ethaddr from I2C EEPROM (see CONFIG_SYS_I2C_EEPROM) */
diff --git a/include/configs/cpci5200.h b/include/configs/cpci5200.h
index b9dabac..e5f357d 100644
--- a/include/configs/cpci5200.h
+++ b/include/configs/cpci5200.h
@@ -259,6 +259,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100	
 /*
  * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
  */
diff --git a/include/configs/hmi1001.h b/include/configs/hmi1001.h
index 16b06cd..a81527e 100644
--- a/include/configs/hmi1001.h
+++ b/include/configs/hmi1001.h
@@ -215,6 +215,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define CONFIG_PHY_ADDR		0x00
 #define CONFIG_MII		1		/* MII PHY management		*/
 
diff --git a/include/configs/inka4x0.h b/include/configs/inka4x0.h
index 405234c..e42fa6d 100644
--- a/include/configs/inka4x0.h
+++ b/include/configs/inka4x0.h
@@ -221,10 +221,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 #define CONFIG_MII
 
diff --git a/include/configs/jupiter.h b/include/configs/jupiter.h
index 2ebe370..9c45acf 100644
--- a/include/configs/jupiter.h
+++ b/include/configs/jupiter.h
@@ -239,10 +239,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 
 /*
diff --git a/include/configs/mcc200.h b/include/configs/mcc200.h
index e64cc37..e5812ee 100644
--- a/include/configs/mcc200.h
+++ b/include/configs/mcc200.h
@@ -271,11 +271,12 @@
 /*
  * Ethernet configuration
  */
-/*#define CONFIG_MPC5xxx_FEC	1*/
+/* #define CONFIG_MPC5xxx_FEC	1 */
+/* #define CONFIG_MPC5xxx_FEC_MII100 */
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		1
 
 /*
diff --git a/include/configs/mecp5200.h b/include/configs/mecp5200.h
index 7ef5bdf..4a93b58 100644
--- a/include/configs/mecp5200.h
+++ b/include/configs/mecp5200.h
@@ -243,10 +243,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 #define CONFIG_UDP_CHECKSUM     1
 
diff --git a/include/configs/motionpro.h b/include/configs/motionpro.h
index b3f16d5..e6e3729 100644
--- a/include/configs/motionpro.h
+++ b/include/configs/motionpro.h
@@ -82,6 +82,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define CONFIG_PHY_ADDR		0x2
 #define CONFIG_PHY_TYPE		0x79c874
 #define CONFIG_RESET_PHY_R	1
diff --git a/include/configs/mucmc52.h b/include/configs/mucmc52.h
index 2f48a0f..ae60cd2 100644
--- a/include/configs/mucmc52.h
+++ b/include/configs/mucmc52.h
@@ -225,6 +225,7 @@
  * Ethernet configuration
  */
 #define	CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define	CONFIG_PHY_ADDR		0x00
 #define	CONFIG_MII		1		/* MII PHY management		*/
 
diff --git a/include/configs/munices.h b/include/configs/munices.h
index 7682faa..fa5230f 100644
--- a/include/configs/munices.h
+++ b/include/configs/munices.h
@@ -166,6 +166,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define CONFIG_PHY_ADDR		0x01
 #define CONFIG_MII		1
 
diff --git a/include/configs/o2dnt.h b/include/configs/o2dnt.h
index bfae7b4..18e7cc2 100644
--- a/include/configs/o2dnt.h
+++ b/include/configs/o2dnt.h
@@ -233,10 +233,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 
 /*
diff --git a/include/configs/pf5200.h b/include/configs/pf5200.h
index b2e2a1c..8ca55d7 100644
--- a/include/configs/pf5200.h
+++ b/include/configs/pf5200.h
@@ -245,10 +245,11 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 /*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
+ * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
  */
-/* #define CONFIG_FEC_10MBIT 1 */
+/* #define CONFIG_MPC5xxx_FEC_MII10 */
 #define CONFIG_PHY_ADDR		0x00
 #define CONFIG_UDP_CHECKSUM	1
 
diff --git a/include/configs/uc101.h b/include/configs/uc101.h
index 553eb25..87cb4e5 100644
--- a/include/configs/uc101.h
+++ b/include/configs/uc101.h
@@ -233,6 +233,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define CONFIG_PHY_ADDR		0x00
 #define CONFIG_MII		1
 
diff --git a/include/configs/v38b.h b/include/configs/v38b.h
index 0156ce1..fc7128e 100644
--- a/include/configs/v38b.h
+++ b/include/configs/v38b.h
@@ -247,6 +247,7 @@
  * Ethernet configuration
  */
 #define CONFIG_MPC5xxx_FEC	1
+#define CONFIG_MPC5xxx_FEC_MII100
 #define CONFIG_PHY_ADDR		0x00
 #define CONFIG_MII		1
 
-- 
1.5.6.3



More information about the U-Boot mailing list