xref: /linux/drivers/staging/media/atomisp/pci/runtime/queue/interface/ia_css_queue_comm.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2010 - 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef __IA_CSS_QUEUE_COMM_H
17 #define __IA_CSS_QUEUE_COMM_H
18 
19 #include "type_support.h"
20 #include "ia_css_circbuf.h"
21 /*****************************************************************************
22  * Queue Public Data Structures
23  *****************************************************************************/
24 
25 /* Queue location specifier */
26 /* Avoiding enums to save space */
27 #define IA_CSS_QUEUE_LOC_HOST 0
28 #define IA_CSS_QUEUE_LOC_SP   1
29 #define IA_CSS_QUEUE_LOC_ISP  2
30 
31 /* Queue type specifier */
32 /* Avoiding enums to save space */
33 #define IA_CSS_QUEUE_TYPE_LOCAL  0
34 #define IA_CSS_QUEUE_TYPE_REMOTE 1
35 
36 /* for DDR Allocated queues,
37 allocate minimum these many elements.
38 DDR->SP' DMEM DMA transfer needs 32byte aligned address.
39 Since each element size is 4 bytes, 8 elements need to be
40 DMAed to access single element.*/
41 #define IA_CSS_MIN_ELEM_COUNT    8
42 #define IA_CSS_DMA_XFER_MASK (IA_CSS_MIN_ELEM_COUNT - 1)
43 
44 /* Remote Queue object descriptor */
45 struct ia_css_queue_remote {
46 	u32 cb_desc_addr; /*Circbuf desc address for remote queues*/
47 	u32 cb_elems_addr; /*Circbuf elements addr for remote queue*/
48 	u8 location;    /* Cell location for queue */
49 	u8 proc_id;     /* Processor id for queue access */
50 };
51 
52 typedef struct ia_css_queue_remote ia_css_queue_remote_t;
53 
54 #endif /* __IA_CSS_QUEUE_COMM_H */
55