Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
[pandora-kernel.git] / drivers / staging / tidspbridge / include / dspbridge / dsp-mmu.h
1 /*
2  * dsp-mmu.h
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * DSP iommu.
7  *
8  * Copyright (C) 2005-2010 Texas Instruments, Inc.
9  *
10  * This package is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  *
14  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  */
18
19 #ifndef _DSP_MMU_
20 #define _DSP_MMU_
21
22 #include <plat/iommu.h>
23 #include <plat/iovmm.h>
24
25 /**
26  * dsp_mmu_init() - initialize dsp_mmu module and returns a handle
27  *
28  * This function initialize dsp mmu module and returns a struct iommu
29  * handle to use it for dsp maps.
30  *
31  */
32 struct iommu *dsp_mmu_init(void);
33
34 /**
35  * dsp_mmu_exit() - destroy dsp mmu module
36  * @mmu:        Pointer to iommu handle.
37  *
38  * This function destroys dsp mmu module.
39  *
40  */
41 void dsp_mmu_exit(struct iommu *mmu);
42
43 /**
44  * user_to_dsp_map() - maps user to dsp virtual address
45  * @mmu:        Pointer to iommu handle.
46  * @uva:                Virtual user space address.
47  * @da          DSP address
48  * @size                Buffer size to map.
49  * @usr_pgs     struct page array pointer where the user pages will be stored
50  *
51  * This function maps a user space buffer into DSP virtual address.
52  *
53  */
54 u32 user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
55                                                 struct page **usr_pgs);
56
57 /**
58  * user_to_dsp_unmap() - unmaps DSP virtual buffer.
59  * @mmu:        Pointer to iommu handle.
60  * @da          DSP address
61  *
62  * This function unmaps a user space buffer into DSP virtual address.
63  *
64  */
65 int user_to_dsp_unmap(struct iommu *mmu, u32 da);
66
67 #endif