Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[linux-2.6-microblaze.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / runtime / spctrl / interface / ia_css_spctrl.h
1 #ifndef ISP2401
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 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 #else
16 /**
17 Support for Intel Camera Imaging ISP subsystem.
18 Copyright (c) 2010 - 2015, Intel Corporation.
19
20 This program is free software; you can redistribute it and/or modify it
21 under the terms and conditions of the GNU General Public License,
22 version 2, as published by the Free Software Foundation.
23
24 This program is distributed in the hope it will be useful, but WITHOUT
25 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
27 more details.
28 */
29 #endif
30
31 #ifndef __IA_CSS_SPCTRL_H__
32 #define __IA_CSS_SPCTRL_H__
33
34 #include <system_global.h>
35 #include <ia_css_err.h>
36 #include "ia_css_spctrl_comm.h"
37
38
39 typedef struct {
40         uint32_t        ddr_data_offset;       /**  posistion of data in DDR */
41         uint32_t        dmem_data_addr;        /** data segment address in dmem */
42         uint32_t        dmem_bss_addr;         /** bss segment address in dmem  */
43         uint32_t        data_size;             /** data segment size            */
44         uint32_t        bss_size;              /** bss segment size             */
45         uint32_t        spctrl_config_dmem_addr; /* <location of dmem_cfg  in SP dmem */
46         uint32_t        spctrl_state_dmem_addr;  /* < location of state  in SP dmem */
47         unsigned int    sp_entry;                /* < entry function ptr on SP */
48         const void      *code;                   /** location of firmware */
49         uint32_t         code_size;
50         char      *program_name;    /** not used on hardware, only for simulation */
51 } ia_css_spctrl_cfg;
52
53 /* Get the code addr in DDR of SP */
54 hrt_vaddress get_sp_code_addr(sp_ID_t  sp_id);
55
56 /* ! Load firmware on to specfied SP
57 */
58 enum ia_css_err ia_css_spctrl_load_fw(sp_ID_t sp_id,
59                         ia_css_spctrl_cfg *spctrl_cfg);
60
61 #ifdef ISP2401
62 /*! Setup registers for reloading FW */
63 void sh_css_spctrl_reload_fw(sp_ID_t sp_id);
64
65 #endif
66 /*!  Unload/release any memory allocated to hold the firmware
67 */
68 enum ia_css_err ia_css_spctrl_unload_fw(sp_ID_t sp_id);
69
70
71 /*! Intilaize dmem_cfg in SP dmem  and  start SP program
72 */
73 enum ia_css_err ia_css_spctrl_start(sp_ID_t sp_id);
74
75 /*! stop spctrl
76 */
77 enum ia_css_err ia_css_spctrl_stop(sp_ID_t sp_id);
78
79 /*! Query the state of SP
80 */
81 ia_css_spctrl_sp_sw_state ia_css_spctrl_get_state(sp_ID_t sp_id);
82
83 /*! Check if SP is idle/ready
84 */
85 int ia_css_spctrl_is_idle(sp_ID_t sp_id);
86
87 #endif /* __IA_CSS_SPCTRL_H__ */