From b1c9dae02952cd51439e460bdd4984c5eeecafec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Fri, 21 Aug 2015 16:44:40 +0200 Subject: [PATCH] net: fec: remove obsolete FEC_MXC_MULTI --- board/karo/tx28/tx28.c | 84 +++++++++++++++++++++++------------------- drivers/net/Kconfig | 4 -- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/board/karo/tx28/tx28.c b/board/karo/tx28/tx28.c index e81ee89285..2e7ec77a10 100644 --- a/board/karo/tx28/tx28.c +++ b/board/karo/tx28/tx28.c @@ -200,7 +200,7 @@ int board_mmc_init(bd_t *bis) #ifdef CONFIG_FEC_MXC #ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM -#ifdef CONFIG_FEC_MXC_MULTI +#ifndef CONFIG_TX28_S #define FEC_MAX_IDX 1 #else #define FEC_MAX_IDX 0 @@ -256,6 +256,46 @@ static int fec_get_mac_addr(int index) eth_setenv_enetaddr(env_name, mac); return 0; } + +static inline int tx28_fec1_enabled(void) +{ + const char *status; + int off; + + if (!gd->fdt_blob) + return 0; + + off = fdt_path_offset(gd->fdt_blob, "ethernet1"); + if (off < 0) + return 0; + + status = fdt_getprop(gd->fdt_blob, off, "status", NULL); + return status && (strcmp(status, "okay") == 0); +} + +static void tx28_init_mac(void) +{ + int ret; + + ret = fec_get_mac_addr(0); + if (ret < 0) { + printf("Failed to read FEC0 MAC address from OCOTP\n"); + return; + } +#ifdef CONFIG_TX28_S + if (tx28_fec1_enabled()) { + ret = fec_get_mac_addr(1); + if (ret < 0) { + printf("Failed to read FEC1 MAC address from OCOTP\n"); + return; + } + } +#endif +} +#else +static inline void tx28_init_mac(void) +{ +} #endif /* CONFIG_GET_FEC_MAC_ADDR_FROM_IIM */ static const iomux_cfg_t tx28_fec_pads[] = { @@ -292,7 +332,7 @@ int board_eth_init(bd_t *bis) return ret; } -#ifdef CONFIG_FEC_MXC_MULTI +#ifndef CONFIG_TX28_S if (getenv("ethaddr")) { ret = fecmxc_initialize_multi(bis, 0, 0, MXS_ENET0_BASE); if (ret) { @@ -319,6 +359,10 @@ int board_eth_init(bd_t *bis) #endif return 0; } +#else +static inline void tx28_init_mac(void) +{ +} #endif /* CONFIG_FEC_MXC */ enum { @@ -799,42 +843,6 @@ static void stk5v5_board_init(void) mxs_iomux_setup_pad(STK5_CAN_XCVR_GPIO); } -int tx28_fec1_enabled(void) -{ - const char *status; - int off; - - if (!gd->fdt_blob) - return 0; - - off = fdt_path_offset(gd->fdt_blob, "ethernet1"); - if (off < 0) - return 0; - - status = fdt_getprop(gd->fdt_blob, off, "status", NULL); - return status && (strcmp(status, "okay") == 0); -} - -static void tx28_init_mac(void) -{ - int ret; - - ret = fec_get_mac_addr(0); - if (ret < 0) { - printf("Failed to read FEC0 MAC address from OCOTP\n"); - return; - } -#ifdef CONFIG_FEC_MXC_MULTI - if (tx28_fec1_enabled()) { - ret = fec_get_mac_addr(1); - if (ret < 0) { - printf("Failed to read FEC1 MAC address from OCOTP\n"); - return; - } - } -#endif -} - int board_late_init(void) { int ret = 0; diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index c5736b0c37..6c0abccb9d 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -17,10 +17,6 @@ config GET_FEC_MAC_ADDR_FROM_IIM if FEC_MXC -config FEC_MXC_MULTI - bool "Support multiple ethernet interfaces" - depends on MX28 || MX6 - config FEC_MXC_PHYADDR int "FEC Ethernet PHY address" default 0 -- 2.39.2