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: David Goodenough
Date:  
To: yaffs
Subject: Re: [Yaffs] Problem with Yaffs on Routerboard RB112 and kernel 2.6.19
On Friday 11 May 2007, wrote:
> On Friday 11 May 2007 04:46, David Goodenough wrote:
> > Do I read this correctly to say that there are no changes
> > needed to the MTD code in order to achieve this?  If so that
> > is great, otherwise I will go over to their list and campain
> > for whatever is needed.
>
> At a minimum, you would have to adjust the definition of
> struct nand_ecclayout nand_oob_16 in nand_base.c to get the
> ECC to match that used on the platform. You would also need
> to use the MTD_OOB_PLACE option in the calls to MTD from yaffs
> and then scatter/gather the tag bytes appropriately. Leaving the
> ECC bytes 0xff on writes and have MTD do ECC.

I will have a look at that code and see if I can understand how
to do that.
>
> If you are using a older version of mtd, one that uses nand_oobinfo
> on the read/write calls, you should be able to get some of the old
> code in Yaffs working. See the yaffs2 codebase file yaffs_mtdif.c,
> also see if CONFIG_YAFFS_USE_OLD_MTD is applicable.

I am using the newest version of mtd, I only need to be compatible with
the old version of mtd/yaffs "on flash".

BTW, in the svn code for Yaffs2 I can not find CONFIG_YAFFS_USE_OLD_MTD.
Any idea where it came from?
>
> Looking at our version of yaffs2 codebase's yaffs_mtdif.c
> we have running on an older 2.4.24 based product, we have:
>
> struct nand_oobinfo yaffs_oobinfo = {
>         useecc: MTD_NANDECC_PLACE,
>         eccbytes: 6,    // ++BSE: was missing, needed by mtd->read_ecc
> #ifdef CONFIG_BSE_USE_ORIG_YAFFS1_ECC_LAYOUT
>         // swap 1st and 2nd bytes of each of the 3 byte ECC groups to
>         // match original yaffs/smartmedia layout.
>         eccpos: {9, 8, 10, 14, 13, 15}
> #else
>         eccpos: {8, 9, 10, 13, 14, 15}
> #endif
> };

This looks like what I need. I will try this when I get a moment this
evening.
>
> With the older MTD api, the application (yaffs) cooperates with
> MTD when handling the oob/spare bytes -- you have to ensure that
> both Yaffs and MTD have the same layout. You control this
> using the struct nand_oobinfo passed of the calls to MTD, and/or
> with the default nand_oobinfo defined in the mtd's nand_base.c.
>
> Sorry to be non-specific, one needs to see the actual versions of
> source to be sure.

For the avoidance of doubt, what I need to do is to have the very latest
version of linux, with the very latest MTD and the very latest Yaffs
working in such a way that an original Yaffs1 piece of code (the RB112
Bootloader which I only have as a binary object - I can not change it)
can read.
>
> -imcd


David