[U-Boot] [PATCH 4/5 V2] NAND: Make page, erase, oob size available via cmd_nand

Scott Wood scottwood at freescale.com
Tue Sep 27 23:14:27 CEST 2011


On Thu, Sep 22, 2011 at 03:57:26AM +0200, Marek Vasut wrote:
> The "nand info" and "nand device" now set shell/environment variables:
> 	nand_writesize ... nand page size
> 	nand_oobsize ..... nand oob area size
> 	nand_erasesize ... nand erase block size
> 
> Also, the "nand info" command now displays this info.
> 
> Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
> Cc: Scott Wood <scottwood at freescale.com>
> Cc: Stefano Babic <sbabic at denx.de>
> Cc: Wolfgang Denk <wd at denx.de>
> Cc: Detlev Zundel <dzu at denx.de>
> ---
>  common/cmd_nand.c |   25 ++++++++++++++++++++++---
>  1 files changed, 22 insertions(+), 3 deletions(-)
> 

Applied to u-boot-nand-flash next

> +	/* Set geometry info */
> +	memset(buf, 0, bufsz);
> +	sprintf(buf, "%x", nand->writesize);
> +	setenv("nand_writesize", buf);
> +
> +	memset(buf, 0, bufsz);
> +	sprintf(buf, "%x", nand->oobsize);
> +	setenv("nand_oobsize", buf);
> +
> +	memset(buf, 0, bufsz);
> +	sprintf(buf, "%x", nand->erasesize);
> +	setenv("nand_erasesize", buf);

...with memsets removed.

-Scott



More information about the U-Boot mailing list