[U-Boot] [PATCH 2/5] NAND: Add nand read.raw and write.raw commands
Scott Wood
scottwood at freescale.com
Wed Sep 21 20:48:42 CEST 2011
On 09/11/2011 11:04 PM, Marek Vasut wrote:
> These commands should work around various "hardware" ECC and BCH methods.
>
> 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 | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index 66e06a5..a1c8dfd 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -606,6 +606,20 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
> ret = nand->read_oob(nand, off, &ops);
> else
> ret = nand->write_oob(nand, off, &ops);
> + } else if (!strcmp(s, ".raw")) {
> + /* Raw access */
> + mtd_oob_ops_t ops = {
> + .datbuf = (u8 *)addr,
> + .oobbuf = ((u8 *)addr) + nand->writesize,
> + .len = nand->writesize,
> + .ooblen = nand->oobsize,
> + .mode = MTD_OOB_RAW
> + };
> +
> + if (read)
> + ret = nand->read_oob(nand, off, &ops);
> + else
> + ret = nand->write_oob(nand, off, &ops);
> } else {
> printf("Unknown nand command suffix '%s'.\n", s);
> return 1;
Update help text and doc/README.nand.
Should we support doing multiple pages at once?
-Scott
More information about the U-Boot
mailing list