• Stephen Neuendorffer's avatar
    [POWERPC] Refactor DCR code · b786af11
    Stephen Neuendorffer authored
    Previously, DCR support was configured at compile time to either use
    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: default avatarStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
    Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
    b786af11
dcr-native.h 3.33 KB