bus/pci: support MMIO for ioport
authorHuawei Xie <huawei.xhw@alibaba-inc.com>
Wed, 10 Mar 2021 17:36:30 +0000 (01:36 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 15 Mar 2021 14:14:22 +0000 (15:14 +0100)
commitdf58e45e4d9fd7250d4e6baca54614502e19edc0
tree2a1791040c7ab8ea5bad08dd85b64e109aa6e536
parent46dcbccd3a2715fb2059c51544722aabd2fe40f7
bus/pci: support MMIO for ioport

With I/O BAR, we get PIO (port-mapped I/O) address.
With MMIO (memory-mapped I/O) BAR, we get mapped virtual address.
We distinguish PIO and MMIO by their address range like how kernel does,
i.e, address below 64K is PIO.
ioread/write8/16/32 is provided to access PIO/MMIO.
By the way, for virtio on arch other than x86, BAR flag indicates PIO
but is mapped.

Signed-off-by: Huawei Xie <huawei.xhw@alibaba-inc.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
drivers/bus/pci/linux/pci.c
drivers/bus/pci/linux/pci_uio.c