From manningc2@actrix.gen.nz Wed Mar 28 20:51:37 2012
Received: from smtp.scorch.co.nz ([27.110.127.199] helo=scorch.co.nz)
	by stoneboat.aleph1.co.uk with smtp (Exim 4.72)
	(envelope-from <manningc2@actrix.gen.nz>) id 1SCyu4-0004mB-F8
	for yaffs@lists.aleph1.co.uk; Wed, 28 Mar 2012 20:51:37 +0100
Received: (qmail 31770 invoked by uid 453); 28 Mar 2012 19:51:25 -0000
X-Virus-Checked: Checked by ClamAV on scorch.co.nz
Received: from ptr157.scorch.co.nz (HELO linux-dual-head.local)
	(27.110.120.157) by scorch.co.nz (qpsmtpd/0.83) with ESMTP;
	Thu, 29 Mar 2012 08:51:17 +1300
From: Charles Manning <manningc2@actrix.gen.nz>
To: yaffs@lists.aleph1.co.uk
Date: Thu, 29 Mar 2012 08:50:59 +1300
User-Agent: KMail/1.9.10
References: <mailman.1.1332331204.10815.yaffs@lists.aleph1.co.uk>
	<201203261657.53288.manningc2@actrix.gen.nz>
	<9781D801B504774F8D965F0FC4F8A044366D0E50@CNSHJMBX04.ad4.ad.alcatel.com>
In-Reply-To: <9781D801B504774F8D965F0FC4F8A044366D0E50@CNSHJMBX04.ad4.ad.alcatel.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Message-Id: <201203290850.59354.manningc2@actrix.gen.nz>
X-SA-Exim-Connect-IP: 27.110.127.199
X-SA-Exim-Mail-From: manningc2@actrix.gen.nz
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	stoneboat.aleph1.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=4.5 tests=AWL,BAYES_00,SPF_NEUTRAL
	autolearn=no version=3.3.1
X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000)
X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk)
Cc: BI Mingliang <Mingliang.Bi@alcatel-sbell.com.cn>
Subject: Re: [Yaffs] mkyaffs2image generate wrong image Failed to execute
	/linuxrc. Attempting defaults...
X-BeenThere: yaffs@lists.aleph1.co.uk
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Discussion of YAFFS NAND flash filesystem <yaffs.lists.aleph1.co.uk>
List-Unsubscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/options/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=unsubscribe>
List-Archive: <http://lists.aleph1.co.uk/lurker/list/yaffs.html>
List-Post: <mailto:yaffs@lists.aleph1.co.uk>
List-Help: <mailto:yaffs-request@lists.aleph1.co.uk?subject=help>
List-Subscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=subscribe>
X-List-Received-Date: Wed, 28 Mar 2012 19:51:37 -0000

It also depends on how you write the flash too. If you write raw then you w=
ill=20
get different results than if you write the data using ECC.

The best way to do this is to go through your process and look at the data =
as=20
it flows through each layer.

=2D- Charles

