From patchwork Thu Jun 29 16:54:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 782380 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wz5ZT3t2Nz9s0Z for ; Fri, 30 Jun 2017 03:02:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4780DC21D75; Thu, 29 Jun 2017 17:00:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 767C7C21D59; Thu, 29 Jun 2017 16:56:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2E6A0C21D6B; Thu, 29 Jun 2017 16:56:33 +0000 (UTC) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lists.denx.de (Postfix) with ESMTPS id 1AEFBC21D5B for ; Thu, 29 Jun 2017 16:54:30 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3wz5NR6ZcQz9ttBS; Thu, 29 Jun 2017 18:54:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 9pYTCCnVB_bG; Thu, 29 Jun 2017 18:54:15 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 3wz5NR5L02z9ttBP; Thu, 29 Jun 2017 18:54:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 01DD58B8C4; Thu, 29 Jun 2017 18:54:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id owYmjFphtqNY; Thu, 29 Jun 2017 18:54:28 +0200 (CEST) Received: from pc13941vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.8]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A60BF8B8C3; Thu, 29 Jun 2017 18:54:28 +0200 (CEST) Received: by pc13941vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 9071967501; Thu, 29 Jun 2017 18:54:28 +0200 (CEST) Message-Id: <2db705d6fb40695791f07cf7da43363208995a65.1498751837.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy To: Wolfgang Denk , Heiko Schocher , Tom Rini , Joe Hershberger Date: Thu, 29 Jun 2017 18:54:28 +0200 (CEST) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 5/7] powerpc, 8xx: move FEC Ethernet driver in drivers/net X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Christophe Leroy Acked-by: Joe Hershberger --- README | 15 ------ arch/powerpc/cpu/mpc8xx/Makefile | 1 - arch/powerpc/cpu/mpc8xx/cpu.c | 2 +- drivers/net/Kconfig | 58 ++++++++++++++++++++++ drivers/net/Makefile | 1 + .../cpu/mpc8xx/fec.c => drivers/net/mpc8xx_fec.c | 18 ------- scripts/config_whitelist.txt | 4 -- 7 files changed, 60 insertions(+), 39 deletions(-) rename arch/powerpc/cpu/mpc8xx/fec.c => drivers/net/mpc8xx_fec.c (98%) diff --git a/README b/README index 3d9aad5c9c..4eeda3f7fe 100644 --- a/README +++ b/README @@ -4083,21 +4083,6 @@ Low Level (hardware related) configuration options: Only for 83xx systems. If specified, then DDR should 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 Enable RMII mode for all FECs. Note that this is a global option, we can't diff --git a/arch/powerpc/cpu/mpc8xx/Makefile b/arch/powerpc/cpu/mpc8xx/Makefile index db2f5ecd47..c6b933b680 100644 --- a/arch/powerpc/cpu/mpc8xx/Makefile +++ b/arch/powerpc/cpu/mpc8xx/Makefile @@ -11,7 +11,6 @@ extra-y += start.o extra-y += traps.o obj-y += cpu.o obj-y += cpu_init.o -obj-y += fec.o obj-$(CONFIG_OF_LIBFDT) += fdt.o obj-y += interrupts.o obj-$(CONFIG_CMD_REGINFO) += reginfo.o diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c index 19392de168..6ce73de4e8 100644 --- a/arch/powerpc/cpu/mpc8xx/cpu.c +++ b/arch/powerpc/cpu/mpc8xx/cpu.c @@ -347,7 +347,7 @@ void reset_8xx_watchdog (volatile immap_t * immr) */ int cpu_eth_init(bd_t *bis) { -#if defined(FEC_ENET) +#if defined(CONFIG_MPC8XX_FEC) fec_initialize(bis); #endif return 0; diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 33634c33d4..736aab2e6e 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -246,4 +246,62 @@ config RENESAS_RAVB This driver implements support for the Ethernet AVB block in 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 diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 4a5176e087..94a4fd8701 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_LAN91C96) += lan91c96.o obj-$(CONFIG_LPC32XX_ETH) += lpc32xx_eth.o obj-$(CONFIG_MACB) += macb.o obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o +obj-$(CONFIG_MPC8XX_FEC) += mpc8xx_fec.o obj-$(CONFIG_MVGBE) += mvgbe.o obj-$(CONFIG_MVNETA) += mvneta.o obj-$(CONFIG_MVPP2) += mvpp2.o diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/drivers/net/mpc8xx_fec.c similarity index 98% rename from arch/powerpc/cpu/mpc8xx/fec.c rename to drivers/net/mpc8xx_fec.c index 5daf6fe519..ebf8a1c0bd 100644 --- a/arch/powerpc/cpu/mpc8xx/fec.c +++ b/drivers/net/mpc8xx_fec.c @@ -17,14 +17,6 @@ DECLARE_GLOBAL_DATA_PTR; #undef ET_DEBUG -#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 */ #if defined(CONFIG_SYS_DISCOVER_PHY) || defined(CONFIG_FEC1_PHY) || defined(CONFIG_FEC2_PHY) #define WANT_MII @@ -66,11 +58,7 @@ static struct ether_fcc_info_s { 0, offsetof(immap_t, im_cpm.cp_fec1), -#if defined(CONFIG_FEC1_PHY) CONFIG_FEC1_PHY, -#else - -1, /* discover */ -#endif -1, 0, @@ -80,11 +68,7 @@ static struct ether_fcc_info_s { 1, offsetof(immap_t, im_cpm.cp_fec2), -#if defined(CONFIG_FEC2_PHY) CONFIG_FEC2_PHY, -#else - -1, -#endif -1, 0, }, @@ -929,5 +913,3 @@ int fec8xx_miiphy_write(struct mii_dev *bus, int addr, int devad, int reg, return 0; } #endif - -#endif diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 787806a9ef..f51dd4fa17 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -739,8 +739,6 @@ CONFIG_ETHER_ON_FCC CONFIG_ETHER_ON_FCC1 CONFIG_ETHER_ON_FCC2 CONFIG_ETHER_ON_FCC3 -CONFIG_ETHER_ON_FEC1 -CONFIG_ETHER_ON_FEC2 CONFIG_ETHPRIME CONFIG_ETH_BUFSIZE CONFIG_ETH_RXSIZE @@ -797,8 +795,6 @@ CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN CONFIG_FEATURE_SH_EXTRA_QUIET CONFIG_FEATURE_SH_FANCY_PROMPT CONFIG_FEATURE_SH_STANDALONE_SHELL -CONFIG_FEC1_PHY -CONFIG_FEC2_PHY CONFIG_FEC_ENET CONFIG_FEC_ENET_DEV CONFIG_FEC_FIXED_SPEED