2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
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.
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
18 #include <system_global.h>
19 #include <type_support.h>
20 #if !defined(HAS_NO_INPUT_FORMATTER)
21 #include "input_formatter.h"
24 #include "ia_css_binary.h"
25 #include "ia_css_types.h"
26 #include "ia_css_pipeline.h"
28 /* Function to initialize the data and bss section descr of the binary */
30 sh_css_sp_store_init_dmem(const struct ia_css_fw_info *fw);
33 store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num, unsigned stage);
36 sh_css_stage_write_binary_info(struct ia_css_binary_info *info);
39 store_sp_group_data(void);
41 /* Start binary (jpeg) copy on the SP */
43 sh_css_sp_start_binary_copy(unsigned int pipe_num, struct ia_css_frame *out_frame,
47 sh_css_sp_get_binary_copy_size(void);
49 /* Return the value of a SW interrupt */
51 sh_css_sp_get_sw_interrupt_value(unsigned int irq);
54 sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
55 enum ia_css_pipe_id id,
61 unsigned int required_bds_factor,
62 enum sh_css_pipe_config_override copy_ovrd,
63 enum ia_css_input_mode input_mode,
64 const struct ia_css_metadata_config *md_config,
65 const struct ia_css_metadata_info *md_info,
66 #if !defined(HAS_NO_INPUT_SYSTEM)
67 const mipi_port_ID_t port_id
71 const struct ia_css_coordinate *internal_frame_origin_bqs_on_sctbl, /* Origin of internal frame
72 positioned on shading table at shading correction in ISP. */
73 const struct ia_css_isp_parameters *params
78 sh_css_sp_uninit_pipeline(unsigned int pipe_num);
80 bool sh_css_write_host2sp_command(enum host2sp_commands host2sp_command);
83 sh_css_read_host2sp_command(void);
86 sh_css_init_host2sp_frame_data(void);
89 * @brief Update the offline frame information in host_sp_communication.
91 * @param[in] frame_num The offline frame number.
92 * @param[in] frame The pointer to the offline frame.
95 sh_css_update_host2sp_offline_frame(
97 struct ia_css_frame *frame,
98 struct ia_css_metadata *metadata);
100 #if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
102 * @brief Update the mipi frame information in host_sp_communication.
104 * @param[in] frame_num The mipi frame number.
105 * @param[in] frame The pointer to the mipi frame.
108 sh_css_update_host2sp_mipi_frame(
110 struct ia_css_frame *frame);
113 * @brief Update the mipi metadata information in host_sp_communication.
115 * @param[in] frame_num The mipi frame number.
116 * @param[in] metadata The pointer to the mipi metadata.
119 sh_css_update_host2sp_mipi_metadata(
121 struct ia_css_metadata *metadata);
124 * @brief Update the nr of mipi frames to use in host_sp_communication.
126 * @param[in] num_frames The number of mipi frames to use.
129 sh_css_update_host2sp_num_mipi_frames(unsigned num_frames);
133 * @brief Update the nr of offline frames to use in host_sp_communication.
135 * @param[in] num_frames The number of raw frames to use.
138 sh_css_update_host2sp_cont_num_raw_frames(unsigned num_frames, bool set_avail);
141 sh_css_event_init_irq_mask(void);
144 sh_css_sp_start_isp(void);
147 sh_css_sp_set_sp_running(bool flag);
150 sh_css_sp_is_running(void);
152 #if SP_DEBUG != SP_DEBUG_NONE
155 sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state);
159 #if !defined(HAS_NO_INPUT_FORMATTER)
161 sh_css_sp_set_if_configs(
162 const input_formatter_cfg_t *config_a,
163 const input_formatter_cfg_t *config_b,
164 const uint8_t if_config_index);
168 sh_css_sp_program_input_circuit(int fmt_type,
170 enum ia_css_input_mode input_mode);
173 sh_css_sp_configure_sync_gen(int width,
179 sh_css_sp_configure_tpg(int x_mask,
186 sh_css_sp_configure_prbs(int seed);
189 sh_css_sp_configure_enable_raw_pool_locking(bool lock_all);
192 sh_css_sp_enable_isys_event_queue(bool enable);
195 sh_css_sp_set_disable_continuous_viewfinder(bool flag);
198 sh_css_sp_reset_global_vars(void);
201 * @brief Initialize the DMA software-mask in the debug mode.
202 * This API should be ONLY called in the debugging mode.
203 * And it should be always called before the first call of
204 * "sh_css_set_dma_sw_reg(...)".
206 * @param[in] dma_id The ID of the target DMA.
209 * - true, if it is successful.
210 * - false, otherwise.
213 sh_css_sp_init_dma_sw_reg(int dma_id);
216 * @brief Set the DMA software-mask in the debug mode.
217 * This API should be ONLYL called in the debugging mode. Must
218 * call "sh_css_set_dma_sw_reg(...)" before this
219 * API is called for the first time.
221 * @param[in] dma_id The ID of the target DMA.
222 * @param[in] channel_id The ID of the target DMA channel.
223 * @param[in] request_type The type of the DMA request.
225 * - "0" indicates the writing request.
226 * - "1" indicates the reading request.
228 * @param[in] enable If it is "true", the target DMA
229 * channel is enabled in the software.
230 * Otherwise, the target DMA channel
231 * is disabled in the software.
234 * - true, if it is successful.
235 * - false, otherwise.
238 sh_css_sp_set_dma_sw_reg(int dma_id,
244 extern struct sh_css_sp_group sh_css_sp_group;
245 extern struct sh_css_sp_stage sh_css_sp_stage;
246 extern struct sh_css_isp_stage sh_css_isp_stage;
248 #endif /* _SH_CSS_SP_H_ */