linux-mips
[Top] [All Lists]

Re: [ppopov@mvista.com: Re: [Linux-mips-kernel]ioremap & ISA]

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: [ppopov@mvista.com: Re: [Linux-mips-kernel]ioremap & ISA]
From: Jim Paris <jim@jtan.com>
Date: Tue, 18 Dec 2001 16:28:06 -0500
Cc: linux-mips@oss.sgi.com
In-reply-to: <20011218185850.A18856@dea.linux-mips.net>; from ralf@oss.sgi.com on Tue, Dec 18, 2001 at 06:58:50PM -0200
References: <20011217151515.A9188@neurosis.mit.edu> <20011217193432.A7115@dea.linux-mips.net> <20011218020344.A10509@neurosis.mit.edu> <20011218162506.A24659@dea.linux-mips.net> <20011218135712.B11726@neurosis.mit.edu> <20011218185850.A18856@dea.linux-mips.net>
Reply-to: jim@jtan.com
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
> > How so?  See the memory map I just sent in my other mail.  Should I be
> > adding isa_slot_offset to calls to check/request/release_mem_region?
> > Or should I make a isa_{check,request,release}_mem_region that adds
> > this in?  In which case, doesn't that turn /proc/iomem into a general
> > memory map rather than an I/O memory map?
> 
> It's a general memory map.  Basically you have an memory address space
> and an I/O space.  The latter should be treated as an entirely independant
> thing just like on x86 where special instructions (in / out) are necessary
> to access it.  On MIPS the difference is more blurry as this I/O port
> addres space is accessible through normal load / store instructions.

The ports are dealt with by /proc/ioports.  What about /proc/iomem?
The ISA ports and ISA memory are seperate, and the ports work fine and
just as I would expect them to.  But for memory, where should the
PCMCIA driver be reserving space?  Should I 
1) make /proc/iomem contain addresses relative to the start of I/O memory,
   just as /proc/ioports contains addresses relative to the start of
   I/O port space?  This will only work if I stop letting the kernel
   reserve the iomem resource for system memory.
2) make the i82365 driver use absolute addresses in /proc/iomem, by
   adding (isa_slot_offset - KSEG1) to all *_mem_resource calls?
   (breaks i82365 for other arches)
3) Invent a new resource "isamem", reserve the correct absolute
   addresses in "iomem", and the modify the i82365 driver to use 
   "isamem" instead?  (again breaks i82365 for other arches)

> Well, calling ioremap anyway is ok. 

How is calling ioremap anyway ok?  If I

1) call ioremap and then use read[bwl], then isa_slot_offset never
   comes into play and nothing works
2) call ioremap and then use isa_read[bwl], then KSEG1 gets included
   twice and nothing works

> The whole isa_* thing was invented to
> make keeping the large number of antique ISA drivers that don't have any
> maintainers alive.

I'm willing to take the "maintainer" role here and rewrite the driver
properly, but I'm still not understanding what the proper way is.
Given the current way the I/O memory is handled on MIPS, the only way
I can get the i82365 driver working breaks it for every other arch.

-jim

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