Ian McDonnell,
I get yaffs2 working without ECC tags ( struct (yaffs_ECCOther) ).
Now, yaffs2 only takes 12 bytes of Nand spare area, and our HWECC
has enough space to store 36 bytes of parity code. Thanks!
btw, I add a config in 'Kconfig' to choose if we want to ignore ECC tags.
And, how can I post a patch on the list? simply add the patch file in the
mail?
-He Yong
2007/7/3, Ian McDonnell <
ian@brightstareng.com>:
>
> He Yong,
>
> On Saturday 30 June 2007 02:24, He Yong wrote:
> > Hello,all
> > I'm using yaffs2 on Linux 2.6.20, our hardware supports
> > Reed-Solomon ECC Accelerator.
> > the HWECC generates 9-bytes of parity code for each 512 Bytes
> > of data. So , in a 2K page,
> > the ECC parity code will take 36 bytes, and there're only 28
> > bytes left for Yaffs2.
> > I found that yaffs2 need 32 bytes of Spare space, is that
> > possible yaffs2 use less than 32 bytes? or
> > I need to give up using HWECC...
>
> The Yaffs2 (large-page) tags format is not very economical. As
> far as I can tell the struct that holds the 'mini' ECC for the
> tags metadata could be reduced to just 3 bytes. The current
> struct (yaffs_ECCOther) has an unsigned char and two unsigned
> ints, which makes it 12 bytes on most architectures. The ECC
> code looks to be only use/need byte-sized quantities. See
> yaffs_packedtags2.h, yaffs_ecc.h, yaffs_ecc.c,
> yaffs_packedtags2.c.
>
> If you try it and get it working, please be sure to post a patch
> to the list.
>
> -imcd
>
--
Best Regards!
He Yong
School of Information Security,
Shanghai Jiaotong University,
Dong cuan Road #800,
Minhang, Shanghai, P.R.China
Index: Kconfig
===================================================================
--- Kconfig ???????????? 97???
+++ Kconfig ??????????????????
@@ -114,6 +114,22 @@
pagesize). When using small partitions or when being very small
on space, you probably want to set this to zero.
+config YAFFS_IGNORE_TAGS_ECC
+ bool "Yaffs2 ignore tags ECC"
+ depends on YAFFS_YAFFS2
+ default n
+ help
+ "Yaffs2 ignore tags ECC" will ignore ECC tags in yaffs_PackedTags2,
+ it is chosen when user have its own hardware ECC and do not want
+ yaffs2 to handle any ECC events.
+
+ If this option is chosen, yaffs2 only uses 12 bytes of Nand Flash
+ Spare Area given by 'oobfree' in 'struct nand_ecclayout'
+
+ Setting this to 'y' will ignore ECC tags.
+
+ If unsure, say N.
+
config YAFFS_DISABLE_WIDE_TNODES
bool "Turn off wide tnodes"
depends on YAFFS_FS
Index: yaffs_packedtags2.h
===================================================================
--- yaffs_packedtags2.h ???????????? 97???
+++ yaffs_packedtags2.h ??????????????????
@@ -30,7 +30,9 @@
typedef struct {
yaffs_PackedTags2TagsPart t;
- yaffs_ECCOther ecc;
+#ifndef YAFFS_IGNORE_TAGS_ECC
+ yaffs_ECCOther ecc;
+#endif
} yaffs_PackedTags2;
void yaffs_PackTags2(yaffs_PackedTags2 * pt, const yaffs_ExtendedTags * t);
Index: yaffs_ecc.h
===================================================================
--- yaffs_ecc.h ???????????? 97???
+++ yaffs_ecc.h ??????????????????
@@ -26,6 +26,10 @@
#ifndef __YAFFS_ECC_H__
#define __YAFFS_ECC_H__
+#ifdef CONFIG_YAFFS_IGNORE_TAGS_ECC
+#define YAFFS_IGNORE_TAGS_ECC
+#endif // CONFIG_YAFFS_IGNORE_TAGS_ECC
+
typedef struct {
unsigned char colParity;
unsigned lineParity;