summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorHiroshi DOYU <hdoyu@nvidia.com>2012-02-28 15:33:17 +0200
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-07-11 06:37:01 -0700
commit1ac140616927746dc31f68fb5164eaacd6819b66 (patch)
tree606462605a34366a9fb417ab613c552455f71146 /drivers/iommu
parent22b1ce014b037ed8e48fa15eb144c783f18659ed (diff)
iommu/tegra: smmu: Enable all SWGRP by default
Revisited later with new conf passed from DT. Change-Id: Ic94a698b0ee56603bbb7f2204ae8c5412ea133b1 Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/114213 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/tegra-smmu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index bf33c0302257..4484459601b4 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -38,6 +38,9 @@
#include <mach/smmu.h>
#include <mach/tegra_smmu.h>
+/* REVISIT: With new configurations for t114/124/148 passed from DT */
+#define SKIP_SWGRP_CHECK
+
/* bitmap of the page sizes currently supported */
#define SMMU_IOMMU_PGSIZES (SZ_4K)
@@ -316,11 +319,15 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c,
offs = HWGRP_ASID_REG(i);
val = smmu_read(smmu, offs);
if (on) {
+#if !defined(SKIP_SWGRP_CHECK)
if (WARN_ON(val & mask))
goto err_hw_busy;
+#endif
val |= mask;
} else {
+#if !defined(SKIP_SWGRP_CHECK)
WARN_ON((val & mask) == mask);
+#endif
val &= ~mask;
}
smmu_write(smmu, val, offs);
@@ -701,9 +708,15 @@ static int smmu_iommu_attach_dev(struct iommu_domain *domain,
return -ENOMEM;
client->dev = dev;
client->as = as;
+
+#ifdef SKIP_SWGRP_CHECK
+ /* Enable all SWGRP blindly by default */
+ map = (1 << HWGRP_COUNT) - 1;
+#else
map = (unsigned long)dev->platform_data;
if (!map)
return -EINVAL;
+#endif
err = smmu_client_enable_hwgrp(client, map);
if (err)