On Thursday 29 March 2012 02:42:15 BI Mingliang wrote:
> Hello Charles,
> You said "Thus, you will need to take the mkyaffs2image code and fiddle
> with it to get the layout you need."
> We can find the default 64bytes layout in kernel code:
> drivers/mtd/nand/nand_base.c static struct nand_ecclayout nand_oob_64 =3D=
 {
>         .eccbytes =3D 24,
>         .eccpos =3D {
>                    40, 41, 42, 43, 44, 45, 46, 47,
>                    48, 49, 50, 51, 52, 53, 54, 55,
>                    56, 57, 58, 59, 60, 61, 62, 63},
>         .oobfree =3D {
>                 {.offset =3D 2,
>                  .length =3D 38} }
> };
> It means there are 38 bytes yaffs tags and 24 bytes ecc information need =
to
> be filled. So function "write_chunk" needs some modification in
> mkyaffs2image.c, then I got a new mkyaffs2image tool to generate a new
> yaffs2 image. But the problem still exist. Could you help me ? Thank you
> very much ...
> //after shuffle_oob
>         /* calculate the 24 bytes ecc */
>         yaffs_calc_ecc(data, &yaffs_spare);
>         spareData[40] =3D yaffs_spare.ecc1[0];
>         spareData[41] =3D yaffs_spare.ecc1[1];
>         spareData[42] =3D yaffs_spare.ecc1[2];
>         spareData[43] =3D yaffs_spare.ecc2[0];
>         spareData[44] =3D yaffs_spare.ecc2[1];
>         spareData[45] =3D yaffs_spare.ecc2[2];
>
>         yaffs_calc_ecc(data+512, &yaffs_spare);
>         spareData[46] =3D yaffs_spare.ecc1[0];
>         spareData[47] =3D yaffs_spare.ecc1[1];
>         spareData[48] =3D yaffs_spare.ecc1[2];
>         spareData[49] =3D yaffs_spare.ecc2[0];
>         spareData[50] =3D yaffs_spare.ecc2[1];
>         spareData[51] =3D yaffs_spare.ecc2[2];
>
>         yaffs_calc_ecc(data+1024, &yaffs_spare);
>         spareData[52] =3D yaffs_spare.ecc1[0];
>         spareData[53] =3D yaffs_spare.ecc1[1];
>         spareData[54] =3D yaffs_spare.ecc1[2];
>         spareData[55] =3D yaffs_spare.ecc2[0];
>         spareData[56] =3D yaffs_spare.ecc2[1];
>         spareData[57] =3D yaffs_spare.ecc2[2];
>
>         yaffs_calc_ecc(data+1536, &yaffs_spare);
>         spareData[58] =3D yaffs_spare.ecc1[0];
>         spareData[59] =3D yaffs_spare.ecc1[1];
>         spareData[60] =3D yaffs_spare.ecc1[2];
>         spareData[61] =3D yaffs_spare.ecc2[0];
>         spareData[62] =3D yaffs_spare.ecc2[1];
>         spareData[63] =3D yaffs_spare.ecc2[2];
> Best Regards,
> Bi Mingliang (EXT:2783-7314)
>
>
> -----Original Message-----
> From: Charles Manning [mailto:manningc2@actrix.gen.nz]
> Sent: 2012=E5=B9=B43=E6=9C=8826=E6=97=A5 11:58
> To: yaffs@lists.aleph1.co.uk
> Cc: BI Mingliang
> Subject: Re: [Yaffs] mkyaffs2image generate wrong image Failed to execute
> /linuxrc. Attempting defaults...
>
> On Saturday 24 March 2012 21:37:23 BI Mingliang wrote:
> > Hello All,
> >
> > It's really disappointing that we can't get a quick response in yaffs
> > mail group. This issue blocked me several weeks and we can't find any
> > update in yaffs repository. What's more, many developers think there is
> > something wrong in the mkyaffs2image. Usually, during linux booting, we
> > get the following warning which is related with this tool.
>
> The mkyaffs2image tool does not generate useful images for all flash
> drivers mainly because of different OOB layouts.
>
> Thus, you will need to take the mkyaffs2image code and fiddle with it to
> get the layout you need.
>
> I am in the process of redoing the tools to try to make this easier to us=
e,
> but unfortunately I have not had much time to work on that recently.
>
> > For example:
> >
> > s3c-rtc s3c2410-rtc: setting system clock to 2000-01-01 02:27:02 UTC
> > (946693622) yaffs: dev is 32505858 name is "mtdblock2" rw
> > yaffs: passed flags ""
> > VFS: Mounted root (yaffs2 filesystem) on device 31:2.
> > Freeing init memory: 136K
> > Failed to execute /linuxrc.  Attempting defaults...
> > Kernel panic - not syncing: No init found.  Try passing init=3D option =
to
> > kernel. See Linux
> >
> > Documentation/init.txt for guidance.
> > [<c0019960>] (unwind_backtrace+0x0/0xf0) from [<c03344e8>]
> > (panic+0x58/0x18c) [<c03344e8>] (panic+0x58/0x18c) from [<c00085c4>]
> > (init_post+0x7c/0xcc) [<c00085c4>] (init_post+0x7c/0xcc) from
> > [<c0452838>] (kernel_init+0xe4/0x114)
> >
> >
> > Then I trace the error information in fs/exec.c, in function
> > do_execve_common, there is wrong file ponter(IS_ERR). In NFS mode, I
> > mount the yaffs2 block to mnt directory, and there is only lost+found
> > folders, all other folders can't displayed. So, it's quite possible that
> > this tool generate a wrong yaffs2 image in the former version. And the
> > latest version can' compile.
> >
> > Could anyone help me? Sometime I want abandon the yaffs FS, because UBI=
=46S
> > works very well every time. We need to do too much work to make the
> > latest yaffs work well in the latest linux kernel.
> > -----------------------------------------------------------------------=
=2D-
> >-- ------- 1448 static int do_execve_common(const char *filename,
> > 1449                 struct user_arg_ptr argv,
> > 1450                 struct user_arg_ptr envp,
> > 1451                 struct pt_regs *regs)
> >
> >
> > 1495     file =3D open_exec(filename);
> > 1496     retval =3D PTR_ERR(file);
> > 1497     if (IS_ERR(file))
> > 1498         goto out_unmark;
>
> _______________________________________________
> yaffs mailing list
> yaffs@lists.aleph1.co.uk
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs



