Re: [Yaffs] Problem with Yaffs on Routerboard RB112 and kern…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] Problem with Yaffs on Routerboard RB112 and kernel 2.6.19
On Friday 11 May 2007 01:08, David Goodenough wrote:
> On Wednesday 09 May 2007, Charles Manning wrote:
> > If you're getting ECC errors here it is possibly because the flash has
> > been written using yaffs_ecc.c and read (with nand_dump) using mtd's
> > nand_ecc.c
> >
> > nand_ecc.c generates exaclty the same data as yaffs_ecc.c, but the byte
> > ordering is different. Both implement the SmartMedia ECC mechanism, but
> > the byte order is broken in nand_ecc.c
>
> Reading this I thought that I would look at the config options for MTD.
> And sure enough there is one (that was not set) called
> CONFIG_MTD_NAND_ECC_SMC which was not set. So I tried setting it, but it
> does not seem to make any difference - I get the same problems.
>
> When I mount the partition, all the blocks are flaged as bad and when I use
> nanddump it complains about uncorrectable bitflips just as before.
>
> What change is needed to nand_ecc.c to get the byte order the same as
> yaffs_ecc.c. A brief look had them looking very similar, but of course I
> may have missed something.


In this case it does not make sense to try bend everything towards yaffs.

You need to bend towards the bootloader since that would appear to be the
thing that cannot change.

I see the latest nand_ecc.c now has CONFIG_NAND_ECC_SMC which will correct the
byte ordering. Alternatively yaffs_ecc.c can use CONFIG_YAFFS_ECC_WRONG_ORDER
to achieve the reverse (ie. "break" the SMC byte ordering and change it to
traditional MTD byte ordering)

However...... you obviously need to ensure that the bootloader, yaffs and the
mtd all use the same byte order (ie. it does not really matter if it is wrong
or not (according to the SMC spec), just so long as everyone tells the same
lies).

Apart than that, I don't have anything to add to what Ian has written. A
sprinking of prinks might help.

-- CHarles

>
> David
>
> > There are two solutions to this mess:
> > 1) Microtik should provide their driver configs under GPL.
> > 2) Trace through the data reading/writing to see where the OOB byte
> > ordering is getting screwed up.
>
> _______________________________________________
> yaffs mailing list
>
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs