iommu: add qcom-hyp-smmu
Add a basic implementation of the ARM SMMU. This driver is intended for
use on Qualcomm platforms where the SMMU has been configured by a previous
bootloader, cannot be turned off, and doesn't support BYPASS streams.
It keeps all existing stream mappings and only creates new ones for stream
ids that aren't already configured.
This driver is necessary to support peripherals that perform DMA which
weren't configured by the previous stage bootloader (for example USB).
It works by allocating a context bank using identity mapping (as U-Boot
doesn't use virtual addresses).
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index dabc1f9..2ba6d9c 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -24,4 +24,20 @@
configuration to put the DART into bypass mode such that it can
be used transparently by U-Boot.
+config QCOM_HYP_SMMU
+ bool "Qualcomm quirky SMMU support"
+ depends on IOMMU && ARCH_SNAPDRAGON
+ help
+ Enable support for the Qualcomm variant of the Arm System MMU-500.
+ Qualcomm boards have a non-standard SMMU where some registers are
+ emulated by the hypervisor. It is initialised early in the boot
+ process and can't be turned off.
+
+ The main caveat with this hardware is that it doesn't support BYPASS
+ streams, attempting to configure once will instead wind up with a
+ FAULT stream, and the device will crash when DMA is attempted.
+
+ Say Y here to enable support for non-boot peripherals like USB by
+ configuring identity mapped streams for them.
+
endmenu