]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
UBUNTU: SAUCE: LIB: Introduce a generic PIO mapping method
authorZhichang Yuan <yuanzhichang@hisilicon.com>
Mon, 19 Feb 2018 17:48:32 +0000 (01:48 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 23 Feb 2018 14:29:17 +0000 (08:29 -0600)
commit342c2a0ed90ec9813672a686a728604045719dcf
treee5b80ec1442e5c38949ffcb60784905a1ee344bb
parent2690c6e9d9fba8c18796cc2f5b796b467c021d93
UBUNTU: SAUCE: LIB: Introduce a generic PIO mapping method

BugLink: https://bugs.launchpad.net/bugs/1677319
In commit 41f8bba7f555 ("of/pci: Add pci_register_io_range() and
pci_pio_to_address()"), a new I/O space management was supported. With
that driver, the I/O ranges configured for PCI/PCIe hosts on some
architectures can be mapped to logical PIO, converted easily between
CPU address and the corresponding logicial PIO. Based on this, PCI
I/O devices can be accessed in a memory read/write way through the
unified in/out accessors.

But on some archs/platforms, there are bus hosts which access I/O
peripherals with host-local I/O port addresses rather than memory
addresses after memory-mapped.

To support those devices, a more generic I/O mapping method is introduced
here. Through this patch, both the CPU addresses and the host-local port
can be mapped into the logical PIO space with different logical/fake PIOs.
After this, all the I/O accesses to either PCI MMIO devices or host-local
I/O peripherals can be unified into the existing I/O accessors defined in
asm-generic/io.h and be redirected to the right device-specific hooks
based on the input logical PIO.

Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
[ v14 submittal ]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
include/asm-generic/io.h
include/linux/logic_pio.h [new file with mode: 0644]
lib/Kconfig
lib/Makefile
lib/logic_pio.c [new file with mode: 0644]