xref: /linux/drivers/staging/media/atomisp/pci/runtime/spctrl/interface/ia_css_spctrl_comm.h (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
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_SPCTRL_COMM_H__
17 #define __IA_CSS_SPCTRL_COMM_H__
18 
19 #include <linux/build_bug.h>
20 
21 #include <type_support.h>
22 
23 /* state of SP */
24 typedef enum {
25 	IA_CSS_SP_SW_TERMINATED = 0,
26 	IA_CSS_SP_SW_INITIALIZED,
27 	IA_CSS_SP_SW_CONNECTED,
28 	IA_CSS_SP_SW_RUNNING
29 } ia_css_spctrl_sp_sw_state;
30 
31 /* Structure to encapsulate required arguments for
32  * initialization of SP DMEM using the SP itself
33  */
34 struct ia_css_sp_init_dmem_cfg {
35 	ia_css_ptr      ddr_data_addr;  /** data segment address in ddr  */
36 	u32        dmem_data_addr; /** data segment address in dmem */
37 	u32        dmem_bss_addr;  /** bss segment address in dmem  */
38 	u32        data_size;      /** data segment size            */
39 	u32        bss_size;       /** bss segment size             */
40 	sp_ID_t         sp_id;          /* <sp Id */
41 };
42 
43 #define SIZE_OF_IA_CSS_SP_INIT_DMEM_CFG_STRUCT	\
44 	(1 * SIZE_OF_IA_CSS_PTR) +		\
45 	(4 * sizeof(uint32_t)) +		\
46 	(1 * sizeof(sp_ID_t))
47 
48 static_assert(sizeof(struct ia_css_sp_init_dmem_cfg) == SIZE_OF_IA_CSS_SP_INIT_DMEM_CFG_STRUCT);
49 
50 #endif /* __IA_CSS_SPCTRL_COMM_H__ */
51