public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: Simon Kallweit <simon.kallweit@intefo.ch>
To: "ecos-devel@ecos.sourceware.org" <ecos-devel@ecos.sourceware.org>
Subject: NAND review
Date: Tue, 19 May 2009 08:27:00 -0000	[thread overview]
Message-ID: <4A126D59.7070404@intefo.ch> (raw)

Hi there

I took a quick look at the NAND code released by Ross. I'll just give 
you my thoughts in no particular order:

* Ross's code uses the directory 'io/nand' for the NAND framework and 
adds the NAND flash device drivers in 'devs/nand'. This is contrary to 
what was discussed on the mailing list a few months ago:

http://ecos.sourceware.org/ml/ecos-discuss/2008-09/msg00172.html

I still think that the naming scheme by Ross (and what Rutger originally 
intended to do) is the better approach. Because when we mix the flash 
chip drivers for NOR and NAND chips in one directory (devs/flash) it's 
rather easy to get confused. For example we would get something like 
synth, synth_v2 and synth_nand all in the same directory. Or we would 
have to move that to synth/v1 synth/v2 synth/nand or something. Anyway I 
would suggest we leave the flash v1/v2 stuff alone and add a new devs 
directory 'nand' for the NAND stuff.

* Ross added very primitive support for partitions. Each partition is 
defined by a first and a last block. Reading/writing pages and erasing 
sectors is always done in the context of a partition. BUT the page and 
block addresses are still absolute addresses to the flash chip base, not 
relative to the given partition. This is slightly confusing and I wonder 
if the better approach would be to change this to relative addresses. 
Absolute addresses could still be used in the absence of a partition (NULL).

I also wonder if the current approach for initializing the partition 
table is wise. Currently the flash device driver uses a macro 
NAND_DEV_PARTITION_INIT to call a potential function defined the HAL 
platform to initialize the partition table. This is flexible but we will 
have a lot of code duplication in HAL platforms if the partition table 
is going to be defined via CDL options. Couldn't this be implemented in 
a more generic fashion?

* Ross's code is not layered as heavily as Rutgers code. Rutger has a 
clear interface between the application, the NAND flash controller and 
the NAND flash chips. In Ross's code this is all much more loosly 
coupled. Both approaches have their pros and cons but I would like to 
discuss Ross's approach here. The interface between the common NAND code 
and the flash devices is very high-level (initialization, 
reading/writing pages, erasing blocks, checking factory bad blocks). 
This makes for example the implementation of a synthetic NAND device 
very, very easy. I see some issues with the interface between the NAND 
chip driver and the NAND flash controller. In the current design the 
NAND flash controller is implemented in the HAL platform. The interface 
between the chip driver and the controller is defined in the chip driver 
itself (it just calls to a few functions which the platforms needs to 
implement). Is it intended that future drivers use the same interface or 
are drivers free to define their own? I think a common interface should 
be used for simplicity, and this should probably be defined in a more 
rigid manner. I also wonder if the NAND flash controller functionality 
belongs to the platform. In my opinion this should go to the HAL variant 
instead. What should remain in the platform is the initialization of the 
flash controller as well as the definition of the flash chips used.

* The current code does not read the flash chip timings from the chip 
signature. The timings are hardcoded into the driver. This might or 
might not be the best approach. Again, when adding a generic interface 
between the chip driver and the controller, these timings could be used 
to setup the controller (as some NAND flash controllers can take core of 
these timings). Some of the timings don't belong into the driver but 
into the controller I think, but I didn't look at it in detail.

* The current synth driver is rather limited in its configurability. It 
does not yet support small page flash chips for example. This should be 
improved but I think that's pretty easy to do.

Well these are my first thoughts on the prereleased code. I hope more 
people take a look at it and we can have a discussion and soon decide 
which NAND framework we're going to use.

Simon

             reply	other threads:[~2009-05-19  8:27 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19  8:27 Simon Kallweit [this message]
2009-05-19 13:47 ` Ross Younger
2009-05-19 14:17   ` Andrew Lunn
2009-05-20 13:24     ` Bart Veer
2009-05-20 13:34       ` Rutger Hofman
2009-05-20 13:53         ` Andrew Lunn
2009-05-20 13:56           ` Gary Thomas
2009-05-20 14:22             ` Andrew Lunn
2009-05-20 15:22               ` Andrew Lunn
2009-05-20 15:34               ` Bart Veer
2009-05-20 13:58           ` Rutger Hofman
2009-05-20 14:16     ` Ross Younger
2009-05-20 14:21       ` Gary Thomas
2009-05-20 15:25         ` Ross Younger
2009-05-20 15:37           ` Gary Thomas
2009-05-19 16:29 ` Andrew Lunn
2009-06-03  8:51   ` Andrew Lunn
2009-06-03 10:21     ` Ross Younger
2009-06-03 10:48       ` Andrew Lunn
2009-06-03 11:52         ` Simon Kallweit
2009-06-03 12:26         ` Rutger Hofman
2009-06-03 13:33     ` Jürgen Lambrecht
2009-06-10 17:39     ` Nick Garnett
2009-06-11 11:25       ` Rutger Hofman
2009-06-13 16:31       ` Andrew Lunn
2009-06-18 14:10         ` Nick Garnett
2009-06-19  7:47           ` Andrew Lunn
2009-06-19 14:14             ` Ross Younger
2009-06-19 15:02               ` Andrew Lunn
2009-06-19 16:54               ` Jürgen Lambrecht
2009-06-29 11:09             ` Nick Garnett
2009-06-19  8:07           ` Andrew Lunn
2009-06-19 11:37             ` Daniel Morris
2009-06-19 12:06               ` Andrew Lunn
2009-05-20  1:02 ` Jonathan Larmour
2009-05-20  7:11   ` Simon Kallweit
2009-05-20 11:12     ` Rutger Hofman
2009-05-20 11:29       ` Simon Kallweit
2009-05-20 13:37         ` Rutger Hofman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A126D59.7070404@intefo.ch \
    --to=simon.kallweit@intefo.ch \
    --cc=ecos-devel@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).