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

Scott Wood
2011-09-27T21:14:27Z

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@gmail.com>
> Cc: Scott Wood <scottwood@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Detlev Zundel <dzu@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