From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valentin Longchamp Date: Thu, 7 Jun 2012 12:06:58 +0200 Subject: [U-Boot] [PATCH 18/20] arm/km: implement weak function board_spi_clam_bus/release In-Reply-To: <1339063620-8890-1-git-send-email-valentin.longchamp@keymile.com> References: <1339063620-8890-1-git-send-email-valentin.longchamp@keymile.com> Message-ID: <1339063620-8890-19-git-send-email-valentin.longchamp@keymile.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@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 8e4c382..a71bd2f 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 @@ -307,29 +308,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, NULL); - 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[]) { -- 1.7.1