1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2010 - 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14 
15 #ifndef __IA_CSS_SPCTRL_H__
16 #define __IA_CSS_SPCTRL_H__
17 
18 #include <system_global.h>
19 #include <ia_css_err.h>
20 #include "ia_css_spctrl_comm.h"
21 
22 typedef struct {
23 	u32        ddr_data_offset;       /**  posistion of data in DDR */
24 	u32        dmem_data_addr;        /** data segment address in dmem */
25 	u32        dmem_bss_addr;         /** bss segment address in dmem  */
26 	u32        data_size;             /** data segment size            */
27 	u32        bss_size;              /** bss segment size             */
28 	u32        spctrl_config_dmem_addr; /* <location of dmem_cfg  in SP dmem */
29 	u32        spctrl_state_dmem_addr;  /* < location of state  in SP dmem */
30 	unsigned int    sp_entry;                /* < entry function ptr on SP */
31 	const void      *code;                   /** location of firmware */
32 	u32         code_size;
33 	char      *program_name;    /** not used on hardware, only for simulation */
34 } ia_css_spctrl_cfg;
35 
36 /* Get the code addr in DDR of SP */
37 ia_css_ptr get_sp_code_addr(sp_ID_t  sp_id);
38 
39 /* ! Load firmware on to specfied SP
40 */
41 int ia_css_spctrl_load_fw(sp_ID_t sp_id,
42 				      ia_css_spctrl_cfg *spctrl_cfg);
43 
44 /* ISP2401 */
45 /*! Setup registers for reloading FW */
46 void sh_css_spctrl_reload_fw(sp_ID_t sp_id);
47 
48 /*!  Unload/release any memory allocated to hold the firmware
49 */
50 int ia_css_spctrl_unload_fw(sp_ID_t sp_id);
51 
52 /*! Intilaize dmem_cfg in SP dmem  and  start SP program
53 */
54 int ia_css_spctrl_start(sp_ID_t sp_id);
55 
56 /*! stop spctrl
57 */
58 int ia_css_spctrl_stop(sp_ID_t sp_id);
59 
60 /*! Query the state of SP
61 */
62 ia_css_spctrl_sp_sw_state ia_css_spctrl_get_state(sp_ID_t sp_id);
63 
64 /*! Check if SP is idle/ready
65 */
66 int ia_css_spctrl_is_idle(sp_ID_t sp_id);
67 
68 #endif /* __IA_CSS_SPCTRL_H__ */
69