On 25/09/13 06:23, Pekon Gupta wrote: > NAND driver needs to know bus-width of the connected NAND device, in order to > perform proper I/O and initialize itself. Currently there is no CONFIG option > to provide this information to NAND driver. > - SPL NAND driver does not have framework to parse ONFI parameter page. > - NAND drivers which cannot self initialize > !defined(CONFIG_SYS_NAND_SELF_INIT) > do not have any information about device bus-width during board_nand_init(), > So, any device-width specific configurations are not possible there. > - There should be some mechanism to pass device bus-width information for > non-ONFI compliant devices. > > This patch > (1) adds CONFIG_SYS_NAND_DEVICE_WIDTH which can take following value > 16: NAND device with x16 bus-width > 8: NAND device with x8 bus-width > (2) removes GPMC_NAND_ECC_LP_x16_LAYOUT, as NAND layout is determined based on > ecc-scheme and oobsize during initialization in board_nand_init(). Thus > this config is redundant. > > Signed-off-by: Pekon Gupta <pe...@ti.com>
<snip> > diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h > index 978bca7..c92cb2f 100644 > --- a/include/configs/am335x_evm.h > +++ b/include/configs/am335x_evm.h > @@ -216,6 +216,7 @@ > > #ifdef CONFIG_NAND > #define CONFIG_SYS_NAND_5_ADDR_CYCLE > +#define CONFIG_SYS_NAND_DEVICE_WIDTH 8 This new setting ... > #define CONFIG_SYS_NAND_BLOCK_SIZE 131072 > #define CONFIG_SYS_NAND_PAGE_SIZE 2048 > #define CONFIG_SYS_NAND_OOBSIZE 64 > @@ -366,7 +367,6 @@ > /* NAND support */ > #ifdef CONFIG_NAND > #define CONFIG_CMD_NAND > -#define GPMC_NAND_ECC_LP_x16_LAYOUT 1 ... does *not* match with what you're taking out here !! > #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT) > #define MTDIDS_DEFAULT "nand0=omap2-nand.0" > #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \ > diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h > index 1fd2508..0985221 100644 > --- a/include/configs/am3517_crane.h > +++ b/include/configs/am3517_crane.h > @@ -269,7 +269,6 @@ > #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE > > #define CONFIG_NAND_OMAP_GPMC > -#define GPMC_NAND_ECC_LP_x16_LAYOUT 1 Same here ... > #define CONFIG_ENV_IS_IN_NAND 1 > #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */ > > @@ -332,6 +331,7 @@ > > /* NAND boot config */ > #define CONFIG_SYS_NAND_5_ADDR_CYCLE > +#define CONFIG_SYS_NAND_DEVICE_WIDTH 8 ... !! > #define CONFIG_SYS_NAND_PAGE_COUNT 64 > #define CONFIG_SYS_NAND_PAGE_SIZE 2048 > #define CONFIG_SYS_NAND_OOBSIZE 64 > diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h > index 6500878..8593d44 100644 > --- a/include/configs/am3517_evm.h > +++ b/include/configs/am3517_evm.h > @@ -263,7 +263,6 @@ > #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE > > #define CONFIG_NAND_OMAP_GPMC > -#define GPMC_NAND_ECC_LP_x16_LAYOUT 1 Again ... > #define CONFIG_ENV_IS_IN_NAND 1 > #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */ > > @@ -326,6 +325,7 @@ > > /* NAND boot config */ > #define CONFIG_SYS_NAND_5_ADDR_CYCLE > +#define CONFIG_SYS_NAND_DEVICE_WIDTH 8 ... !! > #define CONFIG_SYS_NAND_PAGE_COUNT 64 > #define CONFIG_SYS_NAND_PAGE_SIZE 2048 > #define CONFIG_SYS_NAND_OOBSIZE 64 > diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h > index bc5b66c..1e3dd0d 100644 > --- a/include/configs/cm_t35.h > +++ b/include/configs/cm_t35.h > @@ -164,8 +164,6 @@ > #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */ > /* to access nand at */ > /* CS0 */ > -#define GPMC_NAND_ECC_LP_x8_LAYOUT > - And here you don't specify the new setting at all. > #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ > /* devices */ > /* Environment information */ <snip> There's several other instances of the same issue through the whole patch. Mark J. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot