]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/uapi/linux/pxp_device.h
ENGR00317981: pxp: forward pxp driver to 3.14 kernel
[karo-tx-linux.git] / include / uapi / linux / pxp_device.h
1 /*
2  * Copyright (C) 2013-2014 Freescale Semiconductor, Inc. All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17  *
18  */
19 #ifndef _UAPI_PXP_DEVICE
20 #define _UAPI_PXP_DEVICE
21
22 #include <linux/pxp_dma.h>
23
24 struct pxp_chan_handle {
25         unsigned int handle;
26         int hist_status;
27 };
28
29 struct pxp_mem_desc {
30         unsigned int handle;
31         unsigned int size;
32         dma_addr_t phys_addr;
33         unsigned int virt_uaddr;                /* virtual user space address */
34         unsigned int mtype;
35 };
36
37 struct pxp_mem_flush {
38         unsigned int handle;
39         unsigned int type;
40 };
41
42 #define PXP_IOC_MAGIC  'P'
43
44 #define PXP_IOC_GET_CHAN      _IOR(PXP_IOC_MAGIC, 0, struct pxp_mem_desc)
45 #define PXP_IOC_PUT_CHAN      _IOW(PXP_IOC_MAGIC, 1, struct pxp_mem_desc)
46 #define PXP_IOC_CONFIG_CHAN   _IOW(PXP_IOC_MAGIC, 2, struct pxp_mem_desc)
47 #define PXP_IOC_START_CHAN    _IOW(PXP_IOC_MAGIC, 3, struct pxp_mem_desc)
48 #define PXP_IOC_GET_PHYMEM    _IOWR(PXP_IOC_MAGIC, 4, struct pxp_mem_desc)
49 #define PXP_IOC_PUT_PHYMEM    _IOW(PXP_IOC_MAGIC, 5, struct pxp_mem_desc)
50 #define PXP_IOC_WAIT4CMPLT    _IOWR(PXP_IOC_MAGIC, 6, struct pxp_mem_desc)
51 #define PXP_IOC_FLUSH_PHYMEM   _IOR(PXP_IOC_MAGIC, 7, struct pxp_mem_flush)
52
53 /* Memory types supported*/
54 #define MEMORY_TYPE_UNCACHED 0x0
55 #define MEMORY_TYPE_WC       0x1
56 #define MEMORY_TYPE_CACHED   0x2
57
58 /* Cache flush operations */
59 #define CACHE_CLEAN      0x1
60 #define CACHE_INVALIDATE 0x2
61 #define CACHE_FLUSH      0x4
62
63 #endif