Re: [PATCH] fix ppc ioremap prototype

Matt Porter
2003-09-04T14:38:09Z

On Thu, Sep 04, 2003 at 02:36:24AM -0700, David S. Miller wrote:
> On Thu, 4 Sep 2003 19:21:34 +1000 (EST)
> Paul Mackerras <paulus@samba.org> wrote:
>
> > What I would prefer is if we passed a struct device pointer, a
> > resource pointer and an offset to ioremap. Then we could just have
> > bus addresses in PCI device resources instead of having to translate
> > them into physical addresses.
>
> You only need a resource in order to do this. Then you can
> stick the upper bits, controller number, whatever in the unused
> resource flag bits.

Ok, now the other part of making PCI devices work is to support
mmap. In most cases, that means remap_page_range() is used which
is stuck with an unsigned long physical address. For example,
should we really have a remap_resource_range() in FB drivers to
handle mmap? This could use arch-specific resource information
to get a 36-bit physical address (PPC44x) and maybe get rid of
some of the in-driver per-arch address munging.

My local tree has an ugly hack to remap_page_range() (and friends)
so it uses a phys_addr_t and calls fixup_bigphys_addr() to allow
use of unmodified PCI FB drivers. I'd like to get this working
without hacks. :)

-Matt