linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* dcr stuff.
@ 2008-03-21 19:05 Stephen Neuendorffer
  2008-03-21 21:24 ` Benjamin Herrenschmidt
  2008-03-22  1:17 ` Josh Boyer
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Neuendorffer @ 2008-03-21 19:05 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: git-dev


Is anybody working on the dcr infrastructure?

In particular, there seems to be inconsistency between what the kernel
does and what ePAPR thinks it should.  The code in the kernel selects
mmio or native access based on a Kconfig parameter and uses some device
tree parameters to correctly configure the mmio access, whereas ePAPR
doesn't seem to document all the device tree attributes (in particular,
dcr-mmio-stride and dcr-mmio-range) and provides a dynamic binding for
dcr-access-method...

Is there a plan here?  (In particular, in FPGA designs, its possible to
have crazy things like multiple independent dcr busses, some using
native access, some using mmio.  Or even if there is one bus, many of
the existing non-linux drivers we have assume native or mmio access.
I'd like to clean this up, obviously.. :)

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: dcr stuff.
  2008-03-21 19:05 dcr stuff Stephen Neuendorffer
@ 2008-03-21 21:24 ` Benjamin Herrenschmidt
  2008-03-22  1:17 ` Josh Boyer
  1 sibling, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2008-03-21 21:24 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev, git-dev


On Fri, 2008-03-21 at 12:05 -0700, Stephen Neuendorffer wrote:
> Is anybody working on the dcr infrastructure?
> 
> In particular, there seems to be inconsistency between what the kernel
> does and what ePAPR thinks it should.  The code in the kernel selects
> mmio or native access based on a Kconfig parameter and uses some device
> tree parameters to correctly configure the mmio access, whereas ePAPR
> doesn't seem to document all the device tree attributes (in particular,
> dcr-mmio-stride and dcr-mmio-range) and provides a dynamic binding for
> dcr-access-method...
> 
> Is there a plan here?  (In particular, in FPGA designs, its possible to
> have crazy things like multiple independent dcr busses, some using
> native access, some using mmio.  Or even if there is one bus, many of
> the existing non-linux drivers we have assume native or mmio access.
> I'd like to clean this up, obviously.. :)

So far, the crazy things never happened, at least as far as I can tell,
which is why the kernel does what it does. That allows to inline the DCR
instructions on 4xx processors, and thus avoids code bloat. It also
avoids trying to use DCR instructions on processors that don't support
them like Cell with the Axon bridge.

If it becomes necessary, we can make it dynamic tho.

Ben.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: dcr stuff.
  2008-03-21 19:05 dcr stuff Stephen Neuendorffer
  2008-03-21 21:24 ` Benjamin Herrenschmidt
@ 2008-03-22  1:17 ` Josh Boyer
  2008-03-24  4:34   ` Stephen Neuendorffer
  1 sibling, 1 reply; 6+ messages in thread
From: Josh Boyer @ 2008-03-22  1:17 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev, git-dev

On Fri, 21 Mar 2008 12:05:40 -0700
"Stephen Neuendorffer" <stephen.neuendorffer@xilinx.com> wrote:

> 
> Is anybody working on the dcr infrastructure?
> 
> In particular, there seems to be inconsistency between what the kernel
> does and what ePAPR thinks it should.  The code in the kernel selects
> mmio or native access based on a Kconfig parameter and uses some device
> tree parameters to correctly configure the mmio access, whereas ePAPR
> doesn't seem to document all the device tree attributes (in particular,
> dcr-mmio-stride and dcr-mmio-range) and provides a dynamic binding for
> dcr-access-method...

Code can be fixed if needs be.  Keep in mind that ePAPR isn't publicly
available yet.

> Is there a plan here?  (In particular, in FPGA designs, its possible to
> have crazy things like multiple independent dcr busses, some using
> native access, some using mmio.  Or even if there is one bus, many of
> the existing non-linux drivers we have assume native or mmio access.
> I'd like to clean this up, obviously.. :)

Clean it up how?  I'd hate to add bloat to boards with native DCR
access just because a few require oddities.

If it ain't broke, don't fix it.

josh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: dcr stuff.
  2008-03-22  1:17 ` Josh Boyer
@ 2008-03-24  4:34   ` Stephen Neuendorffer
  2008-03-24 21:59     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Neuendorffer @ 2008-03-24  4:34 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, git-dev

[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]




-----Original Message-----
From: Josh Boyer [mailto:jwboyer@linux.vnet.ibm.com]
Sent: Fri 3/21/2008 6:17 PM
To: Stephen Neuendorffer
Cc: linuxppc-dev@ozlabs.org; git-dev
Subject: Re: dcr stuff.
 
On Fri, 21 Mar 2008 12:05:40 -0700
"Stephen Neuendorffer" <stephen.neuendorffer@xilinx.com> wrote:

> > Is there a plan here?  (In particular, in FPGA designs, its possible to
> > have crazy things like multiple independent dcr busses, some using
> > native access, some using mmio.  Or even if there is one bus, many of
> > the existing non-linux drivers we have assume native or mmio access.
> > I'd like to clean this up, obviously.. :)

> Clean it up how?  I'd hate to add bloat to boards with native DCR
> access just because a few require oddities.
>
> If it ain't broke, don't fix it.
>
> josh

Certainly, if it ain't broke don't fix it.  What I'm really trying to do is figure out how to clean up alot of non-mainline drivers.
At the moment, several cores use DCR, but the drivers for those cores have internal code for DCR, their own ifdefs, etc.  This *is* broken.
I'm looking at the available documentation to figure out the best way of approaching the problem.

It might be nice if there was an extra layer of indirection which was only enabled if DCR_NATIVE and DCR_MMIO, and which was no cost otherwise,
but the bigger problem I see in the short term is that we'll likely have to support ARCH ppc for at least some time into the future, and it would be
nice if we used the same driver code to do it: it doesn't seem obvious how to achieve this.

Steve


[-- Attachment #2: Type: text/html, Size: 2239 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: dcr stuff.
  2008-03-24  4:34   ` Stephen Neuendorffer
@ 2008-03-24 21:59     ` Benjamin Herrenschmidt
  2008-03-24 22:18       ` Stephen Neuendorffer
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2008-03-24 21:59 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev, git-dev


On Sun, 2008-03-23 at 21:34 -0700, Stephen Neuendorffer wrote:
> 
> Certainly, if it ain't broke don't fix it.  What I'm really trying to
> do is figure out how to clean up alot of non-mainline drivers.
> At the moment, several cores use DCR, but the drivers for those cores
> have internal code for DCR, their own ifdefs, etc.  This *is* broken.
> I'm looking at the available documentation to figure out the best way
> of approaching the problem.
> 
> It might be nice if there was an extra layer of indirection which was
> only enabled if DCR_NATIVE and DCR_MMIO, and which was no cost
> otherwise,
> but the bigger problem I see in the short term is that we'll likely
> have to support ARCH ppc for at least some time into the future, and
> it would be
> nice if we used the same driver code to do it: it doesn't seem obvious
> how to achieve this.

It's not too hard to have the DCR code be common, it's harder to deal
with the lack of device-tree in arch/ppc tho.

As for enabling support for both native and MMIO, that's certainly
possible, patches welcome :-) You could make the dcr host structure
contain the type or even function pointers, as you see fit. But make is
so that when only native is enabled, it turns back into the inlines we
have now.

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: dcr stuff.
  2008-03-24 21:59     ` Benjamin Herrenschmidt
@ 2008-03-24 22:18       ` Stephen Neuendorffer
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Neuendorffer @ 2008-03-24 22:18 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, git-dev



