dcr stuff.
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
Quoted 10 lines · Stephen Neuendorffer
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
Kconfigparameter 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...
Quoted 5 lines
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.
Quoted 10 lines · On Fri, 21 Mar 2008 12:05:40 -0700 "Stephen Neuendorffer"…
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
Kconfigparameter 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.
Quoted 5 lines
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
-----Original Message-----
From: Josh Boyer [mailto:[email protected]]
Sent: Fri 3/21/2008 6:17 PM
To: Stephen Neuendorffer
Cc: [email protected]; git-dev
Subject: Re: dcr stuff.
Quoted 6 lines · On Fri, 21 Mar 2008 12:05:40 -0700 "Stephen Neuendorffer"…
Quoted 5 lines
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.. :)
Quoted 6 lines
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
Quoted 8 lines · Stephen Neuendorffer
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.
Quoted 8 lines
It might be nice if there was an extra layer of indirection which was only enabled if
DCR_NATIVEandDCR_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.
Quoted 13 lines
-----Original Message-----
From: Benjamin Herrenschmidt [mailto:[email protected]]
Sent: Monday, March 24, 2008 3:00 PM
To: Stephen Neuendorffer
Cc: Josh Boyer; [email protected]; git-dev
Subject: RE: dcr stuff.
=20
=20Quoted 2 lines · Stephen Neuendorffer
Certainly, if it ain't broke don't fix it. What I'm really trying
to
Quoted 2 lines
Quoted 2 lines
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 1 line
Quoted 1 line
have internal code for DCR, their own ifdefs, etc. This *is*
broken.
Quoted 1 line
Quoted 1 line
I'm looking at the available documentation to figure out the best
way
Quoted 3 lines
Quoted 3 lines
of approaching the problem.
It might be nice if there was an extra layer of indirection which
was
Quoted 6 lines
Quoted 6 lines
only enabled if
DCR_NATIVEandDCR_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 4 lines
Quoted 1 line
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 inarch/ppctho.
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
Quoted 3 lines
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
Quoted 2 lines
so that when only native is enabled, it turns back into the inlines we have now.
Working on it.. :)
Steve