VMCI: dma dg: add MMIO access to registers
authorJorgen Hansen <jhansen@vmware.com>
Mon, 7 Feb 2022 10:27:19 +0000 (02:27 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 11:15:58 +0000 (12:15 +0100)
commite283a0e8b7ea83915e988ed059384af166b444c0
treec96da105d75cbaafbecd1cbeb803ad766c9ce4bb
parentfac608138c6136126faadafa5554cc0bbabf3c44
VMCI: dma dg: add MMIO access to registers

Detect the support for MMIO access through examination of the length
of the region requested in BAR1. If it is 256KB, the VMCI device
supports MMIO access to registers.

If MMIO access is supported, map the area of the region used for
MMIO access (64KB size at offset 128KB).

Add wrapper functions for accessing 32 bit register accesses through
either MMIO or IO ports based on device configuration.

Sending and receiving datagrams through iowrite8_rep/ioread8_rep is
left unchanged for now, and will be addressed in a later change.

Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Link: https://lore.kernel.org/r/20220207102725.2742-3-jhansen@vmware.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/vmw_vmci/vmci_guest.c
include/linux/vmw_vmci_defs.h