All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH for 3.0] AT91: Change nand buswidth logic to match hardware default configuration
Date: Mon, 04 Jul 2011 11:37:01 +0200	[thread overview]
Message-ID: <4E1189BD.509@atmel.com> (raw)
In-Reply-To: <1309515924-22531-1-git-send-email-nicolas.ferre@atmel.com>

Le 01/07/2011 12:25, Nicolas Ferre :
> The recently modified nand buswitth configuration is not aligned with
> board reality: the double footprint on boards is always populated with 8bits
> buswidth nand flashes.
> So we have to consider that without particular configuration the 8bits
> buswidth is selected by default.
> Moreover, the previous logic was always using !board_have_nand_8bit(), we
> change it to a simpler: board_have_nand_16bit().
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Arnd,

Can you please handle this parch for 3.0-final as a bug fix through the
arm-soc.git tree?

You can queue it in addition of the pull request sent by
Jean-Christophe: "AT91: Fix pull requset".

Thanks, best regards,

> ---
>  arch/arm/mach-at91/board-cap9adk.c           |    2 +-
>  arch/arm/mach-at91/board-sam9260ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9261ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9263ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9g20ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9m10g45ek.c      |    2 +-
>  arch/arm/mach-at91/include/mach/system_rev.h |   10 +++++-----
>  7 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
> index 1904fdf..cdb65d4 100644
> --- a/arch/arm/mach-at91/board-cap9adk.c
> +++ b/arch/arm/mach-at91/board-cap9adk.c
> @@ -215,7 +215,7 @@ static void __init cap9adk_add_device_nand(void)
>  	csa = at91_sys_read(AT91_MATRIX_EBICSA);
>  	at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
>  
> -	cap9adk_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	cap9adk_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (cap9adk_nand_data.bus_width_16)
>  		cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
> index d600dc1..5c24074 100644
> --- a/arch/arm/mach-at91/board-sam9260ek.c
> +++ b/arch/arm/mach-at91/board-sam9260ek.c
> @@ -214,7 +214,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
> index f897f84..b60c22b 100644
> --- a/arch/arm/mach-at91/board-sam9261ek.c
> +++ b/arch/arm/mach-at91/board-sam9261ek.c
> @@ -220,7 +220,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
> index 605b26f..9bbdc92 100644
> --- a/arch/arm/mach-at91/board-sam9263ek.c
> +++ b/arch/arm/mach-at91/board-sam9263ek.c
> @@ -221,7 +221,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
> index 7624cf0..1325a50 100644
> --- a/arch/arm/mach-at91/board-sam9g20ek.c
> +++ b/arch/arm/mach-at91/board-sam9g20ek.c
> @@ -198,7 +198,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
> index 063c95d..33eaa13 100644
> --- a/arch/arm/mach-at91/board-sam9m10g45ek.c
> +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
> @@ -178,7 +178,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
> index b855ee7..8f48660 100644
> --- a/arch/arm/mach-at91/include/mach/system_rev.h
> +++ b/arch/arm/mach-at91/include/mach/system_rev.h
> @@ -13,13 +13,13 @@
>   * the 16-31 bit are reserved for at91 generic information
>   *
>   * bit 31:
> - *	0 => nand 16 bit
> - *	1 => nand 8 bit
> + *	0 => nand 8 bit
> + *	1 => nand 16 bit
>   */
> -#define BOARD_HAVE_NAND_8BIT	(1 << 31)
> -static int inline board_have_nand_8bit(void)
> +#define BOARD_HAVE_NAND_16BIT	(1 << 31)
> +static inline int board_have_nand_16bit(void)
>  {
> -	return system_rev & BOARD_HAVE_NAND_8BIT;
> +	return system_rev & BOARD_HAVE_NAND_16BIT;
>  }
>  
>  #endif /* __ARCH_SYSTEM_REV_H__ */


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, patrice.vilchez@atmel.com
Subject: Re: [PATCH for 3.0] AT91: Change nand buswidth logic to match hardware default configuration
Date: Mon, 04 Jul 2011 11:37:01 +0200	[thread overview]
Message-ID: <4E1189BD.509@atmel.com> (raw)
In-Reply-To: <1309515924-22531-1-git-send-email-nicolas.ferre@atmel.com>

Le 01/07/2011 12:25, Nicolas Ferre :
> The recently modified nand buswitth configuration is not aligned with
> board reality: the double footprint on boards is always populated with 8bits
> buswidth nand flashes.
> So we have to consider that without particular configuration the 8bits
> buswidth is selected by default.
> Moreover, the previous logic was always using !board_have_nand_8bit(), we
> change it to a simpler: board_have_nand_16bit().
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Arnd,

Can you please handle this parch for 3.0-final as a bug fix through the
arm-soc.git tree?

You can queue it in addition of the pull request sent by
Jean-Christophe: "AT91: Fix pull requset".

Thanks, best regards,

> ---
>  arch/arm/mach-at91/board-cap9adk.c           |    2 +-
>  arch/arm/mach-at91/board-sam9260ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9261ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9263ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9g20ek.c         |    2 +-
>  arch/arm/mach-at91/board-sam9m10g45ek.c      |    2 +-
>  arch/arm/mach-at91/include/mach/system_rev.h |   10 +++++-----
>  7 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
> index 1904fdf..cdb65d4 100644
> --- a/arch/arm/mach-at91/board-cap9adk.c
> +++ b/arch/arm/mach-at91/board-cap9adk.c
> @@ -215,7 +215,7 @@ static void __init cap9adk_add_device_nand(void)
>  	csa = at91_sys_read(AT91_MATRIX_EBICSA);
>  	at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
>  
> -	cap9adk_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	cap9adk_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (cap9adk_nand_data.bus_width_16)
>  		cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
> index d600dc1..5c24074 100644
> --- a/arch/arm/mach-at91/board-sam9260ek.c
> +++ b/arch/arm/mach-at91/board-sam9260ek.c
> @@ -214,7 +214,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
> index f897f84..b60c22b 100644
> --- a/arch/arm/mach-at91/board-sam9261ek.c
> +++ b/arch/arm/mach-at91/board-sam9261ek.c
> @@ -220,7 +220,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
> index 605b26f..9bbdc92 100644
> --- a/arch/arm/mach-at91/board-sam9263ek.c
> +++ b/arch/arm/mach-at91/board-sam9263ek.c
> @@ -221,7 +221,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
> index 7624cf0..1325a50 100644
> --- a/arch/arm/mach-at91/board-sam9g20ek.c
> +++ b/arch/arm/mach-at91/board-sam9g20ek.c
> @@ -198,7 +198,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
> index 063c95d..33eaa13 100644
> --- a/arch/arm/mach-at91/board-sam9m10g45ek.c
> +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
> @@ -178,7 +178,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
>  
>  static void __init ek_add_device_nand(void)
>  {
> -	ek_nand_data.bus_width_16 = !board_have_nand_8bit();
> +	ek_nand_data.bus_width_16 = board_have_nand_16bit();
>  	/* setup bus-width (8 or 16) */
>  	if (ek_nand_data.bus_width_16)
>  		ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
> diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
> index b855ee7..8f48660 100644
> --- a/arch/arm/mach-at91/include/mach/system_rev.h
> +++ b/arch/arm/mach-at91/include/mach/system_rev.h
> @@ -13,13 +13,13 @@
>   * the 16-31 bit are reserved for at91 generic information
>   *
>   * bit 31:
> - *	0 => nand 16 bit
> - *	1 => nand 8 bit
> + *	0 => nand 8 bit
> + *	1 => nand 16 bit
>   */
> -#define BOARD_HAVE_NAND_8BIT	(1 << 31)
> -static int inline board_have_nand_8bit(void)
> +#define BOARD_HAVE_NAND_16BIT	(1 << 31)
> +static inline int board_have_nand_16bit(void)
>  {
> -	return system_rev & BOARD_HAVE_NAND_8BIT;
> +	return system_rev & BOARD_HAVE_NAND_16BIT;
>  }
>  
>  #endif /* __ARCH_SYSTEM_REV_H__ */


-- 
Nicolas Ferre


  reply	other threads:[~2011-07-04  9:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 10:25 [PATCH for 3.0] AT91: Change nand buswidth logic to match hardware default configuration Nicolas Ferre
2011-07-01 10:25 ` Nicolas Ferre
2011-07-04  9:37 ` Nicolas Ferre [this message]
2011-07-04  9:37   ` Nicolas Ferre
2011-07-04 14:25   ` Arnd Bergmann
2011-07-04 14:25     ` Arnd Bergmann
2011-07-04 14:41     ` Nicolas Ferre
2011-07-04 14:41       ` Nicolas Ferre
2011-07-04 15:13       ` Arnd Bergmann
2011-07-04 15:13         ` Arnd Bergmann
2011-07-04 15:17         ` Nicolas Ferre
2011-07-04 15:17           ` Nicolas Ferre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E1189BD.509@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.