> -----Original Message-----
> From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org]
> Sent: Monday, March 24, 2008 3:00 PM
> To: Stephen Neuendorffer
> Cc: Josh Boyer; linuxppc-dev@ozlabs.org; git-dev
> Subject: RE: dcr stuff.
>=20
>=20
> On Sun, 2008-03-23 at 21:34 -0700, Stephen Neuendorffer wrote:
> >
> > Certainly, if it ain't broke don't fix it.  What I'm really trying
to
> > do is figure out how to clean up alot of non-mainline drivers.
> > At the moment, several cores use DCR, but the drivers for those
cores
> > have internal code for DCR, their own ifdefs, etc.  This *is*
broken.
> > I'm looking at the available documentation to figure out the best
way
> > of approaching the problem.
> >
> > It might be nice if there was an extra layer of indirection which
was
> > only enabled if DCR_NATIVE and DCR_MMIO, and which was no cost
> > otherwise,
> > but the bigger problem I see in the short term is that we'll likely
> > have to support ARCH ppc for at least some time into the future, and
> > it would be
> > nice if we used the same driver code to do it: it doesn't seem
obvious
> > how to achieve this.
>=20
> It's not too hard to have the DCR code be common, it's harder to deal
> with the lack of device-tree in arch/ppc tho.

My thoughts at the moment are to punt on map and unmap and at least
provide support for dcr_host_t and dcr_read and dcr_write.  Any driver
code that wants to use this without a device tree will just have to do
the work itself.  This will at least support the use cases we have
today: If people want something better, then they should switch to ARCH
powerpc.. :)
=20
> As for enabling support for both native and MMIO, that's certainly
> possible, patches welcome :-) You could make the dcr host structure
> contain the type or even function pointers, as you see fit. But make
is
> so that when only native is enabled, it turns back into the inlines we
> have now.

Working on it.. :)

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-24 22:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21 19:05 dcr stuff Stephen Neuendorffer
2008-03-21 21:24 ` Benjamin Herrenschmidt
2008-03-22  1:17 ` Josh Boyer
2008-03-24  4:34   ` Stephen Neuendorffer
2008-03-24 21:59     ` Benjamin Herrenschmidt
2008-03-24 22:18       ` Stephen Neuendorffer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).