summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorCaleb Connolly <caleb.connolly@linaro.org>2024-11-13 06:09:24 +0100
committerCaleb Connolly <caleb.connolly@linaro.org>2024-11-20 17:57:58 +0100
commite55fc3ab205c6e81ac52fe2550478ea746d9b512 (patch)
tree5475f93668fcf5833fb646018820d00cc3d020f7 /drivers
parent53c0f1beac1e528f4ccfd116d6d4fde9881b3c91 (diff)
iommu: qcom-smmu: handle running in el2
We only need to configure the SMMU when running in EL1. In EL2 the hypervisor isn't running so peripherals can just do DMA as they wish. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/qcom-hyp-smmu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iommu/qcom-hyp-smmu.c b/drivers/iommu/qcom-hyp-smmu.c
index 7e07487ad38..c1b95bc8b8c 100644
--- a/drivers/iommu/qcom-hyp-smmu.c
+++ b/drivers/iommu/qcom-hyp-smmu.c
@@ -91,6 +91,8 @@ struct qcom_smmu_priv {
phys_addr_t base;
struct list_head devices;
struct udevice *dev;
+ /* SMMU is not needed when running in EL2 */
+ bool disable;
/* Read-once config */
int num_cb;
@@ -277,6 +279,9 @@ static int qcom_smmu_connect(struct udevice *dev)
if (WARN_ON(!priv))
return -EINVAL;
+ if (priv->disable)
+ return 0;
+
mdev = alloc_dev(dev);
if (IS_ERR(mdev) && PTR_ERR(mdev) != -EEXIST) {
printf("%s: %s Couldn't create mmu context\n", __func__,
@@ -348,6 +353,8 @@ static int qcom_smmu_probe(struct udevice *dev)
priv->base = dev_read_addr(dev);
INIT_LIST_HEAD(&priv->devices);
+ priv->disable = current_el() > 1;
+
/* Read SMMU config */
val = gr0_readl(priv, ARM_SMMU_GR0_ID0);
priv->num_smr = FIELD_GET(ARM_SMMU_ID0_NUMSMRG, val);