iommu/omap: Migrate to hwmod framework
Use hwmod data and device attributes to build and register an omap device for iommu driver. - Update the naming convention in isp module. - Remove unneeded check for number of resources, as this is now handled by omap_device and prevents driver from loading. - Now unused, remove platform device and resource data, handling of sysconfig register for softreset purposes, use default latency structure. - Use hwmod API for reset handling. Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org> Tested-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
This commit is contained in:

committed by
Joerg Roedel

parent
87f8e57327
commit
72b15b6ae9
@@ -35,12 +35,8 @@
|
||||
#define MMU_SYS_IDLE_SMART (2 << MMU_SYS_IDLE_SHIFT)
|
||||
#define MMU_SYS_IDLE_MASK (3 << MMU_SYS_IDLE_SHIFT)
|
||||
|
||||
#define MMU_SYS_SOFTRESET (1 << 1)
|
||||
#define MMU_SYS_AUTOIDLE 1
|
||||
|
||||
/* SYSSTATUS */
|
||||
#define MMU_SYS_RESETDONE 1
|
||||
|
||||
/* IRQSTATUS & IRQENABLE */
|
||||
#define MMU_IRQ_MULTIHITFAULT (1 << 4)
|
||||
#define MMU_IRQ_TABLEWALKFAULT (1 << 3)
|
||||
@@ -97,7 +93,6 @@ static void __iommu_set_twl(struct omap_iommu *obj, bool on)
|
||||
static int omap2_iommu_enable(struct omap_iommu *obj)
|
||||
{
|
||||
u32 l, pa;
|
||||
unsigned long timeout;
|
||||
|
||||
if (!obj->iopgd || !IS_ALIGNED((u32)obj->iopgd, SZ_16K))
|
||||
return -EINVAL;
|
||||
@@ -106,20 +101,6 @@ static int omap2_iommu_enable(struct omap_iommu *obj)
|
||||
if (!IS_ALIGNED(pa, SZ_16K))
|
||||
return -EINVAL;
|
||||
|
||||
iommu_write_reg(obj, MMU_SYS_SOFTRESET, MMU_SYSCONFIG);
|
||||
|
||||
timeout = jiffies + msecs_to_jiffies(20);
|
||||
do {
|
||||
l = iommu_read_reg(obj, MMU_SYSSTATUS);
|
||||
if (l & MMU_SYS_RESETDONE)
|
||||
break;
|
||||
} while (!time_after(jiffies, timeout));
|
||||
|
||||
if (!(l & MMU_SYS_RESETDONE)) {
|
||||
dev_err(obj->dev, "can't take mmu out of reset\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
l = iommu_read_reg(obj, MMU_REVISION);
|
||||
dev_info(obj->dev, "%s: version %d.%d\n", obj->name,
|
||||
(l >> 4) & 0xf, l & 0xf);
|
||||
|
Reference in New Issue
Block a user