linux-mips
[Top] [All Lists]

Re: Reason for PIO_MASK?

To: Manuel Lauss <manuel.lauss@googlemail.com>
Subject: Re: Reason for PIO_MASK?
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 6 Oct 2009 16:25:31 +0200
Cc: Linux-MIPS <linux-mips@linux-mips.org>
In-reply-to: <f861ec6f0910060511t3e95a089h63dc33e628349c11@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <f861ec6f0910030748l396b45bck858f15460354e58e@mail.gmail.com> <20091006115220.GC25263@linux-mips.org> <f861ec6f0910060511t3e95a089h63dc33e628349c11@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.19 (2009-01-05)
On Tue, Oct 06, 2009 at 02:11:15PM +0200, Manuel Lauss wrote:

> I meant the result of ioremap() of the 36bit address of PCMCIA IO space:
> so the ioport base is somewhere at 0xc0000000, which pata_pcmcia
> tries to devm_iomap(), and this is rejected by the above mentioned file.
> 
> The old ide-cs.c driver takes the given IO base as-is (without trying to
> do funky things to it) and just works. (i.e. there are 2 entries in the
> 0xc0000000-range per cf-card in /proc/ioports)

Feeding a virtual address as input to devm_ioremap or ioremap does not
make sense.  Ioremap is only to be used for memory resources anyway.

> >> I've temporarily removed the PIO_MASK check and pata_pcmcia
> >> works as expected. Is there any way around this, other than
> >> creating an Alchemy-specific ioport_map() function?
> >
> > The provocative question - why would you want to have more than 64k I/O port
> > space?
> 
> *I* don't want more; I want a smarter pata_pcmcia driver ;-)  I'll go bug 
> other
> people about this.  I brought this up here because one of my SH boards has
> similar needs (need to do an ioremap() with special TLB flags to get access to
> pcmcia IO space) but pata_pcmcia does work there (because SH kernel
> either asks the board to translate an x86-IO port to memory address or
> simply returns the port plus an offset).

Well, Alchemy does this:

...
        if (!virt_io_addr) {
                printk(KERN_ERR "Unable to ioremap pci space\n");
                return 1;
        }
        au1x_controller.io_map_base = virt_io_addr;
...
set_io_port_base(virt_io_addr);
...

Which sets up a mapping for the entire port space.  Normally the PCMCIA
I/O port space should also be part of this range so inb, outb etc. for
the low 64k or so of port address range should just work without further
iomap calls of any sort.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>