mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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 <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> [scottwood@freescale.com: s/write the page/access the page/] Signed-off-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
parent
6d41419f0b
commit
fb3659ac42
2 changed files with 28 additions and 0 deletions
|
@ -598,6 +598,22 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
.mode = MTD_OOB_RAW
|
||||
};
|
||||
|
||||
if (read)
|
||||
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
|
||||
};
|
||||
|
||||
rwsize = nand->writesize + nand->oobsize;
|
||||
|
||||
if (read)
|
||||
ret = nand->read_oob(nand, off, &ops);
|
||||
else
|
||||
|
@ -695,6 +711,9 @@ U_BOOT_CMD(
|
|||
"nand write - addr off|partition size\n"
|
||||
" read/write 'size' bytes starting at offset 'off'\n"
|
||||
" to/from memory address 'addr', skipping bad blocks.\n"
|
||||
"nand read.raw - addr off|partition\n"
|
||||
"nand write.raw - addr off|partition\n"
|
||||
" Use read.raw/write.raw to avoid ECC and access the page as-is.\n"
|
||||
#ifdef CONFIG_CMD_NAND_TRIMFFS
|
||||
"nand write.trimffs - addr off|partition size\n"
|
||||
" write 'size' bytes starting at offset 'off' from memory address\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue