• Rob Herring's avatar
    PCI: Add generic config accessors · 1f94a94f
    Rob Herring authored
    Many PCI controllers' configuration space accesses are memory-mapped and
    vary only in address calculation and access checks.  There are 2 main
    access methods: a decoded address space such as ECAM or a single address
    and data register similar to x86.  This implementation can support both
    cases as well as be used in cases that need additional pre- or post-access
    handling.
    
    Add a new pci_ops member, map_bus, which can do access checks and any
    necessary setup.  It returns the address to use for the configuration space
    access.  The access types supported are 32-bit only accesses or correct
    byte, word, or dword sized accesses.
    Tested-by: 's avatarThierry Reding <treding@nvidia.com>
    Signed-off-by: 's avatarRob Herring <robh@kernel.org>
    Signed-off-by: 's avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: 's avatarThierry Reding <treding@nvidia.com>
    1f94a94f
access.c 17.2 KB