Convert CONFIG_MII_INIT to Kconfig
This converts the following to Kconfig:
CONFIG_MII_INIT
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 564daa7..25c9fde 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1658,6 +1658,10 @@
to management parameters and services.
The interface is referred to as the MII management interface.
+config MII_INIT
+ bool "Call mii_init() in the mii command"
+ depends on CMD_MII && (MPC8XX_FEC || FSLDMAFE || MCFFEC)
+
config CMD_MDIO
bool "mdio"
depends on PHYLIB
diff --git a/configs/M5208EVBE_defconfig b/configs/M5208EVBE_defconfig
index 62b284b..6d533d6 100644
--- a/configs/M5208EVBE_defconfig
+++ b/configs/M5208EVBE_defconfig
@@ -14,6 +14,7 @@
CONFIG_CMD_IMLS=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_ENV_IS_IN_FLASH=y
diff --git a/configs/M5235EVB_Flash32_defconfig b/configs/M5235EVB_Flash32_defconfig
index a3762bb..7552741 100644
--- a/configs/M5235EVB_Flash32_defconfig
+++ b/configs/M5235EVB_Flash32_defconfig
@@ -20,6 +20,7 @@
CONFIG_CMD_DHCP=y
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_ENV_IS_IN_FLASH=y
diff --git a/configs/M5235EVB_defconfig b/configs/M5235EVB_defconfig
index d4f32e4..1bdb63a 100644
--- a/configs/M5235EVB_defconfig
+++ b/configs/M5235EVB_defconfig
@@ -20,6 +20,7 @@
CONFIG_CMD_DHCP=y
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_ENV_IS_IN_FLASH=y
diff --git a/configs/M5272C3_defconfig b/configs/M5272C3_defconfig
index c30b949..f0a6aac 100644
--- a/configs/M5272C3_defconfig
+++ b/configs/M5272C3_defconfig
@@ -17,6 +17,7 @@
# CONFIG_CMD_SETEXPR is not set
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_ENV_ADDR=0xFFE04000
diff --git a/configs/M5275EVB_defconfig b/configs/M5275EVB_defconfig
index 53ff8ee..809bda0 100644
--- a/configs/M5275EVB_defconfig
+++ b/configs/M5275EVB_defconfig
@@ -21,6 +21,7 @@
CONFIG_CMD_DHCP=y
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_ENV_ADDR=0xFFE04000
diff --git a/configs/M5282EVB_defconfig b/configs/M5282EVB_defconfig
index 84363fb..69db87c 100644
--- a/configs/M5282EVB_defconfig
+++ b/configs/M5282EVB_defconfig
@@ -17,6 +17,7 @@
# CONFIG_CMD_SETEXPR is not set
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_ENV_ADDR=0xFFE04000
diff --git a/configs/M53017EVB_defconfig b/configs/M53017EVB_defconfig
index b434787..8283b52 100644
--- a/configs/M53017EVB_defconfig
+++ b/configs/M53017EVB_defconfig
@@ -16,6 +16,7 @@
CONFIG_CMD_IMLS=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_DATE=y
diff --git a/configs/M5329AFEE_defconfig b/configs/M5329AFEE_defconfig
index b8900f2..1092a1d 100644
--- a/configs/M5329AFEE_defconfig
+++ b/configs/M5329AFEE_defconfig
@@ -17,6 +17,7 @@
CONFIG_CMD_NAND=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_DATE=y
diff --git a/configs/M5329BFEE_defconfig b/configs/M5329BFEE_defconfig
index 47e6cb0..66347d5 100644
--- a/configs/M5329BFEE_defconfig
+++ b/configs/M5329BFEE_defconfig
@@ -17,6 +17,7 @@
CONFIG_CMD_NAND=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_DATE=y
diff --git a/configs/M5373EVB_defconfig b/configs/M5373EVB_defconfig
index c59ba94..38d2002 100644
--- a/configs/M5373EVB_defconfig
+++ b/configs/M5373EVB_defconfig
@@ -17,6 +17,7 @@
CONFIG_CMD_NAND=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_DATE=y
diff --git a/configs/MCR3000_defconfig b/configs/MCR3000_defconfig
index 04fe756..f174865 100644
--- a/configs/MCR3000_defconfig
+++ b/configs/MCR3000_defconfig
@@ -42,6 +42,7 @@
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
# CONFIG_CMD_SLEEP is not set
CONFIG_OF_CONTROL=y
diff --git a/configs/eb_cpu5282_defconfig b/configs/eb_cpu5282_defconfig
index a1aee40..ae1329c 100644
--- a/configs/eb_cpu5282_defconfig
+++ b/configs/eb_cpu5282_defconfig
@@ -23,6 +23,7 @@
CONFIG_CMD_DHCP=y
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_DATE=y
CONFIG_ENV_ADDR=0xFF040000
CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y
diff --git a/configs/eb_cpu5282_internal_defconfig b/configs/eb_cpu5282_internal_defconfig
index 4adc056..02a9bb4 100644
--- a/configs/eb_cpu5282_internal_defconfig
+++ b/configs/eb_cpu5282_internal_defconfig
@@ -22,6 +22,7 @@
CONFIG_CMD_DHCP=y
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
+CONFIG_MII_INIT=y
CONFIG_CMD_DATE=y
CONFIG_ENV_ADDR=0xFF040000
CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y
diff --git a/drivers/net/mcfmii.c b/drivers/net/mcfmii.c
index ca06b35..e2c8f41 100644
--- a/drivers/net/mcfmii.c
+++ b/drivers/net/mcfmii.c
@@ -200,9 +200,7 @@
}
#endif /* CONFIG_SYS_DISCOVER_PHY */
-void mii_init(void) __attribute__((weak,alias("__mii_init")));
-
-void __mii_init(void)
+__weak void mii_init(void)
{
#ifdef CONFIG_DM_ETH
struct udevice *dev;
diff --git a/include/configs/M5208EVBE.h b/include/configs/M5208EVBE.h
index e30f1eb..e73c656 100644
--- a/include/configs/M5208EVBE.h
+++ b/include/configs/M5208EVBE.h
@@ -18,7 +18,6 @@
#define CONFIG_WATCHDOG_TIMEOUT 5000
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
# ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h
index bc0e00c..bbe12d1 100644
--- a/include/configs/M5235EVB.h
+++ b/include/configs/M5235EVB.h
@@ -23,7 +23,6 @@
#define CONFIG_WATCHDOG_TIMEOUT 5000 /* timeout in milliseconds, max timeout is 6.71sec */
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
# ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/M5272C3.h b/include/configs/M5272C3.h
index dec1e41..c4ee8c9 100644
--- a/include/configs/M5272C3.h
+++ b/include/configs/M5272C3.h
@@ -33,7 +33,6 @@
env/embedded.o(.text);
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
# ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h
index dab512c..5db85ad 100644
--- a/include/configs/M5275EVB.h
+++ b/include/configs/M5275EVB.h
@@ -36,7 +36,6 @@
/* Available command configuration */
#ifdef CONFIG_MCFFEC
-#define CONFIG_MII_INIT 1
#define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
#ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/M5282EVB.h b/include/configs/M5282EVB.h
index 974cfc3..cc64893 100644
--- a/include/configs/M5282EVB.h
+++ b/include/configs/M5282EVB.h
@@ -31,7 +31,6 @@
env/embedded.o(.text*);
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
# ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/M53017EVB.h b/include/configs/M53017EVB.h
index 80ca016..431fa74 100644
--- a/include/configs/M53017EVB.h
+++ b/include/configs/M53017EVB.h
@@ -25,7 +25,6 @@
#define CONFIG_SYS_UNIFY_CACHE
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
# define CONFIG_SYS_TX_ETH_BUFFER 8
# define CONFIG_SYS_FEC_BUF_USE_SRAM
diff --git a/include/configs/M5329EVB.h b/include/configs/M5329EVB.h
index e4b887f..d155f2c 100644
--- a/include/configs/M5329EVB.h
+++ b/include/configs/M5329EVB.h
@@ -25,7 +25,6 @@
#define CONFIG_SYS_UNIFY_CACHE
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
# ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h
index 9ad09e8..b0b0e2e 100644
--- a/include/configs/M5373EVB.h
+++ b/include/configs/M5373EVB.h
@@ -27,7 +27,6 @@
#define CONFIG_SYS_UNIFY_CACHE
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
# ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index 4a26ae8..e26b70a 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -88,7 +88,6 @@
/* Ethernet configuration part */
#define CONFIG_SYS_DISCOVER_PHY 1
-#define CONFIG_MII_INIT 1
/* NAND configuration part */
#define CONFIG_SYS_MAX_NAND_DEVICE 1
diff --git a/include/configs/cobra5272.h b/include/configs/cobra5272.h
index 607e76c..577936b 100644
--- a/include/configs/cobra5272.h
+++ b/include/configs/cobra5272.h
@@ -89,7 +89,6 @@
env/embedded.o(.text);
#ifdef CONFIG_MCFFEC
-# define CONFIG_MII_INIT 1
# define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
# ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/include/configs/eb_cpu5282.h b/include/configs/eb_cpu5282.h
index 99d8e9e..4d88657 100644
--- a/include/configs/eb_cpu5282.h
+++ b/include/configs/eb_cpu5282.h
@@ -52,7 +52,6 @@
*----------------------------------------------------------------------*/
#ifdef CONFIG_MCFFEC
-#define CONFIG_MII_INIT 1
#define CONFIG_SYS_DISCOVER_PHY
#define CONFIG_OVERWRITE_ETHADDR_ONCE
#endif
diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h
index 9bfb8ca..781dba5 100644
--- a/include/configs/stmark2.h
+++ b/include/configs/stmark2.h
@@ -132,7 +132,6 @@
CONFIG_SYS_INIT_RAM_SIZE - 12)
#ifdef CONFIG_MCFFEC
-#define CONFIG_MII_INIT 1
#define CONFIG_SYS_DISCOVER_PHY
/* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
#ifndef CONFIG_SYS_DISCOVER_PHY
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 8cbab7e..bb8d310 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -499,7 +499,6 @@
CONFIG_MEM_REMAP
CONFIG_MFG_ENV_SETTINGS
CONFIG_MII_DEFAULT_TSEC
-CONFIG_MII_INIT
CONFIG_MISC_COMMON
CONFIG_MIU_2BIT_21_7_INTERLEAVED
CONFIG_MIU_2BIT_INTERLEAVED