iommu: msm: Refactor ASID assignment
Each context bank has an assigned ASID. Context banks sharing a page
table use the same ASID.
Instead of reading the ASID assigned to context banks store the
ASID in an array with a usage count. The index into the array is
the ASID value - 1. ASID assignments starts at 1. The number of
possible ASID values is equal to the number of context banks.
Change-Id: Ia332875505338b79a0b35679b92faf0a5aa2db84
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
diff --git a/arch/arm/mach-msm/include/mach/iommu.h b/arch/arm/mach-msm/include/mach/iommu.h
index c6e93de..923e4da 100644
--- a/arch/arm/mach-msm/include/mach/iommu.h
+++ b/arch/arm/mach-msm/include/mach/iommu.h
@@ -96,6 +96,7 @@
* @list: List head to link all iommus together
* @clk_reg_virt: Optional clock register virtual address.
* @halt_enabled: Set to 1 if IOMMU halt is supported in the IOMMU, 0 otherwise.
+ * @asid: List of ASID and their usage count (index is ASID value).
*
* A msm_iommu_drvdata holds the global driver data about a single piece
* of an IOMMU hardware instance.
@@ -117,6 +118,7 @@
struct list_head list;
void __iomem *clk_reg_virt;
int halt_enabled;
+ int *asid;
};
void msm_iommu_add_drv(struct msm_iommu_drvdata *drv);