Re: [U-Boot] [PATCH 2/5] NAND: Add nand read.raw and write.raw commands
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 > Cc: Scott Wood > Cc: Stefano Babic > Cc: Wolfgang Denk > Cc: Detlev Zundel > --- > 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/5] NAND: Add nand read.raw and write.raw commands
These commands should work around various "hardware" ECC and BCH methods. Signed-off-by: Marek Vasut Cc: Scott Wood Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- 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; -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/5] NAND: Add nand read.raw and write.raw commands
These commands should work around various "hardware" ECC and BCH methods. Signed-off-by: Marek Vasut Cc: Scott Wood Cc: Stefano Babic Cc: Wolfgang Denk Cc: Detlev Zundel --- 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; -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot