From patchwork Sun Jan 29 15:54:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Linz X-Patchwork-Id: 138451 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 267C0B6F68 for ; Mon, 30 Jan 2012 02:57:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8CCB7280B8; Sun, 29 Jan 2012 16:56:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7DJ-g8FjJlbL; Sun, 29 Jan 2012 16:56:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4D5C12809E; Sun, 29 Jan 2012 16:56:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3310B28096 for ; Sun, 29 Jan 2012 16:55:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wBxmVgnmDMNY for ; Sun, 29 Jan 2012 16:55:42 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.162]) by theia.denx.de (Postfix) with ESMTPS id 2A49128091 for ; Sun, 29 Jan 2012 16:55:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1327852524; l=3937; s=domk; d=li-pro.net; h=References:In-Reply-To:References:In-Reply-To:Date:Subject:Cc:To: From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=cfcUQ1dsD/lwNTr057dn1y3my3w=; b=bYwzbPQImK12+tlAT094hUeymBX4UZxE9Ub96V6wS1K5hxTqjrqbl9p4/ITEH08huvl tdNrBOePEKw9TNStr0pcTUnZ+zwG3izJXBik/+jJHUX0IsdVZrs20UC7Vtn6yyMkhCgy1 bFNVKTXpOS4yHdIip0H0NJYpoPj6aAXbSkM= X-RZG-AUTH: :IGUKb2CkcrLHmZv+FHarxbxlXmJO7WRQLa+vsyW+4B7AQuz+obYoxVNdW3KK X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain (i5E86CD87.versanet.de [94.134.205.135]) by smtp.strato.de (fruni mo25) (RZmta 27.6 AUTH) with ESMTPA id 203e16o0TFmZrL ; Sun, 29 Jan 2012 16:55:05 +0100 (MET) From: Stephan Linz To: monstr@monstr.eu Date: Sun, 29 Jan 2012 16:54:39 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1327852301.3638.177.camel@keto> References: <1327852301.3638.177.camel@keto> In-Reply-To: <79690689be5ffaaf2c2daf337b45f0ae2f3399bd.1327848193.git.linz@li-pro.net> References: <79690689be5ffaaf2c2daf337b45f0ae2f3399bd.1327848193.git.linz@li-pro.net> Cc: Stephan Linz , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 8/8] microblaze: ll_temac: export xilinx_ll_temac_eth_init() for evaluation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Stephan Linz --- .../xilinx/microblaze-generic/microblaze-generic.c | 57 ++++++++++++++++++++ drivers/net/xilinx_ll_temac.c | 2 +- include/xilinx_ll_temac.h | 3 + 3 files changed, 61 insertions(+), 1 deletions(-) diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 517b2f1..d2f56b9 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -31,6 +31,10 @@ #include #include +#ifdef CONFIG_XILINX_LL_TEMAC +#include +#endif + int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifdef CONFIG_SYS_GPIO_0 @@ -92,7 +96,60 @@ int board_eth_init(bd_t *bis) #endif #ifdef CONFIG_XILINX_LL_TEMAC +#if 1 + /* This should be the preferred way to initialize + * all the interfaces. */ ret |= xilinx_ll_temac_standard_init(bis); +#else + /************************************************************ + * NOTE: This part is for evaluation and will help achieve + * the right way to initialize all LL TEMAC ethernet + * interfaces. There can be more than this two i/f! + ************************************************************/ + struct ll_temac_info devinf; + +# ifdef XILINX_LLTEMAC_BASEADDR + memset(&devinf, 0, sizeof(devinf)); + devinf.phyaddr = -1; + devinf.base_addr = XILINX_LLTEMAC_BASEADDR; +# ifdef XILINX_LLTEMAC_FIFO_BASEADDR + devinf.flags = LL_TEMAC_M_FIFO; + devinf.ctrl_addr = XILINX_LLTEMAC_FIFO_BASEADDR; + ret |= xilinx_ll_temac_eth_init(bis, &devinf); +# elif XILINX_LLTEMAC_SDMA_CTRL_BASEADDR +# if XILINX_LLTEMAC_SDMA_USE_DCR == 1 + devinf.flags = LL_TEMAC_M_SDMA_DCR; + devinf.ctrl_addr = XILINX_LLTEMAC_SDMA_CTRL_BASEADDR; + ret |= xilinx_ll_temac_eth_init(bis, &devinf); +# else + devinf.flags = LL_TEMAC_M_SDMA_PLB; + devinf.ctrl_addr = XILINX_LLTEMAC_SDMA_CTRL_BASEADDR; + ret |= xilinx_ll_temac_eth_init(bis, &devinf); +# endif +# endif +# endif + +# ifdef XILINX_LLTEMAC_BASEADDR1 + memset(&devinf, 0, sizeof(devinf)); + devinf.phyaddr = -1; + devinf.base_addr = XILINX_LLTEMAC_BASEADDR1; +# ifdef XILINX_LLTEMAC_FIFO_BASEADDR1 + devinf.flags = LL_TEMAC_M_FIFO; + devinf.ctrl_addr = XILINX_LLTEMAC_FIFO_BASEADDR1; + ret |= xilinx_ll_temac_eth_init(bis, &devinf); +# elif XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 +# if XILINX_LLTEMAC_SDMA_USE_DCR == 1 + devinf.flags = LL_TEMAC_M_SDMA_DCR; + devinf.ctrl_addr = XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1; + ret |= xilinx_ll_temac_eth_init(bis, &devinf); +# else + devinf.flags = LL_TEMAC_M_SDMA_PLB; + devinf.ctrl_addr = XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1; + ret |= xilinx_ll_temac_eth_init(bis, &devinf); +# endif +# endif +# endif +#endif /* if 0 */ #endif return ret; diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c index 28bc4cd..f6c5fc1 100644 --- a/drivers/net/xilinx_ll_temac.c +++ b/drivers/net/xilinx_ll_temac.c @@ -352,7 +352,7 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf) * Returns 1 if the ll_temac device and the mdio bus were initialized * otherwise returns 0 */ -static int xilinx_ll_temac_eth_init(bd_t *bis, struct ll_temac_info *devinf) +int xilinx_ll_temac_eth_init(bd_t *bis, struct ll_temac_info *devinf) { struct ll_temac_mdio_info mdioinf; int ret; diff --git a/include/xilinx_ll_temac.h b/include/xilinx_ll_temac.h index af4a09f..8fdce22 100644 --- a/include/xilinx_ll_temac.h +++ b/include/xilinx_ll_temac.h @@ -355,4 +355,7 @@ struct ll_temac_info { int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf); +/* FIXME: xilinx_ll_temac_eth_init() must be again private ? */ +int xilinx_ll_temac_eth_init(bd_t *bis, struct ll_temac_info *devinf); + #endif /* _XILINX_LL_TEMAC_ */