[RFC/PATCH v2] powerpc: add ioremap_early() function for mapping IO regions before MMU_init()

Kumar Gala galak at kernel.crashing.org
Fri Aug 15 05:59:36 EST 2008


On Aug 14, 2008, at 11:43 AM, Grant Likely wrote:

> On Thu, Aug 14, 2008 at 10:24 AM, Kumar Gala <galak at kernel.crashing.org 
> > wrote:
>>>> what happens if we run out of bats?
>>>
>>> Then it returns NULL and the caller must handle it.  The board port
>>> maintainer needs understand the board/CPU/SoC and not depend on more
>>> BATs than are available.  They also need to understand that there  
>>> is a
>>> tradeoff between BATs for IO and BATs for RAM.  If the board port  
>>> uses
>>> up all the BATs for IO, then RAM above 256MB ends up getting mapped
>>> with PTEs and there is a performance hit.  My expectation is that  
>>> only
>>> platform code will use this facility.  Device drivers should  
>>> continue
>>> to use ioremap() and will gain the benefit of the BATs if platform
>>> code already set them up.  I can add some text to the  
>>> documentation to
>>> describe this.
>>>
>>> I'm not going to make any attempt to fallback to PTEs for IO when
>>> there isn't enough BATs.  Doing so adds an order of magnitude more
>>> complexity.
>>
>> that's fine.. I just didn't look at setbat() to see it errors out.
>>
>> Also can we get rid of LOAD_BAT in head_32.S?
>
> Mostly.  It is still needed for BAT0 when setting up RAM, but the rest
> of it can be dumped.

Can we not do BAT0 in C code?

- k



More information about the Linuxppc-dev mailing list