dfu, nand: before write a buffer to nand, erase the nand sectors

before writing the received buffer to nand, erase the nand
sectors. If not doing this, nand write fails. See for
more info here:

http://lists.denx.de/pipermail/u-boot/2013-June/156361.html

Using the nand erase option "spread", maybe overwrite
blocks on, for example another mtd partition, if the
erasing range contains bad blocks.
So a limit option is added to nand_erase_opts()

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
Heiko Schocher 2013-06-24 18:50:40 +02:00 committed by Scott Wood
parent 9b80aa8ec9
commit a67cc37e69
3 changed files with 22 additions and 2 deletions

View file

@ -125,6 +125,8 @@ struct nand_erase_options {
/* Don't include skipped bad blocks in size to be erased */
int spread;
/* maximum size that actual may be in order to not exceed the buf */
loff_t lim;
};
typedef struct nand_erase_options nand_erase_options_t;