[U-Boot] [PATCH v4 25/27] arm/km: implement weak function board_spi_clam_bus/release

Prafulla Wadaskar prafulla at marvell.com
Thu May 24 10:46:23 CEST 2012



> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
> Sent: 15 May 2012 19:41
> To: Prafulla Wadaskar; holger.brunck at keymile.com
> Cc: Valentin Longchamp; u-boot at lists.denx.de; Holger Brunck; Gerlando
> Falauto; Prafulla Wadaskar
> Subject: [PATCH v4 25/27] arm/km: implement weak function
> board_spi_clam_bus/release
> 
> 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 <valentin.longchamp at keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck at keymile.com>
> cc: Gerlando Falauto <gerlando.falauto at keymile.com>
> cc: Prafulla Wadaskar <prafulla at marvell.com>
> ---
>  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 <nand.h>
>  #include <netdev.h>
>  #include <miiphy.h>
> +#include <spi.h>
>  #include <asm/io.h>
>  #include <asm/arch/cpu.h>
>  #include <asm/errno.h>
> @@ -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);
> +}
> +

Sorry, I didn't understand.
BTW: Why this is needed from SPI context?

Please let's converge on SPI patches first and then send the rest of the dependent patch series, or exclude the SPI related changes for this patch series

I will suggest to post smaller patch series targeting -
1. bug fixes to the current supported boards, that will go fast in.
2. SPI clam/release mpp patches
3. New board supports

Regards..
Prafulla . . .


More information about the U-Boot mailing list