From manningc2@actrix.gen.nz Tue Mar 09 20:01:33 2010
Received: from smtp.firstline.co.nz ([203.167.210.162] helo=scorch.co.nz)
	by stoneboat.aleph1.co.uk with smtp (Exim 4.69)
	(envelope-from <manningc2@actrix.gen.nz>) id 1Np5cN-0005B0-KA
	for yaffs@lists.aleph1.co.uk; Tue, 09 Mar 2010 20:01:33 +0000
Received: (qmail 21102 invoked by uid 453); 9 Mar 2010 20:01:20 -0000
X-Virus-Checked: Checked by ClamAV on scorch.co.nz
Received: from Unknown (HELO linux-dual-head.local) (10.14.210.25)
	by scorch.co.nz (qpsmtpd/0.40) with ESMTP;
	Wed, 10 Mar 2010 09:01:20 +1300
From: Charles Manning <manningc2@actrix.gen.nz>
To: yaffs@lists.aleph1.co.uk
Date: Wed, 10 Mar 2010 09:01:18 +1300
User-Agent: KMail/1.9.10
References: <a9db33d91003090129t43e7f97fr6e37350a93f609d4@mail.gmail.com>
	<4B9626C4.3080904@ecoscentric.com>
In-Reply-To: <4B9626C4.3080904@ecoscentric.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <201003100901.18160.manningc2@actrix.gen.nz>
X-SA-Exim-Connect-IP: 203.167.210.162
X-SA-Exim-Mail-From: manningc2@actrix.gen.nz
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	stoneboat.aleph1.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=4.5 tests=AWL,BAYES_00,SPF_NEUTRAL
	autolearn=no version=3.2.5
X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000)
X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk)
Subject: Re: [Yaffs] [YAFFS2] : some basic queries on YAFFS2
X-BeenThere: yaffs@lists.aleph1.co.uk
X-Mailman-Version: 2.1.11
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: Tue, 09 Mar 2010 20:01:33 -0000

Ross has done an excellent job answering questions. I'll just add a few more 
comments.
On Tuesday 09 March 2010 23:45:24 Ross Younger wrote:
> Saquib wrote:
> > (1) *YAFFS2 Direct Interface* : What is the use of this interface? Is it
> > mandatory when I use YAFFS2?
>
> YAFFS was originally developed as a filesystem module to be loaded into the
> Linux kernel and accessed indirectly via the standard filesystem calls. It
> has since been ported to other platforms including WinCE and eCos. The
> Direct interface is for use in a system when you have no filesystem
> interface, or do not want to use your platform's filesystem layer, which
> would likely only be relevant in very specialised environments.

As Ross says, the Yaffs Direct Interface wraps up the "core yaffs" so that the 
code can be used without any specialised OS glue layer. The Linux and eCOS 
ports do not use the Yaffs Direct Interface but instead the OS accesses yaffs 
via an OS-specific glue layer. In Linux this is yaffs_fs.c

WinCE yaffs actually is a further wrapper layer around Yaffs Direct Interface.

Most people using yaffs with other RTOSs use Yaffs Direct Interface.

Yaffs Direct Interface is also used for building test harnesses where yaffs is 
built into an application for easier debugging.

>
> > (2) *Garbage Collection and Wear-Levelling*: How do I test these things
> > are working?
>
> Set the yaffs_traceMask appropriately, run a stress test, collect the
> diagnostic output and analyse it to determine whether these features are
> operating correctly. The tracemask is a bitfield; its bits are named
> YAFFS_TRACE_* and are defined in yportenv.h.
>
> See also http://www.yaffs.net/yaffs-debugging
>
> > (3) *4K Page Size* : This chip supports 4K page size. Is there any
> > changes required in YAFFS2 source code for 4K support.
>
> I don't think so, provided the mtd (NAND chip) driver for your chip sets up
> the yaffs_DeviceStruct appropriately.

yaffs supports 4k pages with no changes. Indeed you could use 8k or 16k pages 
or even non power of 2 page sizes. One product uses 6k pages (3x2048-byte 
NAND chips in parallel)

>
> > (4) *Multiplane Programming* : The newer chip we are planning to use is
> > multiplane NAND chip. How does YAFFS2 support Multiplane chip?
>
> YAFFS2 is known to support MLC parts. Others are better placed to comment
> here, but I think it's largely transparent and would depend on having a
> good mtd driver which uses the right ECC algorithm. You may need to look
> carefully at the chip spec sheet to see whether a more complicated ECC
> algorithm is required for the ECC YAFFS calculates internally on the tags
> it stores in the spare area of each page.

YAFFS does not provide specific multi-plane support but only accesses one page 
at a time.

One way to handle this is to do a single-to-multi-page translation in your 
driver. That could buffer up page writes until there are enough to do a 
multi-plane write or something similar.

-- Charles





