[U-Boot] [PATCH 03/10] net: fec: Use PHY_INTERFACE_MODE_ for xcv_type

Jagan Teki jagan at amarulasolutions.com
Mon Jul 30 12:45:02 UTC 2018


Use existing PHY_INTERFACE_MODE_ for xcv_type, this eventually
- remove CONFIG_FEC_XCV_TYPE in DM_ETH boards since the phy interface
  is grabbing from DT phy-mode.
- prefix PHY_INTERFACE_MODE_ for CONFIG_FEC_XCV_TYPE in non DM_ETH boards
- added MII100, SEVENWIRE PHY mode

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 drivers/net/fec_mxc.c                | 18 +++++++++---------
 drivers/net/fec_mxc.h                | 15 +--------------
 include/configs/advantech_dms-ba16.h |  2 +-
 include/configs/apalis_imx6.h        |  2 +-
 include/configs/aristainetos.h       |  2 +-
 include/configs/aristainetos2.h      |  2 +-
 include/configs/aristainetos2b.h     |  2 +-
 include/configs/cgtqmx6eval.h        |  2 +-
 include/configs/cl-som-imx7.h        |  2 +-
 include/configs/cm_fx6.h             |  2 +-
 include/configs/colibri_imx6.h       |  2 +-
 include/configs/colibri_imx7.h       |  2 +-
 include/configs/colibri_vf.h         |  2 +-
 include/configs/dh_imx6.h            |  2 +-
 include/configs/display5.h           |  2 +-
 include/configs/embestmx6boards.h    |  2 +-
 include/configs/ge_bx50v3.h          |  2 +-
 include/configs/gw_ventana.h         |  2 +-
 include/configs/imx6-engicam.h       |  2 --
 include/configs/imx6_logic.h         |  1 -
 include/configs/kp_imx6q_tpc.h       |  2 +-
 include/configs/liteboard.h          |  2 +-
 include/configs/mccmon6.h            |  2 +-
 include/configs/mx6cuboxi.h          |  2 +-
 include/configs/mx6qarm2.h           |  2 +-
 include/configs/mx6sabre_common.h    |  2 +-
 include/configs/mx6slevk.h           |  2 +-
 include/configs/mx6sxsabreauto.h     |  2 +-
 include/configs/mx6sxsabresd.h       |  2 +-
 include/configs/mx6ul_14x14_evk.h    |  4 ++--
 include/configs/mx7dsabresd.h        |  2 +-
 include/configs/mxs.h                |  2 +-
 include/configs/nitrogen6x.h         |  2 +-
 include/configs/novena.h             |  2 +-
 include/configs/opos6uldev.h         |  2 +-
 include/configs/ot1200.h             |  2 +-
 include/configs/pcm052.h             |  2 +-
 include/configs/pcm058.h             |  2 +-
 include/configs/pfla02.h             |  2 +-
 include/configs/pico-imx6ul.h        |  2 +-
 include/configs/pico-imx7d.h         |  2 +-
 include/configs/platinum_picon.h     |  2 +-
 include/configs/platinum_titanium.h  |  2 +-
 include/configs/secomx6quq7.h        |  2 +-
 include/configs/sksimx6.h            |  2 +-
 include/configs/tbs2910.h            |  2 +-
 include/configs/titanium.h           |  2 +-
 include/configs/tqma6_mba6.h         |  2 +-
 include/configs/tqma6_wru4.h         |  2 +-
 include/configs/udoo.h               |  2 +-
 include/configs/udoo_neo.h           |  2 +-
 include/configs/vf610twr.h           |  2 +-
 include/configs/vining_2000.h        |  2 +-
 include/configs/wandboard.h          |  2 +-
 include/configs/xpress.h             |  2 +-
 include/configs/zc5202.h             |  2 +-
 include/configs/zc5601.h             |  2 +-
 include/phy.h                        |  4 ++++
 58 files changed, 68 insertions(+), 80 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 694a0b2f7e..fc42978a20 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -15,6 +15,7 @@
 #include <miiphy.h>
 #include <net.h>
 #include <netdev.h>
+#include <phy.h>
 #include "fec_mxc.h"
 
 #include <asm/io.h>
@@ -46,7 +47,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #endif
 
 #ifndef CONFIG_FEC_XCV_TYPE
-#define CONFIG_FEC_XCV_TYPE MII100
+#define CONFIG_FEC_XCV_TYPE	PHY_INTERFACE_MODE_MII100
 #endif
 
 /*
@@ -397,11 +398,11 @@ static void fec_reg_setup(struct fec_priv *fec)
 
 	/* Start with frame length = 1518, common for all modes. */
 	rcntrl = PKTSIZE << FEC_RCNTRL_MAX_FL_SHIFT;
-	if (fec->xcv_type != SEVENWIRE)		/* xMII modes */
+	if (fec->xcv_type != PHY_INTERFACE_MODE_SEVENWIRE)		/* xMII modes */
 		rcntrl |= FEC_RCNTRL_FCE | FEC_RCNTRL_MII_MODE;
-	if (fec->xcv_type == RGMII)
+	if (fec->xcv_type == PHY_INTERFACE_MODE_RGMII)
 		rcntrl |= FEC_RCNTRL_RGMII;
-	else if (fec->xcv_type == RMII)
+	else if (fec->xcv_type == PHY_INTERFACE_MODE_RMII)
 		rcntrl |= FEC_RCNTRL_RMII;
 
 	writel(rcntrl, &fec->eth->r_cntrl);
@@ -552,7 +553,7 @@ static int fec_init(struct eth_device *dev, bd_t *bd)
 
 	fec_reg_setup(fec);
 
-	if (fec->xcv_type != SEVENWIRE)
+	if (fec->xcv_type != PHY_INTERFACE_MODE_SEVENWIRE)
 		fec_mii_setspeed(fec->bus->priv);
 
 	/* Set Opcode/Pause Duration Register */
@@ -583,7 +584,7 @@ static int fec_init(struct eth_device *dev, bd_t *bd)
 	writel((uint32_t)addr, &fec->eth->erdsr);
 
 #ifndef CONFIG_PHYLIB
-	if (fec->xcv_type != SEVENWIRE)
+	if (fec->xcv_type != PHY_INTERFACE_MODE_SEVENWIRE)
 		miiphy_restart_aneg(dev);
 #endif
 	fec_open(dev);
@@ -1233,7 +1234,7 @@ static int fec_phy_init(struct fec_priv *priv, struct udevice *dev)
 	mask = 1 << CONFIG_FEC_MXC_PHYADDR;
 #endif
 
-	phydev = phy_find_by_mask(priv->bus, mask, priv->interface);
+	phydev = phy_find_by_mask(priv->bus, mask, priv->xcv_type);
 	if (!phydev)
 		return -ENODEV;
 
@@ -1283,8 +1284,7 @@ static int fecmxc_probe(struct udevice *dev)
 	}
 
 	priv->bus = bus;
-	priv->xcv_type = CONFIG_FEC_XCV_TYPE;
-	priv->interface = pdata->phy_interface;
+	priv->xcv_type = pdata->phy_interface;
 	ret = fec_phy_init(priv, dev);
 	if (ret)
 		goto err_phy;
diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h
index 3b935afe2c..058341ca4a 100644
--- a/drivers/net/fec_mxc.h
+++ b/drivers/net/fec_mxc.h
@@ -223,19 +223,10 @@ struct fec_bd {
 	uint32_t data_pointer;		/* payload's buffer address */
 };
 
