diff options
| author | Olof Johansson <olof@lixom.net> | 2012-12-01 00:38:59 -0500 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2012-12-01 00:38:59 -0500 |
| commit | 794b175fc0c0c4844dbb7b137a73bbfd01f6c608 (patch) | |
| tree | 69b9394b5b09118f9877cd02838a7cd2d7c4f63c /include/linux | |
| parent | 4fabb6332a2b747c7f6783f146a8fb3d2f88d91c (diff) | |
| parent | 2ab7c84815cffd5fe4946a472fc67fefa8ac3c29 (diff) | |
Merge tag 'omap-for-v3.8/cleanup-headers-iommu-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup
From Tony Lindgren:
Move most of remaining omap iommu code to drivers/iommu.
This is needed for the multiplatform kernels as the plat
and mach headers cannot be included.
These changes were agreed to be merged via the arm-soc
tree by Joerg and Ohad as these will cause some merge
conflicts with the other related clean-up branches.
So omap-for-v3.8/cleanup-headers-iommu should be added
as one of the depends branches for arm-soc.
* tag 'omap-for-v3.8/cleanup-headers-iommu-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP2+: Move iommu/iovmm headers to platform_data
ARM: OMAP2+: Make some definitions local
ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c
ARM: OMAP2+: Move plat/iovmm.h to include/linux/omap-iommu.h
ARM: OMAP2+: Move iopgtable header to drivers/iommu/
ARM: OMAP: Merge iommu2.h into iommu.h
Conflicts due to surrounding changes fixed up in:
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
drivers/media/platform/omap3isp/ispvideo.c
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/omap-iommu.h | 52 | ||||
| -rw-r--r-- | include/linux/platform_data/iommu-omap.h | 49 |
2 files changed, 101 insertions, 0 deletions
diff --git a/include/linux/omap-iommu.h b/include/linux/omap-iommu.h new file mode 100644 index 000000000000..cac78de09c07 --- /dev/null +++ b/include/linux/omap-iommu.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* | ||
| 2 | * omap iommu: simple virtual address space management | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008-2009 Nokia Corporation | ||
| 5 | * | ||
| 6 | * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef _INTEL_IOMMU_H_ | ||
| 14 | #define _INTEL_IOMMU_H_ | ||
| 15 | |||
| 16 | struct iovm_struct { | ||
| 17 | struct omap_iommu *iommu; /* iommu object which this belongs to */ | ||
| 18 | u32 da_start; /* area definition */ | ||
| 19 | u32 da_end; | ||
| 20 | u32 flags; /* IOVMF_: see below */ | ||
| 21 | struct list_head list; /* linked in ascending order */ | ||
| 22 | const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */ | ||
| 23 | void *va; /* mpu side mapped address */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | #define MMU_RAM_ENDIAN_SHIFT 9 | ||
| 27 | #define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT) | ||
| 28 | #define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT) | ||
| 29 | #define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE | ||
| 30 | #define MMU_RAM_ELSZ_SHIFT 7 | ||
| 31 | #define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8 | ||
| 32 | |||
| 33 | struct iommu_domain; | ||
| 34 | |||
| 35 | extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da); | ||
| 36 | extern u32 | ||
| 37 | omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da, | ||
| 38 | const struct sg_table *sgt, u32 flags); | ||
| 39 | extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain, | ||
| 40 | struct device *dev, u32 da); | ||
| 41 | extern u32 | ||
| 42 | omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev, | ||
| 43 | u32 da, size_t bytes, u32 flags); | ||
| 44 | extern void | ||
| 45 | omap_iommu_vfree(struct iommu_domain *domain, struct device *dev, | ||
| 46 | const u32 da); | ||
| 47 | extern void *omap_da_to_va(struct device *dev, u32 da); | ||
| 48 | |||
| 49 | extern void omap_iommu_save_ctx(struct device *dev); | ||
| 50 | extern void omap_iommu_restore_ctx(struct device *dev); | ||
| 51 | |||
| 52 | #endif | ||
diff --git a/include/linux/platform_data/iommu-omap.h b/include/linux/platform_data/iommu-omap.h new file mode 100644 index 000000000000..c677b9f2fefa --- /dev/null +++ b/include/linux/platform_data/iommu-omap.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* | ||
| 2 | * omap iommu: main structures | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008-2009 Nokia Corporation | ||
| 5 | * | ||
| 6 | * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #define MMU_REG_SIZE 256 | ||
| 14 | |||
| 15 | /** | ||
| 16 | * struct iommu_arch_data - omap iommu private data | ||
| 17 | * @name: name of the iommu device | ||
| 18 | * @iommu_dev: handle of the iommu device | ||
| 19 | * | ||
| 20 | * This is an omap iommu private data object, which binds an iommu user | ||
| 21 | * to its iommu device. This object should be placed at the iommu user's | ||
| 22 | * dev_archdata so generic IOMMU API can be used without having to | ||
| 23 | * utilize omap-specific plumbing anymore. | ||
| 24 | */ | ||
| 25 | struct omap_iommu_arch_data { | ||
| 26 | const char *name; | ||
| 27 | struct omap_iommu *iommu_dev; | ||
| 28 | }; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod | ||
| 32 | * @da_start: device address where the va space starts. | ||
| 33 | * @da_end: device address where the va space ends. | ||
| 34 | * @nr_tlb_entries: number of entries supported by the translation | ||
| 35 | * look-aside buffer (TLB). | ||
| 36 | */ | ||
| 37 | struct omap_mmu_dev_attr { | ||
| 38 | u32 da_start; | ||
| 39 | u32 da_end; | ||
| 40 | int nr_tlb_entries; | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct iommu_platform_data { | ||
| 44 | const char *name; | ||
| 45 | const char *clk_name; | ||
| 46 | const int nr_tlb_entries; | ||
| 47 | u32 da_start; | ||
| 48 | u32 da_end; | ||
| 49 | }; | ||
