scsi: ufs: ufs-exynos: Multi-host configuration for ExynosAuto v9
authorChanho Park <chanho61.park@samsung.com>
Mon, 18 Oct 2021 12:42:14 +0000 (21:42 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 28 Oct 2021 03:10:35 +0000 (23:10 -0400)
commitb52aea54b6bf740b31f675cc1c637a6c5806b37b
treeef3f55f42dc46d7d3021922fd5cb9a053de6da6b
parentcc52e15397cc5dc773d3c6792b98352d3209f93f
scsi: ufs: ufs-exynos: Multi-host configuration for ExynosAuto v9

The UFS controller of the ExynosAuto v9 SoC supports a multi-host interface
for I/O virtualization. In general, we're using para-virtualized driver to
support a block device by several virtual machines.

Multi-host functionality extends the host controller by providing register
interfaces that can be used by each VM's UFS drivers respectively. This way
we can provide direct access to the UFS device for multiple VMs similar to
PCIe SR-IOV.

We divide this M-HCI as PH (Physical Host) and VHs (Virtual Host). The PH
supports all UFSHCI functions (all SAPs) like a conventional UFSHCI but the
VH only supports data transfer functions. Thus, except UTP_CMD_SAP and
UTP_TMPSAP, the PH should handle all the physical features.

Provide an initial implementation of PH part. M-HCI can support up to four
interfaces (1 for a PH and 3 for VHs) but this patch initially supports
only 1 PH and 1 VH. For this, we uses TASK_TAG[7:5] field so TASK_TAG[4:0]
for 32 doorbell will be supported. After the PH is initiated, this will
send a ready message to VHs through a mailbox register. The message handler
is not fully implemented yet such as supporting reset / abort cases.

Link: https://lore.kernel.org/r/20211018124216.153072-14-chanho61.park@samsung.com
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Kiwoong Kim <kwmad.kim@samsung.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-exynos.c