[U-Boot] dfu, nand: writing on not empty nand partition

Tom Rini trini at ti.com
Thu Jun 13 14:33:55 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/13/2013 08:15 AM, Heiko Schocher wrote:
> Hello,
> 
> I just tried to write with "dfu" and dfu-util on the host to a not
> empty partiton on a nand flash. After the dfu returned without
> error, I wanted to read the nand partiton with "nand read" and I
> get ECC errors. This is on an am335x based board (mainline patches
> coming soon) with ECC BCH8 enabled...
[snip]
> Is this a bug or a feature?
> 
> If it is a bug, I fixed it as I added in my tree in 
> drivers/mtd/nand/nand_util.c a nand_erase_write_skip_bad() 
> function, which erases before writes to "off, length" ... and call
> this function in drivers/dfu/dfu_nand.c nand_block_op() instead
> nand_write_skip_bad() ... Is this a possible solution?

So yes, if you don't erase first, just like doing a nand write from
the command line, it will fail.  This is arguably a bug.  But, I would
go for making dfu_nand spell out a call to an existing erase function
since we know the size of the alt setting to be written to.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRubwzAAoJENk4IS6UOR1WceYP/RFobx5O0JXJ60d7BhvmjFhl
okzfkxu04Mh/qckehZntF+AjRP1lrZvs2b7I0xWd2BRn2dqjrS9ViqS0Hs9WQ2x8
enMGJGAq03+M3uNiSgZ9OjNbKb5eWm3XAhvqc6uUnWtcJAccMSJ0EHS1u95am6Pa
iaY98ofydIHZNO5nyJ7rMmPPLUG13ADTR3JZrFwro7rpxQAc64yIu7klzyD8BqhA
mJug5HdiUqXnkb9caTK8REVQ0hatp2Qpv3KZq2rgDbe0urRNpHxg3khCb+2j1duI
Ts85dcYQj824cbIipPxd3/8I50LrAe6pxO4aS3tSEX6bri+3R4PvTv+uo9g94dZJ
gAaLp9fdZDNSola9T1Ae5aG6eYjKVa6U7UfcAKKW5+GTG4wEuA1tzb0HUj+aMdST
FPL7Z8Fkd0np67H1HSDurzrMyOHi+yk+mfMvYsJLnbZGxvZ+3YTBynAxT5KSUDIs
fNsZRdh4hgr8Dg/DQ2tkJ35EjgWTjwQAwtWwC1rfC3aznWj/08H33vxsZrnwYUvz
hNV3VD/p6BGoPUOmtS0DN3QZeDeX3ur+Sv6l7dMIHKKeUOGHtrpAOtBiSJp2LxvE
6xQ0LyBSEleJuZ64jdMY2Lq8jnA5ZZgJt0f+Tg+qEQDHr56cZAhRQtyD6rEj3iiG
O+chE7ulvNQ89XSziDoo
=++kF
-----END PGP SIGNATURE-----


More information about the U-Boot mailing list