Commit 64393b3a authored by Nicolas Ferre's avatar Nicolas Ferre Committed by Arnd Bergmann

AT91: Change nand buswidth logic to match hardware default configuration

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: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Tested-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent c5efefac
...@@ -215,7 +215,7 @@ static void __init cap9adk_add_device_nand(void) ...@@ -215,7 +215,7 @@ static void __init cap9adk_add_device_nand(void)
csa = at91_sys_read(AT91_MATRIX_EBICSA); csa = at91_sys_read(AT91_MATRIX_EBICSA);
at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); 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) */ /* setup bus-width (8 or 16) */
if (cap9adk_nand_data.bus_width_16) if (cap9adk_nand_data.bus_width_16)
cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16; cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16;
......
...@@ -214,7 +214,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { ...@@ -214,7 +214,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
static void __init ek_add_device_nand(void) 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) */ /* setup bus-width (8 or 16) */
if (ek_nand_data.bus_width_16) if (ek_nand_data.bus_width_16)
ek_nand_smc_config.mode |= AT91_SMC_DBW_16; ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
......
...@@ -220,7 +220,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { ...@@ -220,7 +220,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
static void __init ek_add_device_nand(void) 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) */ /* setup bus-width (8 or 16) */
if (ek_nand_data.bus_width_16) if (ek_nand_data.bus_width_16)
ek_nand_smc_config.mode |= AT91_SMC_DBW_16; ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
......
...@@ -221,7 +221,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { ...@@ -221,7 +221,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
static void __init ek_add_device_nand(void) 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) */ /* setup bus-width (8 or 16) */
if (ek_nand_data.bus_width_16) if (ek_nand_data.bus_width_16)
ek_nand_smc_config.mode |= AT91_SMC_DBW_16; ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
......
...@@ -198,7 +198,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { ...@@ -198,7 +198,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
static void __init ek_add_device_nand(void) 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) */ /* setup bus-width (8 or 16) */
if (ek_nand_data.bus_width_16) if (ek_nand_data.bus_width_16)
ek_nand_smc_config.mode |= AT91_SMC_DBW_16; ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
......
...@@ -178,7 +178,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = { ...@@ -178,7 +178,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
static void __init ek_add_device_nand(void) 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) */ /* setup bus-width (8 or 16) */
if (ek_nand_data.bus_width_16) if (ek_nand_data.bus_width_16)
ek_nand_smc_config.mode |= AT91_SMC_DBW_16; ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
* the 16-31 bit are reserved for at91 generic information * the 16-31 bit are reserved for at91 generic information
* *
* bit 31: * bit 31:
* 0 => nand 16 bit * 0 => nand 8 bit
* 1 => nand 8 bit * 1 => nand 16 bit
*/ */
#define BOARD_HAVE_NAND_8BIT (1 << 31) #define BOARD_HAVE_NAND_16BIT (1 << 31)
static int inline board_have_nand_8bit(void) 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__ */ #endif /* __ARCH_SYSTEM_REV_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment