[U-Boot] U-boot nand bug, read.part should fail

Harvey Chapman hchapman-uboot at 3gfp.com
Thu Feb 7 23:13:55 CET 2013


[ I started this conversation off-list before I joined the list. ]

The idea is to add .part as a valid command suffix to nand read/write so it would match nand erase.part. The code to implement it makes "nand read.part" act identically to "nand read".

On Feb 7, 2013, at 4:59 PM, Scott Wood <scottwood at freescale.com> wrote:

>> >> In fact, I think erase should be modified to deprecate erase.part and make erase work like read does now.
>> >
>> > Erase used to work like read does.  I deliberately changed it so that typos (e.g. "nand erase $partition $fliesize") don't end up erasing your entire partition or chip.
>> Ah, then maybe we should add .part to nand read for consistency? I'm ok either way.
> 
> That would get messy because it would be orthogonal to other suffixes.  Reading too much is not as harmful as

Nothing would change other than do_nand() would treat "nand read" and "nand read.part" identically.

> erasing too much.  Writing too much can be bad, though.  Perhaps we should just eliminate the ability to do reads/writes without explicit size (it already has problems with the size needing adjustment due to bad blocks).

I liked that I didn't have to specify the size. Converting from numbers to partition names led me to find the bug in the "nand read" code. Using partition names makes it much easier to work with u-boot since I don't have to count 0s every time I type an address or size.



More information about the U-Boot mailing list