All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Dunn <mikedunn@newsguy.com>
To: linux-mtd@lists.infradead.org
Subject: Re: Implementing NAND driver on a PrimeCell SMC PL350 series
Date: Mon, 14 Jan 2013 09:57:26 -0800	[thread overview]
Message-ID: <50F44706.1010206@newsguy.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1301111155250.13078@lnxricardw.se.axis.com>

On 01/11/2013 03:02 AM, Ricard Wanderlof wrote:
> 
> On Fri, 11 Jan 2013, Daniel Tang wrote:
> 
>> I'm trying to write a NAND driver for the PL350 memory controller.
>>
>> The problem is that the memory controller abstracts quite a lot of the
>> processes needed to access the NAND. For example, the controller handles all
>> the hardware controlling (like dealing with the CLE and ALE lines). This makes
>> it difficult to write a driver that integrates cleanly with the current NAND
>> subsystem of the kernel.
>>
>> The issue specifically is the cmd_ctrl function that my driver needs to
>> provide. When the kernel needs to write a command and address, it calls the
>> function multiple times to write all the information. E.g. set CLE, write
>> command, set ALE, then write one byte of the page address at a time. The
>> controller, on the other hand, needs all that information to be in a single
>> write to the controller. It does this by embedding the command into the
>> address and have the data value be the page address.
> 
> Have you looked among the existing NAND controller drivers in drivers/mtd/nand
> to see if there's another driver which has similar requirements which you could
> use as a starting point? It's not unusual for NAND controllers to do some of the
> operations automatically, and the mtd framework supports this by letting you
> replace higher-level functions with functions from the driver, and not just the
> low-level functions such as hwcontrol and read_byte.


You might find it helpful to take a look at docg4.c in particular.  This device
is a nand wrapped in a proprietary controller, which sounds similiar to your
hardware.  This device does not have control of low-level lines either.

Hope this helps,
Mike

      parent reply	other threads:[~2013-01-14 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11  5:49 Implementing NAND driver on a PrimeCell SMC PL350 series Daniel Tang
2013-01-11 11:02 ` Ricard Wanderlof
2013-01-12 10:01   ` Daniel Tang
2013-01-12 11:19     ` Ricard Wanderlof
2013-01-13 12:57       ` alessandro.maro
2013-01-14 17:57   ` 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=50F44706.1010206@newsguy.com \
    --to=mikedunn@newsguy.com \
    --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 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.