summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/iommu2.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/iommu2.c')
-rw-r--r--arch/arm/mach-omap2/iommu2.c43
1 files changed, 14 insertions, 29 deletions
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index 74ba75b87af..ae66be2cb59 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -85,6 +85,11 @@ static void __iommu_set_twl(struct iommu *obj, bool on)
iommu_write_reg(obj, l, MMU_CNTL);
}
+static u32 omap2_get_version(struct iommu *obj)
+{
+ return iommu_read_reg(obj, MMU_REVISION);
+}
+
static int omap2_iommu_enable(struct iommu *obj)
{
u32 l, pa;
@@ -129,6 +134,9 @@ static int omap2_iommu_enable(struct iommu *obj)
__iommu_set_twl(obj, true);
+ if (cpu_is_omap44xx())
+ iommu_write_reg(obj, 0x1, MMU_GP_REG);
+
return 0;
}
@@ -286,41 +294,20 @@ static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t len)
pr_reg(READ_CAM);
pr_reg(READ_RAM);
pr_reg(EMU_FAULT_AD);
+if (cpu_is_omap44xx()) {
+ pr_reg(FAULT_PC);
+ pr_reg(FAULT_STATUS);
+}
out:
return p - buf;
}
-static void omap2_iommu_save_ctx(struct iommu *obj)
-{
- int i;
- u32 *p = obj->ctx;
-
- for (i = 0; i < (MMU_REG_SIZE / sizeof(u32)); i++) {
- p[i] = iommu_read_reg(obj, i * sizeof(u32));
- dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
- }
-
- BUG_ON(p[0] != IOMMU_ARCH_VERSION);
-}
-
-static void omap2_iommu_restore_ctx(struct iommu *obj)
-{
- int i;
- u32 *p = obj->ctx;
-
- for (i = 0; i < (MMU_REG_SIZE / sizeof(u32)); i++) {
- iommu_write_reg(obj, p[i], i * sizeof(u32));
- dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
- }
-
- BUG_ON(p[0] != IOMMU_ARCH_VERSION);
-}
-
static void omap2_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
{
e->da = cr->cam & MMU_CAM_VATAG_MASK;
e->pa = cr->ram & MMU_RAM_PADDR_MASK;
e->valid = cr->cam & MMU_CAM_V;
+ e->prsvd = cr->cam & MMU_CAM_P;
e->pgsz = cr->cam & MMU_CAM_PGSZ_MASK;
e->endian = cr->ram & MMU_RAM_ENDIAN_MASK;
e->elsz = cr->ram & MMU_RAM_ELSZ_MASK;
@@ -328,7 +315,7 @@ static void omap2_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
}
static const struct iommu_functions omap2_iommu_ops = {
- .version = IOMMU_ARCH_VERSION,
+ .get_version = omap2_get_version,
.enable = omap2_iommu_enable,
.disable = omap2_iommu_disable,
@@ -346,8 +333,6 @@ static const struct iommu_functions omap2_iommu_ops = {
.get_pte_attr = omap2_get_pte_attr,
- .save_ctx = omap2_iommu_save_ctx,
- .restore_ctx = omap2_iommu_restore_ctx,
.dump_ctx = omap2_iommu_dump_ctx,
};