Răsfoiți Sursa

powerpc, 8xx: move FEC Ethernet driver in drivers/net

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Christophe Leroy 7 ani în urmă
părinte
comite
fad51ac3af

+ 0 - 15
README

@@ -4079,21 +4079,6 @@ Low Level (hardware related) configuration options:
 		Only for 83xx systems. If specified, then DDR should
 		Only for 83xx systems. If specified, then DDR should
 		be configured using CS0 and CS1 instead of CS2 and CS3.
 		be configured using CS0 and CS1 instead of CS2 and CS3.
 
 
-- CONFIG_ETHER_ON_FEC[12]
-		Define to enable FEC[12] on a 8xx series processor.
-
-- CONFIG_FEC[12]_PHY
-		Define to the hardcoded PHY address which corresponds
-		to the given FEC; i. e.
-			#define CONFIG_FEC1_PHY 4
-		means that the PHY with address 4 is connected to FEC1
-
-		When set to -1, means to probe for first available.
-
-- CONFIG_FEC[12]_PHY_NORXERR
-		The PHY does not have a RXERR line (RMII only).
-		(so program the FEC to ignore it).
-
 - CONFIG_RMII
 - CONFIG_RMII
 		Enable RMII mode for all FECs.
 		Enable RMII mode for all FECs.
 		Note that this is a global option, we can't
 		Note that this is a global option, we can't

+ 0 - 1
arch/powerpc/cpu/mpc8xx/Makefile

@@ -9,7 +9,6 @@ extra-y += start.o
 extra-y += traps.o
 extra-y += traps.o
 obj-y	+= cpu.o
 obj-y	+= cpu.o
 obj-y	+= cpu_init.o
 obj-y	+= cpu_init.o
-obj-y	+= fec.o
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
 obj-$(CONFIG_CMD_IMMAP) += immap.o
 obj-$(CONFIG_CMD_IMMAP) += immap.o
 obj-y	+= interrupts.o
 obj-y	+= interrupts.o

+ 1 - 1
arch/powerpc/cpu/mpc8xx/cpu.c

