[PATCH 5/7] atmel_nand: make chip_delay configurable

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Dec 9 08:30:01 EST 2013


On 10:36 Sat 07 Dec     , Eric B??nard wrote:
> this is usefull for custom boards with different NAND flashs
> (for informations u-boot defaults chip_delay to 75)
drop this comment on u-boot as in barebox we use the kernel driver
> 
> Signed-off-by: Eric Bénard <eric at eukrea.com>
> ---
>  arch/arm/mach-at91/include/mach/board.h | 1 +
>  drivers/mtd/nand/atmel_nand.c           | 5 ++++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
> index aa0fdae..4e6fa8b 100644
> --- a/arch/arm/mach-at91/include/mach/board.h
> +++ b/arch/arm/mach-at91/include/mach/board.h
> @@ -64,6 +64,7 @@ struct atmel_nand_data {
>  	u8		ecc_mode;	/* NAND_ECC_* */
>  	u8		on_flash_bbt;	/* Use flash based bbt */
>  	u8		bus_on_d0;
> +	int		chip_delay;
>  
>  	u8		pmecc_corr_cap;
>  	u16		pmecc_sector_size;
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index 658ae52..2ff7427 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -1161,7 +1161,10 @@ static int __init atmel_nand_probe(struct device_d *dev)
>  		nand_chip->ecc.mode = NAND_ECC_HW;
>  	}
>  
> -	nand_chip->chip_delay = 20;		/* 20us command delay time */
> +	if (host->board->chip_delay > 0)
> +		nand_chip->chip_delay = host->board->chip_delay;
> +	else
> +		nand_chip->chip_delay = 20;		/* 20us command delay time */
>  
>  	if (host->board->bus_width_16) {	/* 16-bit bus width */
>  		nand_chip->options |= NAND_BUSWIDTH_16;
> -- 
> 1.8.3.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



More information about the barebox mailing list