# Re: \[PATCH 1/4\] \[v4\]\[POWERPC\] refactor dcr code

- From: Benjamin Herrenschmidt \<benh@kernel.crashing.org\>
- Date: 2008-05-06 00:12:35 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2008/05/9439747
- Thread: https://ratatoskr.run/linuxppc-dev/2008/05/9439721/t.md

```text

On Mon, 2008-05-05 at 10:56 -0700, Stephen Neuendorffer wrote:
> Previously, dcr support was configured at compile time to either using
> MMIO or native dcr instructions.  Although this works for most
> platforms, it fails on FPGA platforms:
> 
> 1) Systems may include more than one dcr bus.
> 2) Systems may be native dcr capable and still use memory mapped dcr interface.
> 
> This patch provides runtime support based on the device trees for the
> case where CONFIG_PPC_DCR_MMIO and CONFIG_PPC_DCR_NATIVE are both
> selected.  Previously, this was a poorly defined configuration, which
> happened to provide NATIVE support.  The runtime selection is made
> based on the dcr controller having a 'dcr-access-method' attribute
> in the device tree.  If only one of the above options is selected,
> then the code uses #defines to select only the used code in order to
> avoid introducing overhead in existing usage.
> 
> Signed-off-by: Stephen Neuendorffer <redacted>

Quick look seems ok, but that was really only a quick look :-)

I'll rely on Josh to review further.

Cheers,
Ben.
```
