[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: ioremap non-contiguous phys to contiguous virt?
From:       Marc Singer <elf () buici ! com>
Date:       2004-10-18 21:24:41
Message-ID: 20041018212441.GB947 () buici ! com
[Download RAW message or body]

On Mon, Oct 18, 2004 at 05:06:45PM -0400, Nicolas Pitre wrote:
> On Mon, 18 Oct 2004, Marc Singer wrote:
> 
> > For the sake of the making it easy on the mtd drivers, I'd like to map
> > discontiguous physical memory to a contiguous virtual address space.
> > This hardware layout is an artifact of the design that allows a larger
> > flash device to be used in later implementations.
> 
> You mean that the same flash gets split apart in the physical space?

Well, to tell the truth, yes.  This flash part is really two 64MiB
devices in one package.  There is a bank select line (the BS line ;-)
) that enables the bank.  It could be thought of as the highest order
address line, but that isn't how it is wired.  The designer left room
for a larger device to be soldered in without laying out another
board.

> 
> > I think that my options are
> > 
> >   1) ignore the problem and create a custom maps driver with NO_XIP set.
> >   2) create a custom maps driver, but use the io_table_init mechanism
> >      to map the memory contiguously (eeww)
> >   3) find a clever method to do something like this
> > 
> >      struct memvec mv = { { PHYS0, LEN0 }, {PHYS1, LEN1 } };
> >      void* virt = ioremapv (memvec, 2);
> 
> Well, I think your only option without hacking core code is #2.

That's what I've done for now, sadly.  It looks like an __ioremapv
could be written without too much grief.  Is there a reason why this
would be a bad idea?

It turns out that there is something else afoot.  I was having
problems with the flash device getting into a peculiar mode where bank
zero was wedged.  I mean wedged.  The only reliable method of getting
it unwedged was to cycle power.  When I changed to using 2), the
problem went away.  That makes we wonder if there isn't a bug
somewhere in the cfi_0001 code where it doesn't handle discontiguous
mappings as well as it claims.

Cheers.

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic