Re: [PATCH] fix ppc ioremap prototype

Russell King
2003-09-04T09:48: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.

Using the high flag bits probably isn't a good idea for two reasons:

1. We already use bit 31 to indicate the busy status:

#define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */

However, it looks like bits 27 to 17 are currently unused.

2. The resource tree won't know about the upper bits or whatever sitting
in flags, and as such identical addresses on two different buses will
clash.

Resource start,end needs to be some unique quantity no matter which (PCI)
bus you are on.

--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux