linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: jbeisert@eurodsn.de
Cc: linux-mtd@lists.infradead.org
Subject: Re: Additional arguments to <struct nand_chip.hwcontrol> and .dev_ready functions
Date: Fri, 11 Jul 2003 16:13:45 +0100	[thread overview]
Message-ID: <1057936424.7949.41.camel@passion.cambridge.redhat.com> (raw)
In-Reply-To: <200307111649.26591.jbeisert@eurodsn.de>

On Fri, 2003-07-11 at 15:49, Juergen Beisert wrote:
> Hello all,
> 
> I have written a driver for my NAND flash chip application using the mtd 
> framework. It works fine when there is only one chip in one memory area 
> present.
> But if there are more than one NAND chip, you need more than one function for
>     struct nand_chip.hwcontrol,
> because this function don't know which chips control lines it should change.
> Same with
>     struct nand_chip.dev_ready.
> For which chip it should wait?
> 
> Is it possible to add arguments, like a pointer to the struct nand_chip, to 
> these functions? Then one of this function could handle more than one chip.

I've done some work on this in CVS in the last few days. 

For the case where you have two entirely separate NAND flash chips it's
simple enough -- all these functions now take a 'struct mtd_info *'
argument which is sufficient. See the new DiskOnChip driver for an
example of how it works. You can then use mtdconcat to combine two
entirely separate devices into a single logical MTD device, if you want.

In addition to that, I'm working on fixing the generic NAND code to
handle multiple identical chips connected up together, in what seems to
be the most common arrangement where you _share_ the hwcontrol lines but
individually assert each chip's CE line. 

I've done this by adding a chip-number argument to the select_chip()
function. Your board driver can store this chip number if appropriate,
so that in hwcontrol() or dev_ready() it can ensure it's talking to the
correct chip.

So far, nand_scan() takes an extra argument to tell it the maximum
number of chips to attempt to probe, and I have it finding all 9 chips
on my 144MiB DiskOnChip 2000. I've just committed that and I'm now going
through the actual access functions making them select the correct chip
according to the address, etc.

-- 
dwmw2

  reply	other threads:[~2003-07-11 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11 14:49 Additional arguments to <struct nand_chip.hwcontrol> and .dev_ready functions Juergen Beisert
2003-07-11 15:13 ` David Woodhouse [this message]
2003-07-11 15:47   ` Juergen Beisert

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=1057936424.7949.41.camel@passion.cambridge.redhat.com \
    --to=dwmw2@infradead.org \
    --cc=jbeisert@eurodsn.de \
    --cc=linux-mtd@lists.infradead.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 NNTP newsgroup(s).