[U-Boot] fw_setenv broken?

Steve Sakoman steve at sakoman.com
Fri Nov 19 06:09:25 CET 2010


On Thu, Nov 18, 2010 at 4:20 PM, Scott Wood <scottwood at freescale.com> wrote:
> On Thu, 18 Nov 2010 16:13:52 -0800
> Steve Sakoman <steve at sakoman.com> wrote:
>
>> The code generating both errors is in the nand_do_read_ops function in nand_base.c:
>>
>>        if (mtd->ecc_stats.failed - stats.failed)
>>                return -EBADMSG;
>>
>>        return  mtd->ecc_stats.corrected - stats.corrected ? -EUCLEAN : 0;
>> }
>>
>> I understand that the -EUCLEAN error indicates a correctable ECC error.  What does the -EBADMSG error indicate?
>
> An uncorrectable ECC error (or other failure).
>
>> This condition doesn't seem to bother the linux driver, but u-boot doesn't like it at all!
>
> Check whether the ECC layout and code is the same for this driver in
> both U-Boot and Linux.

Well, the mystery is solved.

The strange behavior was a combination of the -EUCLEAN issue in u-boot
and the following bizarre bug that crept into the Linux OMAP NAND
driver in 2.6.26:

http://article.gmane.org/gmane.linux.ports.arm.omap/46545

I will submit a patch to deal with the u-boot issue tomorrow, and it
seems that a fix is already queued for Linux 2.6.37.

Thanks to Scott Wood for helping with the -EUCLEAN issue and Scott
Ellis for noticing that what might be the same issue was being
discussed on both the u-boot and linux lists today.

Steve


More information about the U-Boot mailing list