dcr stuff.

6 messages, 3 authors, 2008-03-24 · open the first message on its own page

dcr stuff.

From: Stephen Neuendorffer <hidden>
Date: 2008-03-21 19:05:32

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

Re: dcr stuff.

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-03-21 21:24:53

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.

Re: dcr stuff.

From: Josh Boyer <hidden>
Date: 2008-03-22 01:18:40

On Fri, 21 Mar 2008 12:05:40 -0700
"Stephen Neuendorffer" [off-list ref] 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

RE: dcr stuff.

From: Stephen Neuendorffer <hidden>
Date: 2008-03-24 04:34:23



-----Original Message-----
From: Josh Boyer [mailto:<redacted>]
Sent: Fri 3/21/2008 6:17 PM
To: Stephen Neuendorffer
Cc: <redacted>; git-dev
Subject: Re: dcr stuff.
 
On Fri, 21 Mar 2008 12:05:40 -0700
"Stephen Neuendorffer" [off-list ref] wrote:
quoted
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

RE: dcr stuff.

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-03-24 22:08:28

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.

RE: dcr stuff.

From: Stephen Neuendorffer <hidden>
Date: 2008-03-24 22:18:38

-----Original Message-----
From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org]
Sent: Monday, March 24, 2008 3:00 PM
To: Stephen Neuendorffer
Cc: Josh Boyer; <redacted>; git-dev
Subject: RE: dcr stuff.
=20
=20
On Sun, 2008-03-23 at 21:34 -0700, Stephen Neuendorffer wrote:
quoted
Certainly, if it ain't broke don't fix it.  What I'm really trying
to
quoted
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
quoted
have internal code for DCR, their own ifdefs, etc.  This *is*
broken.
quoted
I'm looking at the available documentation to figure out the best
way
quoted
of approaching the problem.

It might be nice if there was an extra layer of indirection which
was
quoted
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
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help