All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Dunn <mikedunn@newsguy.com>
To: Angus CLARK <angus.clark@st.com>
Cc: robert.jarzmik@free.fr, linux-mtd@lists.infradead.org
Subject: Re: nand_base.c:nand_get_flash_type() test results
Date: Tue, 18 Oct 2011 07:05:59 -0700	[thread overview]
Message-ID: <4E9D87C7.9070502@newsguy.com> (raw)
In-Reply-To: <4E9D3196.9070104@st.com>

Hi Angus.  Thanks for taking a look and commenting.

On 10/18/2011 12:58 AM, Angus CLARK wrote:
> On 10/16/2011 03:33 PM, Mike Dunn wrote:
>> I am currently grappling with this issue with my driver for the diskonchip G4,
>> which is an MLC nand under the hood, but has a proprietary controller around it
>> which doesn't interact as a "typical" NAND device.  Specific to this topic, it
>> doesn't respond to NAND_READID commands.  My solution was to skip the call to
>> nand_scan_ident(), which calls nand_get_flash_type().  Instead, I do all the
>> initializations done by nand_get_flash_type() within my driver. 
>>
>> Any thoughts or suggestions appreciated.
>>
> I am not familiar with the diskonchip technology but I had a quick look through
> the patch you posted a few days ago.  What you have done regarding
> nand_scan_ident() is probably the most sensible solution here - I believe it was
> this kind of use-case that led to nand_scan() being split into nand_scan_ident()
> and nand_scan_tail().


My guess as well.  The only problem is that, oddly, nand_scan_ident() calls
nand_set_defaults().  So by skipping the cal to nand_scan_ident(), the various
defaut nand methods are not set.  Fortunately, I need to override most of them
anyway, but I did need to duplicate a couple trivial ones in my driver, since
they're not exported from nand_base.c


> An alternative approach would be to fake support for NAND_CMD_READID, similar to
> what you have done for NAND_CMD_STATUS, with subsequent calls to
> chip->read_byte() returning the 'DOCG4_IDREG' sequence {0x04, 0x00, 0xfb, 0xff}.
>  In the same way ONFI devices are handled, you could then add a special case in
> nand_get_flash_type(), say nand_flash_detect_docg4(), jumping to 'ident_done' if
> successful.


I did it this way originally.  But this method requires serving up an arbitrary
unused ID and patching nand_ids.c with a new entry for the arbitrary ID
containing the docg4 parameters.  It was so ugly, I went with the alternate method.


> To be honest, in this case, I don't think there is much to be gained by adding
> 'nand_flash_detect_docg4()' to the generic code.  It would just return some
> hard-coded parameters to serve a single device and driver; you may as well put
> them in the driver itself, as you have done.  On the other hand, if you extend
> it to also handle the other diskonchip varients, that might be more interesting.


Thaks for the suggestion.  Something to keep in mind; Robert Jarzmik is working
on a driver for the diskonchip G3 (which may also support the P3).


Thanks again,
Mike

      reply	other threads:[~2011-10-18 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 15:26 nand_base.c:nand_get_flash_type() test results Angus CLARK
2011-10-14 13:57 ` Artem Bityutskiy
2011-10-14 15:14   ` Angus CLARK
2011-10-16 12:03     ` Artem Bityutskiy
2011-10-16 14:33 ` Mike Dunn
2011-10-18  7:58   ` Angus CLARK
2011-10-18 14:05     ` Mike Dunn [this message]

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=4E9D87C7.9070502@newsguy.com \
    --to=mikedunn@newsguy.com \
    --cc=angus.clark@st.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=robert.jarzmik@free.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.