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

login
register
mail settings
Submitter Valentin Longchamp
Date May 15, 2012, 2:11 p.m.
Message ID <1337091064-30561-26-git-send-email-valentin.longchamp@keymile.com>
Download mbox | patch
Permalink /patch/159347/
State Rejected
Delegated to: Prafulla Wadaskar
Headers show

Comments

Valentin Longchamp - May 15, 2012, 2:11 p.m.
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@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
---
 board/keymile/km_arm/km_arm.c |   26 ++++++++------------------
 1 files changed, 8 insertions(+), 18 deletions(-)
Prafulla Wadaskar - May 24, 2012, 8:46 a.m.
> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp@keymile.com]
> Sent: 15 May 2012 19:41
> To: Prafulla Wadaskar; holger.brunck@keymile.com
> Cc: Valentin Longchamp; u-boot@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@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> cc: Gerlando Falauto <gerlando.falauto@keymile.com>
> cc: Prafulla Wadaskar <prafulla@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 . . .
Holger Brunck - May 24, 2012, 3:54 p.m.
Hi Prafulla,

On 05/24/2012 10:46 AM, Prafulla Wadaskar wrote:
>> -		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
>

the whole SPI stuff will be answered from Valentin when he is back next week.

What I could do to proceed with this patch series is to extract the bugfixes and
small reworks which are preparations for the new boards in a single patch serie
tomorrow that we can go ahead here.

This would be patches 01-09 from this serie. Ok?

Regards
Holger
Prafulla Wadaskar - May 25, 2012, 10:36 a.m.
> -----Original Message-----
> From: Holger Brunck [mailto:holger.brunck@keymile.com]
> Sent: 24 May 2012 21:24
> To: Prafulla Wadaskar
> Cc: Valentin Longchamp; u-boot@lists.denx.de; Gerlando Falauto
> Subject: Re: [PATCH v4 25/27] arm/km: implement weak function
> board_spi_clam_bus/release
> 
> Hi Prafulla,
> 
> On 05/24/2012 10:46 AM, Prafulla Wadaskar wrote:
> >> -		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
> >
> 
> the whole SPI stuff will be answered from Valentin when he is back
> next week.
> 
> What I could do to proceed with this patch series is to extract the
> bugfixes and
> small reworks which are preparations for the new boards in a single
> patch serie
> tomorrow that we can go ahead here.
> 
> This would be patches 01-09 from this serie. Ok?
> 

This sounds good, at least let's get in the bugfixes and updates.

Regards..
Prafulla . . .

Patch

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);
+}
+
 #if defined(CONFIG_CMD_SF)
 int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {