From patchwork Tue May 15 14:11:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Longchamp X-Patchwork-Id: 159347 X-Patchwork-Delegate: prafulla@marvell.com 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 7E8AAB6F9F for ; Wed, 16 May 2012 00:27:33 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E4D42818C; Tue, 15 May 2012 16:25:56 +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 EqUs6HDi+tQ9; Tue, 15 May 2012 16:25:56 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B449D28114; Tue, 15 May 2012 16:23:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E3BE28099 for ; Tue, 15 May 2012 16:21:38 +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 qAipCzUWcfe4 for ; Tue, 15 May 2012 16:21:37 +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.ch.keymile.com (mail.ch.keymile.com [193.17.201.103]) by theia.denx.de (Postfix) with SMTP id 5492E280AC for ; Tue, 15 May 2012 16:21:24 +0200 (CEST) Received: from SRVCHBER1212.ch.keymile.net ([172.31.32.9]) by eSafe SMTP Relay 1334159602; Tue, 15 May 2012 16:11:08 +0200 Received: from chber1-10533x.ch.keymile.net ([172.31.40.3]) by SRVCHBER1212.ch.keymile.net with Microsoft SMTPSVC(6.0.3790.4675); Tue, 15 May 2012 16:11:07 +0200 From: Valentin Longchamp To: To: prafulla@marvell.com, holger.brunck@keymile.com Date: Tue, 15 May 2012 16:11:02 +0200 Message-Id: <1337091064-30561-26-git-send-email-valentin.longchamp@keymile.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1337091064-30561-1-git-send-email-valentin.longchamp@keymile.com> References: <1337091064-30561-1-git-send-email-valentin.longchamp@keymile.com> X-OriginalArrivalTime: 15 May 2012 14:11:07.0046 (UTC) FILETIME=[92149460:01CD32A4] X-ESAFE-STATUS: [srvchber1306.keymile.net] Mail allowed Cc: Valentin Longchamp , Gerlando@theia.denx.de, u-boot@lists.denx.de, Holger Brunck , Falauto Subject: [U-Boot] [PATCH v4 25/27] arm/km: implement weak function board_spi_clam_bus/release 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 They are needed on all km_arm boards where we have the environement variables in the NOR Flash. First boards using this feature are kmcoge5un and kmnusa. Signed-off-by: Valentin Longchamp Signed-off-by: Holger Brunck cc: Gerlando Falauto cc: Prafulla Wadaskar --- board/keymile/km_arm/km_arm.c | 26 ++++++++------------------ 1 files changed, 8 insertions(+), 18 deletions(-) diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index c87e645..d370c8c 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -305,29 +306,18 @@ int board_late_init(void) return 0; } -int km_hw_spi_bus_claim(int on) +int board_spi_claim_bus(struct spi_slave *slave) { - int gpio_value = !on; - - if (on) { - kwmpp_config[0] = MPP0_SPI_SCn; - kwmpp_config[1] = MPP1_SPI_MOSI; - kwmpp_config[2] = MPP2_SPI_SCK; - kwmpp_config[3] = MPP3_SPI_MISO; - } else { - kwmpp_config[0] = MPP0_NF_IO2; - kwmpp_config[1] = MPP1_NF_IO3; - kwmpp_config[2] = MPP2_NF_IO4; - kwmpp_config[3] = MPP3_NF_IO5; - } - - /* Multi-Purpose Pins Functionality configuration */ - kirkwood_mpp_conf(kwmpp_config); - kw_gpio_set_value(KM_FLASH_GPIO_PIN, gpio_value); + kw_gpio_set_value(KM_FLASH_GPIO_PIN, 0); return 0; } +void board_spi_release_bus(struct spi_slave *slave) +{ + kw_gpio_set_value(KM_FLASH_GPIO_PIN, 1); +} + #if defined(CONFIG_CMD_SF) int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {