File: omap-iommu.h

package info (click to toggle)
linux-tools 3.16-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 73,776 kB
  • sloc: ansic: 962,256; perl: 14,061; makefile: 6,629; sh: 5,629; cpp: 5,599; python: 4,547; asm: 4,106; yacc: 2,566; lex: 1,436; pascal: 80; awk: 6
file content (52 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * omap iommu: simple virtual address space management
 *
 * Copyright (C) 2008-2009 Nokia Corporation
 *
 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef _INTEL_IOMMU_H_
#define _INTEL_IOMMU_H_

struct iovm_struct {
	struct omap_iommu	*iommu;	/* iommu object which this belongs to */
	u32			da_start; /* area definition */
	u32			da_end;
	u32			flags; /* IOVMF_: see below */
	struct list_head	list; /* linked in ascending order */
	const struct sg_table	*sgt; /* keep 'page' <-> 'da' mapping */
	void			*va; /* mpu side mapped address */
};

#define MMU_RAM_ENDIAN_SHIFT	9
#define MMU_RAM_ENDIAN_LITTLE	(0 << MMU_RAM_ENDIAN_SHIFT)
#define MMU_RAM_ELSZ_8		(0 << MMU_RAM_ELSZ_SHIFT)
#define IOVMF_ENDIAN_LITTLE	MMU_RAM_ENDIAN_LITTLE
#define MMU_RAM_ELSZ_SHIFT	7
#define IOVMF_ELSZ_8		MMU_RAM_ELSZ_8

struct iommu_domain;

extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da);
extern u32
omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da,
			const struct sg_table *sgt, u32 flags);
extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain,
				struct device *dev, u32 da);
extern u32
omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev,
				u32 da, size_t bytes, u32 flags);
extern void
omap_iommu_vfree(struct iommu_domain *domain, struct device *dev,
				const u32 da);
extern void *omap_da_to_va(struct device *dev, u32 da);

extern void omap_iommu_save_ctx(struct device *dev);
extern void omap_iommu_restore_ctx(struct device *dev);

#endif