[PATCH 0/8] Implement firmware quirks for Qualcomm ARM-SMMUv2

From: kholk11
Date: Sat Sep 26 2020 - 09:00:26 EST


From: AngeloGioacchino Del Regno <kholk11@xxxxxxxxx>

In this patch series, I'm implementing some quirks for firmware issues
happening on various Qualcomm SoCs, including SDM630, SDM636, SDM660,
their SDA variants and, most probably, other MSM/APQs.

In the specific case of the 630/660 family of SoCs, failing to apply
all of these quirks means complete havoc when enabling the IOMMUs,
as the firmware that is running on (almost?) all of the commercial
boards (smartphones) is set to give us a "nice" hypervisor fault,
resulting in either a system hang or a reboot.

The actual implementation of these quirks in downstream kernels is
done through reading some DT property and varying code paths, while
here it's done through the implementation details for ARM-SMMU instead.

In short, the quirks that are proposed in this patch series are the
ones relative to the following downstream properties:
- qcom,use-3-lvl-tables (39-bit VA size)
- qcom,skip-init (avoid stream mapping reset for secure CBs)
- qcom,no-smr-check (manually set correct streamid/smr masks)

This patch series has been tested on the following devices:
- Sony Xperia XA2 Ultra (SDM630 Nile Discovery)
- Sony Xperia 10 (SDM630 Ganges Kirin)
- Sony Xperia 10 Plus (SDM636 Ganges Mermaid)

AngeloGioacchino Del Regno (8):
iommu/arm-smmu-qcom: Rename qcom_smmu_impl to qcom_smmu500_impl
iommu/arm-smmu-qcom: Add QC SMMUv2 VA Size quirk for SDM660
dt-bindings: arm-smmu: add binding for SMMUv2 on Qualcomm SDM660
iommu/arm-smmu: Support test_smr_masks implementation detail deviation
iommu/arm-smmu-qcom: Add test_smr_masks detail to QCOM SMMUv2
iommu/arm-smmu: Move stream mapping reset to separate function
iommu/arm-smmu: Support stream_mapping_reset implementation detail
iommu/arm-smmu-qcom: Add stream_mapping_reset detail to QCOM SMMUv2

.../devicetree/bindings/iommu/arm,smmu.yaml | 1 +
drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 +-
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 59 ++++++++++++++++++-
drivers/iommu/arm/arm-smmu/arm-smmu.c | 28 +++++++--
drivers/iommu/arm/arm-smmu/arm-smmu.h | 2 +
5 files changed, 85 insertions(+), 8 deletions(-)

--
2.28.0