Qualcomm platforms are heavily locked down, in many cases offering no way for users to gain EL2 or EL3 code execution and including many additional security features. Among these are modifications made to the SMMU behaviour (done by having the hypervisor intercept register accesses). On many platforms it is not possible to disable the SMMU, and not possible to configure streams in BYPASS.
To enable support for peripherals like USB which depend on DMA, we must allocate a context bank on the SMMU and configure an IDENTITY mapping. This patch series fixes support for building IOMMU without CONFIG_PCI. Then, it introduces first introduces support for a .connect() op in IOMMU drivers, this is called before the peripheral drivers .probe() function and allows for IOMMU devices to perform one-time setup. Lastly, introduce a new driver which supports the SMMU as found on Qualcomm platforms, when a DMA capable peripherals is probed, this driver will first see if the previous stage bootloader configured a context bank for the given stream ID already, and if not then it allocates and configures one so that DMA accesses will work. There are no in-tree users for this driver yet, however it is required for upcoming USB support on SDM845 and future Qualcomm platforms. --- Caleb Connolly (3): iommu: fix compilation when CONFIG_PCI disabled iommu: add a connect op iommu: add qcom-hyp-smmu drivers/iommu/Kconfig | 16 ++ drivers/iommu/Makefile | 1 + drivers/iommu/iommu-uclass.c | 16 +- drivers/iommu/qcom-hyp-smmu.c | 396 ++++++++++++++++++++++++++++++++++++++++++ include/iommu.h | 9 + 5 files changed, 436 insertions(+), 2 deletions(-) --- base-commit: 8806443ed784dad5b5daf351b0175acb3343e729 // Caleb (they/them)