diff options
author | Hiroshi Doyu <hdoyu@nvidia.com> | 2013-10-14 14:39:57 +0300 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2013-10-14 04:43:06 -0700 |
commit | 7147696d22e0e25b98bd8674899331149bb009bc (patch) | |
tree | 7c0360935a9605bcb03863ef84867c052289c579 /drivers/iommu | |
parent | da7b1b9cb13389a8e25df49f5f52a012295c037d (diff) |
Revert "ARM: tegra: Redefine SWGROUP ID"
This reverts commit d6d56590c5c36d2f6e172e8e0e26d100be5125a3.
Change-Id: I855b4ce189ec3756f41a7c5c17194af6cc65a235
Reviewed-on: http://git-master/r/298949
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index ab05430ac6f3..a674f6473c17 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -303,21 +303,15 @@ static const u32 smmu_asid_security_ofs[] = { SMMU_ASID_SECURITY_7, }; -static size_t tegra_smmu_get_offset(int id) +static size_t tegra_smmu_get_offset_base(int id) { - switch (id) { - case SWGID_DC14: - return 0x490; - case SWGID_DC12: - return 0xa88; - case SWGID_AFI...SWGID_ISP: - case SWGID_MPE...SWGID_PPCS1: - return (id - SWGID_AFI) * sizeof(u32) + SMMU_AFI_ASID; - case SWGID_SDMMC1A...63: - return (id - SWGID_SDMMC1A) * sizeof(u32) + 0xa94; - }; + if (!(id & BIT(5))) + return SMMU_SWGRP_ASID_BASE; + + if (id & BIT(4)) + return 0xa88 - SWGID_DC12 * sizeof(u32); - BUG(); + return 0x490 - SWGID_DC14 * sizeof(u32); } /* @@ -486,7 +480,7 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, u64 map, int on) if (i == SWGID_AFI) continue; - offs = tegra_smmu_get_offset(i); + offs = i * sizeof(u32) + tegra_smmu_get_offset_base(i); val = smmu_read(smmu, offs); val &= ~3; /* always overwrite ASID */ |