-/* Supported phy types on this platform */
-enum xceiver_type {
-	SEVENWIRE,	/* 7-wire       */
-	MII10,		/* MII 10Mbps   */
-	MII100,		/* MII 100Mbps  */
-	RMII,		/* RMII */
-	RGMII,		/* RGMII */
-};
-
 /* @brief i.MX27-FEC private structure */
 struct fec_priv {
 	struct ethernet_regs *eth;	/* pointer to register'S base */
-	enum xceiver_type xcv_type;	/* transceiver type */
+	phy_interface_t xcv_type;	/* transceiver type */
 	struct fec_bd *rbd_base;	/* RBD ring */
 	int rbd_index;			/* next receive BD to read */
 	struct fec_bd *tbd_base;	/* TBD ring */
@@ -250,10 +241,6 @@ struct fec_priv {
 	int phy_id;
 	int (*mii_postcall)(int);
 #endif
-
-#ifdef CONFIG_DM_ETH
-	u32 interface;
-#endif
 };
 
 void imx_get_mac_from_fuse(int dev_id, unsigned char *mac);
diff --git a/include/configs/advantech_dms-ba16.h b/include/configs/advantech_dms-ba16.h
index 2a7c3921bb..ab0b3b90d9 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -56,7 +56,7 @@
 
 /* Networking Configs */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME		"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		4
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 1a2e95f32d..bb15b23afe 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -69,7 +69,7 @@
 
 /* Network */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		6
 #define CONFIG_IP_DEFRAG
diff --git a/include/configs/aristainetos.h b/include/configs/aristainetos.h
index c53ba89838..1266c8d7e5 100644
--- a/include/configs/aristainetos.h
+++ b/include/configs/aristainetos.h
@@ -19,7 +19,7 @@
 #define CONFIG_MXC_UART_BASE	UART5_BASE
 #define CONSOLE_DEV	"ttymxc4"
 
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 
 #define CONFIG_SF_DEFAULT_BUS		3
 #define CONFIG_SF_DEFAULT_CS		0
diff --git a/include/configs/aristainetos2.h b/include/configs/aristainetos2.h
index 67b2e5879c..138e13521d 100644
--- a/include/configs/aristainetos2.h
+++ b/include/configs/aristainetos2.h
@@ -18,7 +18,7 @@
 #define CONFIG_MXC_UART_BASE	UART2_BASE
 #define CONSOLE_DEV	"ttymxc1"
 
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 
 #define CONFIG_SF_DEFAULT_BUS		3
 #define CONFIG_SF_DEFAULT_CS		1
diff --git a/include/configs/aristainetos2b.h b/include/configs/aristainetos2b.h
index 91069a2c98..903e63e2e1 100644
--- a/include/configs/aristainetos2b.h
+++ b/include/configs/aristainetos2b.h
@@ -18,7 +18,7 @@
 #define CONFIG_MXC_UART_BASE	UART2_BASE
 #define CONSOLE_DEV	"ttymxc1"
 
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 
 #define CONFIG_SF_DEFAULT_BUS		0
 #define CONFIG_SF_DEFAULT_CS		0
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index 553a470306..d3e08e16ec 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -83,7 +83,7 @@
 
 /* Ethernet */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		6
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/cl-som-imx7.h b/include/configs/cl-som-imx7.h
index a9fbcfe6ab..ed84124dc3 100644
--- a/include/configs/cl-som-imx7.h
+++ b/include/configs/cl-som-imx7.h
@@ -24,7 +24,7 @@
 #define CONFIG_CSF_SIZE			0x4000
 
 /* Network */
-#define CONFIG_FEC_XCV_TYPE             RGMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME                 "FEC"
 #define CONFIG_FEC_MXC_PHYADDR          0
 
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 574242ad0f..89bd25e4f0 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -178,7 +178,7 @@
 
 /* Ethernet */
 #define CONFIG_FEC_MXC_PHYADDR		0
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_PHY_ATHEROS
 #define CONFIG_ETHPRIME			"FEC0"
diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
index efd7423afd..5ad0c07694 100644
--- a/include/configs/colibri_imx6.h
+++ b/include/configs/colibri_imx6.h
@@ -57,7 +57,7 @@
 
 /* Network */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		1
 #define CONFIG_IP_DEFRAG
diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index f34d33fcf6..c35ea3598e 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -20,7 +20,7 @@
 #define CONFIG_SYS_MALLOC_LEN		(32 * SZ_1M)
 
 /* Network */
-#define CONFIG_FEC_XCV_TYPE             RMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME                 "FEC"
 #define CONFIG_FEC_MXC_PHYADDR          0
 
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 41060e601a..49ea4f27d4 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -50,7 +50,7 @@
 #define CONFIG_SYS_FSL_ESDHC_NUM	1
 
 #define IMX_FEC_BASE			ENET1_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_FEC_MXC_PHYADDR          0
 
 #define CONFIG_IPADDR		192.168.10.2
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index 8dec6c4908..d532e09494 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -43,7 +43,7 @@
 
 /* FEC ethernet */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		0
 #define CONFIG_ARP_TIMEOUT		200UL
diff --git a/include/configs/display5.h b/include/configs/display5.h
index 453d0dc806..c08a18039e 100644
--- a/include/configs/display5.h
+++ b/include/configs/display5.h
@@ -83,7 +83,7 @@
 /* Ethernet */
 #ifdef CONFIG_FEC_MXC
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		0
 #endif
diff --git a/include/configs/embestmx6boards.h b/include/configs/embestmx6boards.h
index b295c07922..43ed5b862a 100644
--- a/include/configs/embestmx6boards.h
+++ b/include/configs/embestmx6boards.h
@@ -42,7 +42,7 @@
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		4
 
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index 01352adac9..4dfa3575a5 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -65,7 +65,7 @@
 /* Networking Configs */
 #ifdef CONFIG_NET
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME		"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		4
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index f90d66f118..6df5d154f4 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -124,7 +124,7 @@
 
 /* Ethernet support */
 #define IMX_FEC_BASE             ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE      RGMII
+#define CONFIG_FEC_XCV_TYPE      PHY_INTERFACE_MODE_RGMII
 #define CONFIG_FEC_MXC_PHYADDR   0
 #define CONFIG_ARP_TIMEOUT       200UL
 
diff --git a/include/configs/imx6-engicam.h b/include/configs/imx6-engicam.h
index 796e12b4c7..85f2991ab0 100644
--- a/include/configs/imx6-engicam.h
+++ b/include/configs/imx6-engicam.h
@@ -161,10 +161,8 @@
 #ifdef CONFIG_FEC_MXC
 # ifdef CONFIG_TARGET_MX6Q_ICORE_RQS
 #  define CONFIG_FEC_MXC_PHYADDR	3
-#  define CONFIG_FEC_XCV_TYPE		RGMII
 # else
 #  define CONFIG_FEC_MXC_PHYADDR	0
-#  define CONFIG_FEC_XCV_TYPE		RMII
 # endif
 #endif
 
diff --git a/include/configs/imx6_logic.h b/include/configs/imx6_logic.h
index f9b4117852..e22d76c4ef 100644
--- a/include/configs/imx6_logic.h
+++ b/include/configs/imx6_logic.h
@@ -22,7 +22,6 @@
 #define CONFIG_MMCROOT         "/dev/mmcblk1p2" /* Dev kit SD card */
 
 /* Ethernet Configs */
-#define CONFIG_FEC_XCV_TYPE            RMII
 #define CONFIG_ETHPRIME                "FEC"
 #define CONFIG_FEC_MXC_PHYADDR         0
 
diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
index 57242017a6..915ae8b7ce 100644
--- a/include/configs/kp_imx6q_tpc.h
+++ b/include/configs/kp_imx6q_tpc.h
@@ -26,7 +26,7 @@
 
 /* FEC ethernet */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		0
 #define CONFIG_ARP_TIMEOUT		200UL
diff --git a/include/configs/liteboard.h b/include/configs/liteboard.h
index 42dbee1973..f136496e27 100644
--- a/include/configs/liteboard.h
+++ b/include/configs/liteboard.h
@@ -144,7 +144,7 @@
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR		0x0
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME			"FEC"
 
 #define CONFIG_PHY_SMSC
diff --git a/include/configs/mccmon6.h b/include/configs/mccmon6.h
index aa5adb9076..ab787b2f15 100644
--- a/include/configs/mccmon6.h
+++ b/include/configs/mccmon6.h
@@ -87,7 +87,7 @@
 
 /* Ethernet Configuration */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		1
 
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
index b232700ff2..7de4df4b2b 100644
--- a/include/configs/mx6cuboxi.h
+++ b/include/configs/mx6cuboxi.h
@@ -29,7 +29,7 @@
 
 /* Ethernet Configuration */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_FEC_MXC_PHYADDR		0
 #define CONFIG_PHY_ATHEROS
 
diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h
index 10d3f4e747..b82b8325ff 100644
--- a/include/configs/mx6qarm2.h
+++ b/include/configs/mx6qarm2.h
@@ -21,7 +21,7 @@
 #define CONFIG_SYS_FSL_USDHC_NUM	2
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define	CONFIG_FEC_XCV_TYPE		RGMII
+#define	CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_FEC_MXC_PHYADDR		0
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index 24c6bbda17..86f192fb2d 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -21,7 +21,7 @@
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		1
 
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index 651ddace5a..f8a865d06e 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -33,7 +33,7 @@
 #define CONFIG_SYS_I2C_SPEED		  100000
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_FEC_MXC_PHYADDR		0
 
 #define CONFIG_PHY_SMSC
diff --git a/include/configs/mx6sxsabreauto.h b/include/configs/mx6sxsabreauto.h
index 918a68c17f..e5473570a9 100644
--- a/include/configs/mx6sxsabreauto.h
+++ b/include/configs/mx6sxsabreauto.h
@@ -129,7 +129,7 @@
 #define IMX_FEC_BASE			ENET2_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR          0x0
 
-#define CONFIG_FEC_XCV_TYPE             RGMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME                 "FEC"
 
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h
index 7d397910ec..095c0a8b56 100644
--- a/include/configs/mx6sxsabresd.h
+++ b/include/configs/mx6sxsabresd.h
@@ -153,7 +153,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR          0x1
 
-#define CONFIG_FEC_XCV_TYPE             RGMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME                 "FEC"
 
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/mx6ul_14x14_evk.h b/include/configs/mx6ul_14x14_evk.h
index e138999d14..90f28a95f5 100644
--- a/include/configs/mx6ul_14x14_evk.h
+++ b/include/configs/mx6ul_14x14_evk.h
@@ -189,11 +189,11 @@
 #if (CONFIG_FEC_ENET_DEV == 0)
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR          0x2
-#define CONFIG_FEC_XCV_TYPE             RMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RMII
 #elif (CONFIG_FEC_ENET_DEV == 1)
 #define IMX_FEC_BASE			ENET2_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR		0x1
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #endif
 #define CONFIG_ETHPRIME			"FEC"
 #endif
diff --git a/include/configs/mx7dsabresd.h b/include/configs/mx7dsabresd.h
index 5e66454626..384836746b 100644
--- a/include/configs/mx7dsabresd.h
+++ b/include/configs/mx7dsabresd.h
@@ -19,7 +19,7 @@
 #define CONFIG_SYS_MALLOC_LEN		(32 * SZ_1M)
 
 /* Network */
-#define CONFIG_FEC_XCV_TYPE             RGMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME                 "FEC"
 #define CONFIG_FEC_MXC_PHYADDR          0
 
diff --git a/include/configs/mxs.h b/include/configs/mxs.h
index 9e59e7a4dc..f895836161 100644
--- a/include/configs/mxs.h
+++ b/include/configs/mxs.h
@@ -115,7 +115,7 @@
 #define CONFIG_ETHPRIME			"FEC0"
 #endif
 #ifndef CONFIG_FEC_XCV_TYPE
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #endif
 #endif
 
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 6f9610964f..c6795d7f03 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -54,7 +54,7 @@
 #endif
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		6
 
diff --git a/include/configs/novena.h b/include/configs/novena.h
index 8451d556f7..fe4e92598f 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -62,7 +62,7 @@
 /* Ethernet Configuration */
 #ifdef CONFIG_CMD_NET
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		0x7
 #define CONFIG_ARP_TIMEOUT		200UL
diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h
index 7abc9d7450..87a00459f9 100644
--- a/include/configs/opos6uldev.h
+++ b/include/configs/opos6uldev.h
@@ -49,7 +49,7 @@
 #ifdef CONFIG_FEC_MXC
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR          0x1
-#define CONFIG_FEC_XCV_TYPE             RMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME			"FEC"
 #endif
 
diff --git a/include/configs/ot1200.h b/include/configs/ot1200.h
index 82bceeda77..db03f38fdd 100644
--- a/include/configs/ot1200.h
+++ b/include/configs/ot1200.h
@@ -69,7 +69,7 @@
 #endif
 
 #define IMX_FEC_BASE                    ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE             MII100
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_MII100
 #define CONFIG_ETHPRIME                 "FEC"
 #define CONFIG_FEC_MXC_PHYADDR          0x5
 #define CONFIG_PHY_SMSC
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index e78ac674ac..922ed12867 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -42,7 +42,7 @@
 /*#define CONFIG_ESDHC_DETECT_USE_EXTERN_IRQ1*/
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_FEC_MXC_PHYADDR          0
 
 /* QSPI Configs*/
diff --git a/include/configs/pcm058.h b/include/configs/pcm058.h
index 05770549d3..4e55da4b3b 100644
--- a/include/configs/pcm058.h
+++ b/include/configs/pcm058.h
@@ -32,7 +32,7 @@
 
 /* Ethernet */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		3
 
diff --git a/include/configs/pfla02.h b/include/configs/pfla02.h
index 6cf3eae2f2..fe3702c4d3 100644
--- a/include/configs/pfla02.h
+++ b/include/configs/pfla02.h
@@ -30,7 +30,7 @@
 
 /* Ethernet */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		3
 
diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index 8c3f6c5093..34660a77dc 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -17,7 +17,7 @@
 
 #define IMX_FEC_BASE			ENET2_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR		0x1
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN		(35 * SZ_1M) /* Increase due to DFU */
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 79012ad2f6..c568b9ca5f 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -18,7 +18,7 @@
 #define CONFIG_MXC_UART_BASE		UART5_IPS_BASE_ADDR
 
 /* Network */
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		1
 
diff --git a/include/configs/platinum_picon.h b/include/configs/platinum_picon.h
index 1b55e73979..c8b88995c7 100644
--- a/include/configs/platinum_picon.h
+++ b/include/configs/platinum_picon.h
@@ -12,7 +12,7 @@
 
 #include <configs/platinum.h>
 
-#define CONFIG_FEC_XCV_TYPE			RMII
+#define CONFIG_FEC_XCV_TYPE			PHY_INTERFACE_MODE_RMII
 #define CONFIG_FEC_MXC_PHYADDR			0
 
 #define CONFIG_HOSTNAME				"picon"
diff --git a/include/configs/platinum_titanium.h b/include/configs/platinum_titanium.h
index b4028832e9..afbfc94ca4 100644
--- a/include/configs/platinum_titanium.h
+++ b/include/configs/platinum_titanium.h
@@ -15,7 +15,7 @@
 
 #include <configs/platinum.h>
 
-#define CONFIG_FEC_XCV_TYPE			RGMII
+#define CONFIG_FEC_XCV_TYPE			PHY_INTERFACE_MODE_RGMII
 #define CONFIG_FEC_MXC_PHYADDR			4
 
 #define CONFIG_PHY_RESET_DELAY			1000
diff --git a/include/configs/secomx6quq7.h b/include/configs/secomx6quq7.h
index 1442cf1b5a..1804391fbe 100644
--- a/include/configs/secomx6quq7.h
+++ b/include/configs/secomx6quq7.h
@@ -27,7 +27,7 @@
 
 /* Ethernet Configuration */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		6
 
diff --git a/include/configs/sksimx6.h b/include/configs/sksimx6.h
index 1a71ac4904..58dfab08e6 100644
--- a/include/configs/sksimx6.h
+++ b/include/configs/sksimx6.h
@@ -22,7 +22,7 @@
 
 /* Ethernet */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		0x01
 
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index dbe1b662b0..59802766d8 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -50,7 +50,7 @@
 
 /* Ethernet */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		4
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/titanium.h b/include/configs/titanium.h
index 745c709b65..1aa431e65a 100644
--- a/include/configs/titanium.h
+++ b/include/configs/titanium.h
@@ -40,7 +40,7 @@
 #define CONFIG_SYS_FSL_USDHC_NUM	1
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_FEC_MXC_PHYADDR		4
 
 /* USB Configs */
diff --git a/include/configs/tqma6_mba6.h b/include/configs/tqma6_mba6.h
index bee6d2f33b..d459c98c06 100644
--- a/include/configs/tqma6_mba6.h
+++ b/include/configs/tqma6_mba6.h
@@ -9,7 +9,7 @@
 #ifndef __CONFIG_TQMA6_MBA6_H
 #define __CONFIG_TQMA6_MBA6_H
 
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 
 #define CONFIG_FEC_MXC_PHYADDR		0x03
diff --git a/include/configs/tqma6_wru4.h b/include/configs/tqma6_wru4.h
index 2e9292eb55..1d793f2fe4 100644
--- a/include/configs/tqma6_wru4.h
+++ b/include/configs/tqma6_wru4.h
@@ -7,7 +7,7 @@
 #define __CONFIG_TQMA6_WRU4_H
 
 /* Ethernet */
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		0x01
 #define CONFIG_PHY_SMSC
diff --git a/include/configs/udoo.h b/include/configs/udoo.h
index 8674139c40..145f0f03c7 100644
--- a/include/configs/udoo.h
+++ b/include/configs/udoo.h
@@ -33,7 +33,7 @@
 /* Network support */
 
 #define IMX_FEC_BASE                    ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE             RGMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME                 "FEC"
 #define CONFIG_FEC_MXC_PHYADDR          6
 
diff --git a/include/configs/udoo_neo.h b/include/configs/udoo_neo.h
index 27f8059b4a..e294b2c283 100644
--- a/include/configs/udoo_neo.h
+++ b/include/configs/udoo_neo.h
@@ -99,7 +99,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR          0x0
 
-#define CONFIG_FEC_XCV_TYPE             RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME                 "FEC0"
 
 #endif				/* __CONFIG_H */
diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index 501918195f..6d307611d4 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -45,7 +45,7 @@
 #define CONFIG_SYS_FSL_ESDHC_NUM	1
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_FEC_MXC_PHYADDR          0
 
 /* QSPI Configs*/
diff --git a/include/configs/vining_2000.h b/include/configs/vining_2000.h
index c3b9485031..5c9367ce9e 100644
--- a/include/configs/vining_2000.h
+++ b/include/configs/vining_2000.h
@@ -65,7 +65,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR          0x0
 
-#define CONFIG_FEC_XCV_TYPE             RMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME                 "FEC"
 
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index c864d112cc..d685cacc57 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -57,7 +57,7 @@
 
 /* Ethernet Configuration */
 #define IMX_FEC_BASE			ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_FEC_XCV_TYPE		PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_FEC_MXC_PHYADDR		1
 #define CONFIG_PHY_ATHEROS
diff --git a/include/configs/xpress.h b/include/configs/xpress.h
index 1277f55296..781955eeae 100644
--- a/include/configs/xpress.h
+++ b/include/configs/xpress.h
@@ -68,7 +68,7 @@
 #define CONFIG_FEC_ENET_DEV		0
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_MXC_PHYADDR          0x0
-#define CONFIG_FEC_XCV_TYPE             RMII
+#define CONFIG_FEC_XCV_TYPE             PHY_INTERFACE_MODE_RMII
 #define CONFIG_ETHPRIME			"FEC"
 #define CONFIG_PHY_SMSC
 
diff --git a/include/configs/zc5202.h b/include/configs/zc5202.h
index b82da93207..72ebe069ea 100644
--- a/include/configs/zc5202.h
+++ b/include/configs/zc5202.h
@@ -18,7 +18,7 @@
 
 /* Ethernet */
 #define IMX_FEC_BASE				ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE			MII100
+#define CONFIG_FEC_XCV_TYPE			PHY_INTERFACE_MODE_MII100
 #define CONFIG_ETHPRIME				"FEC"
 #define CONFIG_FEC_MXC_PHYADDR			0
 #define CONFIG_MV88E6352_SWITCH
diff --git a/include/configs/zc5601.h b/include/configs/zc5601.h
index 2227877f72..4f376ba523 100644
--- a/include/configs/zc5601.h
+++ b/include/configs/zc5601.h
@@ -19,7 +19,7 @@
 
 /* Ethernet */
 #define IMX_FEC_BASE				ENET_BASE_ADDR
-#define CONFIG_FEC_XCV_TYPE			RGMII
+#define CONFIG_FEC_XCV_TYPE			PHY_INTERFACE_MODE_RGMII
 #define CONFIG_ETHPRIME				"FEC"
 #define CONFIG_FEC_MXC_PHYADDR			0x10
 #define CONFIG_FEC_FIXED_SPEED			1000 /* No autoneg, fix Gb */
diff --git a/include/phy.h b/include/phy.h
index 7c3fc5ce40..d4bf21d02d 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -50,6 +50,7 @@
 
 typedef enum {
 	PHY_INTERFACE_MODE_MII,
+	PHY_INTERFACE_MODE_MII100,
 	PHY_INTERFACE_MODE_GMII,
 	PHY_INTERFACE_MODE_SGMII,
 	PHY_INTERFACE_MODE_SGMII_2500,
@@ -65,6 +66,7 @@ typedef enum {
 	PHY_INTERFACE_MODE_XAUI,
 	PHY_INTERFACE_MODE_RXAUI,
 	PHY_INTERFACE_MODE_SFI,
+	PHY_INTERFACE_MODE_SEVENWIRE,
 	PHY_INTERFACE_MODE_INTERNAL,
 	PHY_INTERFACE_MODE_NONE,	/* Must be last */
 
@@ -73,6 +75,7 @@ typedef enum {
 
 static const char *phy_interface_strings[] = {
 	[PHY_INTERFACE_MODE_MII]		= "mii",
+	[PHY_INTERFACE_MODE_MII100]		= "mii100",
 	[PHY_INTERFACE_MODE_GMII]		= "gmii",
 	[PHY_INTERFACE_MODE_SGMII]		= "sgmii",
 	[PHY_INTERFACE_MODE_SGMII_2500]		= "sgmii-2500",
@@ -88,6 +91,7 @@ static const char *phy_interface_strings[] = {
 	[PHY_INTERFACE_MODE_XAUI]		= "xaui",
 	[PHY_INTERFACE_MODE_RXAUI]		= "rxaui",
 	[PHY_INTERFACE_MODE_SFI]		= "sfi",
+	[PHY_INTERFACE_MODE_SEVENWIRE]		= "sevenwire",
 	[PHY_INTERFACE_MODE_INTERNAL]		= "internal",
 	[PHY_INTERFACE_MODE_NONE]		= "",
 };
-- 
2.18.0.321.gffc6fa0e3



More information about the U-Boot mailing list