[v5][POWERPC] refactor dcr code
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 <stephen.neuendorffer@xilinx.com>
--
[v4]
Converted flags to be DCR_HOST_*
Added WARN_ON in case someone forgets to call MAP_OK()
Fixed dealing with the dcr-access-method correctly, which was still
off in the wrong patch.
[v5]
Fixed leaked reference to the device tree.
Loading
Please sign in to comment