diff options
Diffstat (limited to 'arch/arm/plat-omap/include/plat/iommu.h')
-rw-r--r-- | arch/arm/plat-omap/include/plat/iommu.h | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h index 174f1b9c8c0..cdccd7a969f 100644 --- a/arch/arm/plat-omap/include/plat/iommu.h +++ b/arch/arm/plat-omap/include/plat/iommu.h @@ -13,6 +13,8 @@ #ifndef __MACH_IOMMU_H #define __MACH_IOMMU_H +#include <linux/list.h> + struct iotlb_entry { u32 da; u32 pa; @@ -28,7 +30,6 @@ struct iotlb_entry { struct iommu { const char *name; struct module *owner; - struct clk *clk; void __iomem *regbase; struct device *dev; void *isr_priv; @@ -42,17 +43,20 @@ struct iommu { */ u32 *iopgd; spinlock_t page_table_lock; /* protect iopgd */ - int nr_tlb_entries; struct list_head mmap; struct mutex mmap_lock; /* protect mmap */ - int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs, void *priv); - void *ctx; /* iommu context: registres saved area */ + struct raw_notifier_head notifier; + u32 da_start; u32 da_end; + struct iotlb_entry *tlbs_e;/* iommu tlbs context: saved area */ + struct platform_device *pdev; + struct list_head event_list; + spinlock_t event_lock; }; struct cr_regs { @@ -72,6 +76,12 @@ struct cr_regs { }; }; +struct iommu_event_ntfy { + u32 fd; + struct eventfd_ctx *evt_ctx; + struct list_head list; +}; + struct iotlb_lock { short base; short vict; @@ -79,7 +89,7 @@ struct iotlb_lock { /* architecture specific functions */ struct iommu_functions { - unsigned long version; + u32 (*get_version)(struct iommu *obj); int (*enable)(struct iommu *obj); void (*disable)(struct iommu *obj); @@ -97,17 +107,22 @@ struct iommu_functions { u32 (*get_pte_attr)(struct iotlb_entry *e); - void (*save_ctx)(struct iommu *obj); - void (*restore_ctx)(struct iommu *obj); ssize_t (*dump_ctx)(struct iommu *obj, char *buf, ssize_t len); }; +enum { + IOMMU_FAULT, + IOMMU_CLOSE, +}; + struct iommu_platform_data { const char *name; - const char *clk_name; + const char *oh_name; const int nr_tlb_entries; u32 da_start; u32 da_end; + int irq; + void __iomem *io_base; }; /* IOMMU errors */ @@ -150,11 +165,17 @@ struct iommu_platform_data { /* * global functions */ -extern u32 iommu_arch_version(void); +extern u32 iommu_arch_version(struct iommu *obj); extern void iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e); extern u32 iotlb_cr_to_virt(struct cr_regs *cr); +extern int iommu_register_notifier(struct iommu *obj, + struct notifier_block *nb); +extern int iommu_unregister_notifier(struct iommu *obj, + struct notifier_block *nb); +extern int iommu_notify_event(struct iommu *obj, int event, void *data); + extern int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e); extern void iommu_set_twl(struct iommu *obj, bool on); extern void flush_iotlb_page(struct iommu *obj, u32 da); @@ -165,6 +186,7 @@ extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e); extern void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte); extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova); +extern void iopgtable_clear_entry_all(struct iommu *obj); extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end); extern struct iommu *iommu_get(const char *name); @@ -174,8 +196,10 @@ extern int iommu_set_isr(const char *name, void *priv), void *isr_priv); -extern void iommu_save_ctx(struct iommu *obj); -extern void iommu_restore_ctx(struct iommu *obj); +u32 iommu_save_ctx(struct iommu *obj); +u32 iommu_restore_ctx(struct iommu *obj); +u32 iommu_save_tlb_entries(struct iommu *obj); +u32 iommu_restore_tlb_entries(struct iommu *obj); extern int install_iommu_arch(const struct iommu_functions *ops); extern void uninstall_iommu_arch(const struct iommu_functions *ops); @@ -185,5 +209,5 @@ extern int foreach_iommu_device(void *data, extern ssize_t iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t len); extern size_t dump_tlb_entries(struct iommu *obj, char *buf, ssize_t len); - +extern int iommu_get_plat_data_size(void); #endif /* __MACH_IOMMU_H */ |