[RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.
Brad Boyer
flar at allandria.com
Thu Aug 7 08:55:47 EST 2008
On Thu, Aug 07, 2008 at 08:28:29AM +1000, Benjamin Herrenschmidt wrote:
>
> > there is a bunch of error checking and difference in semantics that
> > you need to fix. I think introduce a new API for this is silly,
> > especially since we expect there to only be one actual invocation of
> > the API for serial console access.
>
> Not necessarily....
>
> There's another aspect to BAT mappings here. First, they should be
> permanent (ie, not unmappable). That way, we have ioremap just use
> an existing BAT mapping when asked for a device that is covered
> by a BAT. This allows to have platform code do something like setup
> a BAT over a bunch of SOC registers or over a device, to automagically
> get drivers doing ioremap to that area benefit from it.
The m68k arch code does something similar with TT registers and ioremap,
but it's a little hackish currently. If there was a more generic way
to handle it, that would make things a little cleaner. In the m68k
implementation, there are just exceptions in the ioremap code that are
hard wired to know about the ranges that are normally set earlier. Since
the ranges end up being in multiple files, it's more fragile to change
what is mapped in these blocks.
Brad Boyer
flar at allandria.com
More information about the Linuxppc-dev
mailing list