From patchwork Tue May 1 21:09:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 156233 X-Patchwork-Delegate: sbabic@denx.de 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 D3284B6FAB for ; Wed, 2 May 2012 07:10:10 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6635C28154; Tue, 1 May 2012 23:10:08 +0200 (CEST) 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 nFFCpbQYVRf3; Tue, 1 May 2012 23:10:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1981F2812C; Tue, 1 May 2012 23:10:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7619F28125 for ; Tue, 1 May 2012 23:10:03 +0200 (CEST) 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 p-r3elCcSTHl for ; Tue, 1 May 2012 23:10:03 +0200 (CEST) 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 mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTPS id EF70D28114 for ; Tue, 1 May 2012 23:10:02 +0200 (CEST) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VhwHZ3Y9zz3hhZh; Tue, 1 May 2012 23:10:02 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 3VhwHZ4Qxjz4KK4L; Tue, 1 May 2012 23:10:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from smtp-auth.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id sDGqOk+D-Ik9; Tue, 1 May 2012 23:10:02 +0200 (CEST) Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA; Tue, 1 May 2012 23:10:01 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Tue, 1 May 2012 23:09:42 +0200 Message-Id: <1335906593-25183-3-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1335906593-25183-1-git-send-email-marex@denx.de> References: <1335906593-25183-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Fabio Estevam Subject: [U-Boot] [PATCH 02/13] M28EVK: Implement support for new board V2.0 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: Marek Vasut Cc: Detlev Zundel Cc: Fabio Estevam Cc: Stefano Babic Cc: Wolfgang Denk --- board/denx/m28evk/m28evk.c | 20 +++++++++++++++++++- board/denx/m28evk/spl_boot.c | 8 ++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/board/denx/m28evk/m28evk.c b/board/denx/m28evk/m28evk.c index 53df476..3d28ea8 100644 --- a/board/denx/m28evk/m28evk.c +++ b/board/denx/m28evk/m28evk.c @@ -90,6 +90,8 @@ int board_mmc_init(bd_t *bis) { /* Configure WP as input. */ gpio_direction_input(MX28_PAD_AUART2_CTS__GPIO_3_10); + /* Turn on the power to the card. */ + gpio_direction_output(MX28_PAD_PWM3__GPIO_3_28, 0); return mxsmmc_initialize(bis, 0, m28_mmc_wp); } @@ -103,10 +105,18 @@ int board_mmc_init(bd_t *bis) int fecmxc_mii_postcall(int phy) { +#if defined(CONFIG_DENX_M28_V11) || defined(CONFIG_DENX_M28_V10) + /* KZ8031 PHY on old boards. */ + const uint32_t freq = 0x0080; +#else + /* KZ8021 PHY on new boards. */ + const uint32_t freq = 0x0000; +#endif + miiphy_write("FEC1", phy, MII_BMCR, 0x9000); miiphy_write("FEC1", phy, MII_OPMODE_STRAP_OVERRIDE, 0x0202); if (phy == 3) - miiphy_write("FEC1", 3, MII_PHY_CTRL2, 0x8180); + miiphy_write("FEC1", 3, MII_PHY_CTRL2, 0x8100 | freq); return 0; } @@ -123,6 +133,14 @@ int board_eth_init(bd_t *bis) CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN, CLKCTRL_ENET_TIME_SEL_RMII_CLK); +#if !defined(CONFIG_DENX_M28_V11) && !defined(CONFIG_DENX_M28_V10) + /* Reset the new PHY */ + gpio_direction_output(MX28_PAD_AUART2_RTS__GPIO_3_11, 0); + udelay(10000); + gpio_set_value(MX28_PAD_AUART2_RTS__GPIO_3_11, 1); + udelay(10000); +#endif + ret = fecmxc_initialize_multi(bis, 0, 0, MXS_ENET0_BASE); if (ret) { printf("FEC MXS: Unable to init FEC0\n"); diff --git a/board/denx/m28evk/spl_boot.c b/board/denx/m28evk/spl_boot.c index a04fe18..7a12592 100644 --- a/board/denx/m28evk/spl_boot.c +++ b/board/denx/m28evk/spl_boot.c @@ -109,8 +109,9 @@ const iomux_cfg_t iomux_setup[] = { (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL), MX28_PAD_SSP0_SCK__SSP0_SCK | (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL), - MX28_PAD_PWM3__GPIO_3_28 | MUX_CONFIG_SSP0, /* Power .. FIXME */ - MX28_PAD_AUART2_CTS__GPIO_3_10, /* WP ... FIXME */ + MX28_PAD_PWM3__GPIO_3_28 | MUX_CONFIG_SSP0 | + (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL), /* Power */ + MX28_PAD_AUART2_CTS__GPIO_3_10, /* WP */ /* GPMI NAND */ MX28_PAD_GPMI_D00__GPMI_D0 | MUX_CONFIG_GPMI, @@ -147,6 +148,9 @@ const iomux_cfg_t iomux_setup[] = { MX28_PAD_ENET0_RXD3__ENET1_RXD1 | MUX_CONFIG_ENET, MX28_PAD_ENET0_TXD2__ENET1_TXD0 | MUX_CONFIG_ENET, MX28_PAD_ENET0_TXD3__ENET1_TXD1 | MUX_CONFIG_ENET, +#if !defined(CONFIG_DENX_M28_V11) && !defined(CONFIG_DENX_M28_V10) + MX28_PAD_AUART2_RTS__GPIO_3_11, /* PHY reset */ +#endif /* I2C */ MX28_PAD_I2C0_SCL__I2C0_SCL,