Question about CFI allocation

Mitsutaka Amano mitsutaka.amano at gmail.com
Wed Feb 2 21:50:56 EST 2011


On 15:23 Mon 31 Jan     , Josh Boyer wrote:
> On Mon, Jan 31, 2011 at 12:48 AM, Mitsutaka Amano
> <mitsutaka.amano at gmail.com> wrote:
> > On Wed, Jan 26, 2011 at 11:43 PM, Josh Boyer <jwboyer at gmail.com> wrote:
> >> On Wed, Jan 26, 2011 at 6:09 AM, Mitsutaka Amano
> >> <mitsutaka.amano at 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.

Yeah. If possible, I want to implement a sliding window in the mapping driver for reducing the allocated size.

But I wondered other devices seems to not allocating(e.g, most NAND flash, flash on ARM, MIPS and so on). I don't know difference between my board and other. Doesn't other devices need to allocate to vmalloc?

Mitsutaka



More information about the linux-mtd mailing list