@@ -327,7 +327,7 @@ void reset_8xx_watchdog(immap_t __iomem *immr)
  */
  */
 int cpu_eth_init(bd_t *bis)
 int cpu_eth_init(bd_t *bis)
 {
 {
-#if defined(FEC_ENET)
+#if defined(CONFIG_MPC8XX_FEC)
 	fec_initialize(bis);
 	fec_initialize(bis);
 #endif
 #endif
 	return 0;
 	return 0;

+ 58 - 0
drivers/net/Kconfig

@@ -246,4 +246,62 @@ config RENESAS_RAVB
 	  This driver implements support for the Ethernet AVB block in
 	  This driver implements support for the Ethernet AVB block in
 	  Renesas M3 and H3 SoCs.
 	  Renesas M3 and H3 SoCs.
 
 
+config MPC8XX_FEC
+	bool "Fast Ethernet Controller on MPC8XX"
+	depends on 8xx
+	select MII
+	help
+	  This driver implements support for the Fast Ethernet Controller
+	  on MPC8XX
+
+config ETHER_ON_FEC1
+	bool "FEC1"
+	depends on MPC8XX_FEC
+	default y
+
+config FEC1_PHY
+	int "FEC1 PHY"
+	depends on ETHER_ON_FEC1
+	default -1
+	help
+	  Define to the hardcoded PHY address which corresponds
+	  to the given FEC; i. e.
+		#define CONFIG_FEC1_PHY 4
+	  means that the PHY with address 4 is connected to FEC1
+
+	  When set to -1, means to probe for first available.
+
+config PHY_NORXERR
+	bool "PHY_NORXERR"
+	depends on ETHER_ON_FEC1
+	default n
+	help
+	  The PHY does not have a RXERR line (RMII only).
+	  (so program the FEC to ignore it).
+
+config ETHER_ON_FEC2
+	bool "FEC2"
+	depends on MPC8XX_FEC && MPC885
+	default y
+
+config FEC2_PHY
+	int "FEC2 PHY"
+	depends on ETHER_ON_FEC2
+	default -1
+	help
+	  Define to the hardcoded PHY address which corresponds
+	  to the given FEC; i. e.
+		#define CONFIG_FEC1_PHY 4
+	  means that the PHY with address 4 is connected to FEC1
+
+	  When set to -1, means to probe for first available.
+
+config FEC2_PHY_NORXERR
+	bool "PHY_NORXERR"
+	depends on ETHER_ON_FEC2
+	default n
+	help
+	  The PHY does not have a RXERR line (RMII only).
+	  (so program the FEC to ignore it).
+
 endif # NETDEVICES
 endif # NETDEVICES

+ 1 - 0
drivers/net/Makefile

@@ -38,6 +38,7 @@ obj-$(CONFIG_LAN91C96) += lan91c96.o
 obj-$(CONFIG_LPC32XX_ETH) += lpc32xx_eth.o
 obj-$(CONFIG_LPC32XX_ETH) += lpc32xx_eth.o
 obj-$(CONFIG_MACB) += macb.o
 obj-$(CONFIG_MACB) += macb.o
 obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
 obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
+obj-$(CONFIG_MPC8XX_FEC) += mpc8xx_fec.o
 obj-$(CONFIG_MVGBE) += mvgbe.o
 obj-$(CONFIG_MVGBE) += mvgbe.o
 obj-$(CONFIG_MVNETA) += mvneta.o
 obj-$(CONFIG_MVNETA) += mvneta.o
 obj-$(CONFIG_MVPP2) += mvpp2.o
 obj-$(CONFIG_MVPP2) += mvpp2.o

+ 0 - 18
arch/powerpc/cpu/mpc8xx/fec.c → drivers/net/mpc8xx_fec.c

@@ -16,14 +16,6 @@
 
 
 DECLARE_GLOBAL_DATA_PTR;
 DECLARE_GLOBAL_DATA_PTR;
 
 
-#if defined(CONFIG_CMD_NET) && \
-	(defined(FEC_ENET) || defined(CONFIG_ETHER_ON_FEC1) || defined(CONFIG_ETHER_ON_FEC2))
-
-/* compatibility test, if only FEC_ENET defined assume ETHER on FEC1 */
-#if defined(FEC_ENET) && !defined(CONFIG_ETHER_ON_FEC1) && !defined(CONFIG_ETHER_ON_FEC2)
-#define CONFIG_ETHER_ON_FEC1 1
-#endif
-
 /* define WANT_MII when MII support is required */
 /* define WANT_MII when MII support is required */
 #if defined(CONFIG_SYS_DISCOVER_PHY) || defined(CONFIG_FEC1_PHY) || defined(CONFIG_FEC2_PHY)
 #if defined(CONFIG_SYS_DISCOVER_PHY) || defined(CONFIG_FEC1_PHY) || defined(CONFIG_FEC2_PHY)
 #define WANT_MII
 #define WANT_MII
@@ -65,11 +57,7 @@ static struct ether_fcc_info_s
 	{
 	{
 		0,
 		0,
 		offsetof(immap_t, im_cpm.cp_fec1),
 		offsetof(immap_t, im_cpm.cp_fec1),
-#if defined(CONFIG_FEC1_PHY)
 		CONFIG_FEC1_PHY,
 		CONFIG_FEC1_PHY,
-#else
-		-1,	/* discover */
-#endif
 		-1,
 		-1,
 		0,
 		0,
 
 
@@ -79,11 +67,7 @@ static struct ether_fcc_info_s
 	{
 	{
 		1,
 		1,
 		offsetof(immap_t, im_cpm.cp_fec2),
 		offsetof(immap_t, im_cpm.cp_fec2),
-#if defined(CONFIG_FEC2_PHY)
 		CONFIG_FEC2_PHY,
 		CONFIG_FEC2_PHY,
-#else
-		-1,
-#endif
 		-1,
 		-1,
 		0,
 		0,
 	},
 	},
@@ -846,5 +830,3 @@ int fec8xx_miiphy_write(struct mii_dev *bus, int addr, int devad, int reg,
 	return 0;
 	return 0;
 }
 }
 #endif
 #endif
-
-#endif

+ 0 - 4
scripts/config_whitelist.txt

@@ -704,8 +704,6 @@ CONFIG_ETHER_ON_FCC
 CONFIG_ETHER_ON_FCC1
 CONFIG_ETHER_ON_FCC1
 CONFIG_ETHER_ON_FCC2
 CONFIG_ETHER_ON_FCC2
 CONFIG_ETHER_ON_FCC3
 CONFIG_ETHER_ON_FCC3
-CONFIG_ETHER_ON_FEC1
-CONFIG_ETHER_ON_FEC2
 CONFIG_ETHPRIME
 CONFIG_ETHPRIME
 CONFIG_ETH_BUFSIZE
 CONFIG_ETH_BUFSIZE
 CONFIG_ETH_RXSIZE
 CONFIG_ETH_RXSIZE
@@ -761,8 +759,6 @@ CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
 CONFIG_FEATURE_SH_EXTRA_QUIET
 CONFIG_FEATURE_SH_EXTRA_QUIET
 CONFIG_FEATURE_SH_FANCY_PROMPT
 CONFIG_FEATURE_SH_FANCY_PROMPT
 CONFIG_FEATURE_SH_STANDALONE_SHELL
 CONFIG_FEATURE_SH_STANDALONE_SHELL
-CONFIG_FEC1_PHY
-CONFIG_FEC2_PHY
 CONFIG_FEC_ENET_DEV
 CONFIG_FEC_ENET_DEV
 CONFIG_FEC_FIXED_SPEED
 CONFIG_FEC_FIXED_SPEED
 CONFIG_FEC_MXC_25M_REF_CLK
 CONFIG_FEC_MXC_25M_REF_CLK