All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@gmail.com>
To: Mitsutaka Amano <mitsutaka.amano@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: Question about CFI allocation
Date: Mon, 31 Jan 2011 15:23:29 -0500	[thread overview]
Message-ID: <AANLkTikAJ+NgaZ8-_WJSNZ=QJyh0qNM5WqPnem44D3Sw@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimkjy7KcO=QULXYubEPnrh4H1gPpYBL3yE7NDSy@mail.gmail.com>

On Mon, Jan 31, 2011 at 12:48 AM, Mitsutaka Amano
<mitsutaka.amano@gmail.com> wrote:
> On Wed, Jan 26, 2011 at 11:43 PM, Josh Boyer <jwboyer@gmail.com> wrote:
>> On Wed, Jan 26, 2011 at 6:09 AM, Mitsutaka Amano
>> <mitsutaka.amano@gmail.com> wrote:
>>> Hi all, I'm a newbie about mtd.
>>>
>>> I'm trying to use the cfi on the mpc85xx board. Part of mtdblock is
>>> used by rootfs. So I have questions.
>>>
>>> Why does CFI(or other flash memory) have to alloc to the vmalloc
>>> area(such as PHYSMAP or PHYSMAP_OF)?
>>
>> The CFI code is not calling vmalloc explicitly.  It's calling ioremap,
>> which happens to come from vmalloc space on most (all?) architectures.
>>  It has to do that because otherwise the CFI driver can't get access
>> to the physical flash because of the MMU.
> I understand that CFI needs ioremap() -> vmalloc space for accessing
> to the physical flash via MMU.
>
> Why allocate amount of flash memory size? my board has 256MB flash
> memory and be allocated 256MB over by of_flash_probe.

It's either do that so you can address the whole flash space, or
implement a sliding window in the mapping driver.  That can be rather
complicated when you consider concurrent access to the flash, and
doing repeated ioremap/iounmap calls so I would guess simplicity is
why.

That is mostly applicable for NOR flash directly accessible.  If there
is a controller in front of the flash that only needs a small area
ioremapped, then it shouldn't use physmap_of.c and should write a
proper driver for it.  The NDFC driver is an example of something like
that.

josh

  reply	other threads:[~2011-01-31 20:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 11:09 Question about CFI allocation Mitsutaka Amano
2011-01-26 14:43 ` Josh Boyer
2011-01-31  5:48   ` Mitsutaka Amano
2011-01-31 20:23     ` Josh Boyer [this message]
2011-02-03  2:50       ` Mitsutaka Amano

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='AANLkTikAJ+NgaZ8-_WJSNZ=QJyh0qNM5WqPnem44D3Sw@mail.gmail.com' \
    --to=jwboyer@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mitsutaka.amano@gmail.com \
    /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.