Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-12 Thread Grant Likely
On Thu, Aug 07, 2008 at 07:04:04PM -0500, Kumar Gala wrote: >> mem_init_done isn't a good indication. We can do page tables when it's >> 0, we would have to use a separate mem_preinit_done or something :-) >> >> I initially also though about a flag to ioremap_prot to be honest. But >> it does obfus

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-07 Thread Kumar Gala
On Aug 7, 2008, at 5:13 PM, Benjamin Herrenschmidt wrote: On Wed, 2008-08-06 at 20:49 -0500, Kumar Gala wrote: On Aug 6, 2008, at 5:28 PM, 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 thi

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-07 Thread Benjamin Herrenschmidt
On Wed, 2008-08-06 at 17:11 -0600, Grant Likely wrote: > I'm not sure what you're asking. Are you asking about this particular > test, or are you asking why I don't also test the size? Badly worded. I meant BAT sizes are masks of bits. IE, they are power of 2 and the BAT address must be aligned

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-07 Thread Benjamin Herrenschmidt
On Wed, 2008-08-06 at 20:49 -0500, Kumar Gala wrote: > On Aug 6, 2008, at 5:28 PM, 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 ther

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-07 Thread Kumar Gala
On Aug 7, 2008, at 11:45 AM, Scott Wood wrote: On Wed, Aug 06, 2008 at 05:11:08PM -0600, Grant Likely wrote: I do this particular test to make absolute sure that the caller absolutely understands the limitations of the block mapping. If they call this with something that isn't 128k aligned, t

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-07 Thread Scott Wood
On Wed, Aug 06, 2008 at 05:11:08PM -0600, Grant Likely wrote: > I do this particular test to make absolute sure that the caller > absolutely understands the limitations of the block mapping. If they > call this with something that isn't 128k aligned, then I make it fail > immediately so the coder

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Kumar Gala
why can't we just do this in ioremap itself? I suppose we could; but the usecase is somewhat different and I wanted to keep it simple. Using a separate API also helps reenforce that the caller really needs to know what they are doing because BATs are a limited resource. there is a bunch

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Kumar Gala
On Aug 6, 2008, at 5:28 PM, 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

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Brad Boyer
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 > >

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Grant Likely
On Wed, Aug 6, 2008 at 4:28 PM, Benjamin Herrenschmidt <[EMAIL PROTECTED]> 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 >> t

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Grant Likely
On Wed, Aug 6, 2008 at 4:26 PM, Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > On Wed, 2008-08-06 at 00:02 -0600, Grant Likely wrote: >> From: Grant Likely <[EMAIL PROTECTED]> >> >> ioremap_bat() is useful for things like mapping SoC internally memory mapped >> register and early text because

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Grant Likely
On Wed, Aug 6, 2008 at 4:11 PM, Kumar Gala <[EMAIL PROTECTED]> wrote: > > On Aug 6, 2008, at 4:54 PM, Grant Likely wrote: > >> On Wed, Aug 6, 2008 at 8:07 AM, Kumar Gala <[EMAIL PROTECTED]> >> wrote: >>> >>> On Aug 6, 2008, at 1:02 AM, Grant Likely wrote: >>> From: Grant Likely <[EMAIL PROTECT

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Benjamin Herrenschmidt
> 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

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Scott Wood
Kumar Gala wrote: On Aug 6, 2008, at 4:54 PM, Grant Likely wrote: I suppose we could; but the usecase is somewhat different and I wanted to keep it simple. Using a separate API also helps reenforce that the caller really needs to know what they are doing because BATs are a limited resource. t

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Benjamin Herrenschmidt
On Wed, 2008-08-06 at 00:02 -0600, Grant Likely wrote: > From: Grant Likely <[EMAIL PROTECTED]> > > ioremap_bat() is useful for things like mapping SoC internally memory mapped > register and early text because it allows mappings to devices to be setup > early in the boot process where they are ne

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Kumar Gala
On Aug 6, 2008, at 4:54 PM, Grant Likely wrote: On Wed, Aug 6, 2008 at 8:07 AM, Kumar Gala <[EMAIL PROTECTED]> wrote: On Aug 6, 2008, at 1:02 AM, Grant Likely wrote: From: Grant Likely <[EMAIL PROTECTED]> ioremap_bat() is useful for things like mapping SoC internally memory mapped regi

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Grant Likely
On Wed, Aug 6, 2008 at 8:07 AM, Kumar Gala <[EMAIL PROTECTED]> wrote: > > On Aug 6, 2008, at 1:02 AM, Grant Likely wrote: > >> From: Grant Likely <[EMAIL PROTECTED]> >> >> ioremap_bat() is useful for things like mapping SoC internally memory >> mapped >> register and early text because it allows ma

Re: [RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-06 Thread Kumar Gala
On Aug 6, 2008, at 1:02 AM, Grant Likely wrote: From: Grant Likely <[EMAIL PROTECTED]> ioremap_bat() is useful for things like mapping SoC internally memory mapped register and early text because it allows mappings to devices to be setup early in the boot process where they are needed, and

[RFC/PATCH 1/3] powerpc: add ioremap_bat() function for setting up BAT translated IO regions.

2008-08-05 Thread Grant Likely
From: Grant Likely <[EMAIL PROTECTED]> ioremap_bat() is useful for things like mapping SoC internally memory mapped register and early text because it allows mappings to devices to be setup early in the boot process where they are needed, and the mappings persist after the MMU is configured. With