···11+/*22+ * omap iommu: simple virtual address space management33+ *44+ * Copyright (C) 2008-2009 Nokia Corporation55+ *66+ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+ */1212+1313+#ifndef _INTEL_IOMMU_H_1414+#define _INTEL_IOMMU_H_1515+1616+struct iovm_struct {1717+ struct omap_iommu *iommu; /* iommu object which this belongs to */1818+ u32 da_start; /* area definition */1919+ u32 da_end;2020+ u32 flags; /* IOVMF_: see below */2121+ struct list_head list; /* linked in ascending order */2222+ const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */2323+ void *va; /* mpu side mapped address */2424+};2525+2626+#define MMU_RAM_ENDIAN_SHIFT 92727+#define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT)2828+#define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT)2929+#define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE3030+#define MMU_RAM_ELSZ_SHIFT 73131+#define IOVMF_ELSZ_8 MMU_RAM_ELSZ_83232+3333+struct iommu_domain;3434+3535+extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da);3636+extern u323737+omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da,3838+ const struct sg_table *sgt, u32 flags);3939+extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain,4040+ struct device *dev, u32 da);4141+extern u324242+omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev,4343+ u32 da, size_t bytes, u32 flags);4444+extern void4545+omap_iommu_vfree(struct iommu_domain *domain, struct device *dev,4646+ const u32 da);4747+extern void *omap_da_to_va(struct device *dev, u32 da);4848+4949+extern void omap_iommu_save_ctx(struct device *dev);5050+extern void omap_iommu_restore_ctx(struct device *dev);5151+5252+#endif
+49
include/linux/platform_data/iommu-omap.h
···11+/*22+ * omap iommu: main structures33+ *44+ * Copyright (C) 2008-2009 Nokia Corporation55+ *66+ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+ */1212+1313+#define MMU_REG_SIZE 2561414+1515+/**1616+ * struct iommu_arch_data - omap iommu private data1717+ * @name: name of the iommu device1818+ * @iommu_dev: handle of the iommu device1919+ *2020+ * This is an omap iommu private data object, which binds an iommu user2121+ * to its iommu device. This object should be placed at the iommu user's2222+ * dev_archdata so generic IOMMU API can be used without having to2323+ * utilize omap-specific plumbing anymore.2424+ */2525+struct omap_iommu_arch_data {2626+ const char *name;2727+ struct omap_iommu *iommu_dev;2828+};2929+3030+/**3131+ * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod3232+ * @da_start: device address where the va space starts.3333+ * @da_end: device address where the va space ends.3434+ * @nr_tlb_entries: number of entries supported by the translation3535+ * look-aside buffer (TLB).3636+ */3737+struct omap_mmu_dev_attr {3838+ u32 da_start;3939+ u32 da_end;4040+ int nr_tlb_entries;4141+};4242+4343+struct iommu_platform_data {4444+ const char *name;4545+ const char *clk_name;4646+ const int nr_tlb_entries;4747+ u32 da_start;4848+ u32 da_end;4949+};