1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
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.
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
19 #include <system_global.h>
20 #include <type_support.h>
22 #include "input_formatter.h"
25 #include "ia_css_binary.h"
26 #include "ia_css_types.h"
27 #include "ia_css_pipeline.h"
29 /* Function to initialize the data and bss section descr of the binary */
31 sh_css_sp_store_init_dmem(const struct ia_css_fw_info *fw);
34 store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num,
38 sh_css_stage_write_binary_info(struct ia_css_binary_info *info);
41 store_sp_group_data(void);
43 /* Start binary (jpeg) copy on the SP */
45 sh_css_sp_start_binary_copy(unsigned int pipe_num,
46 struct ia_css_frame *out_frame,
47 unsigned int two_ppc);
50 sh_css_sp_get_binary_copy_size(void);
52 /* Return the value of a SW interrupt */
54 sh_css_sp_get_sw_interrupt_value(unsigned int irq);
57 sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
58 enum ia_css_pipe_id id,
64 unsigned int required_bds_factor,
65 enum sh_css_pipe_config_override copy_ovrd,
66 enum ia_css_input_mode input_mode,
67 const struct ia_css_metadata_config *md_config,
68 const struct ia_css_metadata_info *md_info,
69 const enum mipi_port_id port_id);
72 sh_css_sp_uninit_pipeline(unsigned int pipe_num);
74 bool sh_css_write_host2sp_command(enum host2sp_commands host2sp_command);
77 sh_css_read_host2sp_command(void);
80 sh_css_init_host2sp_frame_data(void);
83 * @brief Update the offline frame information in host_sp_communication.
85 * @param[in] frame_num The offline frame number.
86 * @param[in] frame The pointer to the offline frame.
89 sh_css_update_host2sp_offline_frame(
90 unsigned int frame_num,
91 struct ia_css_frame *frame,
92 struct ia_css_metadata *metadata);
95 * @brief Update the mipi frame information in host_sp_communication.
97 * @param[in] frame_num The mipi frame number.
98 * @param[in] frame The pointer to the mipi frame.
101 sh_css_update_host2sp_mipi_frame(
102 unsigned int frame_num,
103 struct ia_css_frame *frame);
106 * @brief Update the mipi metadata information in host_sp_communication.
108 * @param[in] frame_num The mipi frame number.
109 * @param[in] metadata The pointer to the mipi metadata.
112 sh_css_update_host2sp_mipi_metadata(
113 unsigned int frame_num,
114 struct ia_css_metadata *metadata);
117 * @brief Update the nr of mipi frames to use in host_sp_communication.
119 * @param[in] num_frames The number of mipi frames to use.
122 sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames);
125 * @brief Update the nr of offline frames to use in host_sp_communication.
127 * @param[in] num_frames The number of raw frames to use.
130 sh_css_update_host2sp_cont_num_raw_frames(unsigned int num_frames,
134 sh_css_event_init_irq_mask(void);
137 sh_css_sp_start_isp(void);
140 sh_css_sp_set_sp_running(bool flag);
143 sh_css_sp_is_running(void);
145 #if SP_DEBUG != SP_DEBUG_NONE
148 sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state);
152 #if !defined(ISP2401)
154 sh_css_sp_set_if_configs(
155 const input_formatter_cfg_t *config_a,
156 const input_formatter_cfg_t *config_b,
157 const uint8_t if_config_index);
161 sh_css_sp_program_input_circuit(int fmt_type,
163 enum ia_css_input_mode input_mode);
166 sh_css_sp_configure_sync_gen(int width,
172 sh_css_sp_configure_tpg(int x_mask,
179 sh_css_sp_configure_prbs(int seed);
182 sh_css_sp_configure_enable_raw_pool_locking(bool lock_all);
185 sh_css_sp_enable_isys_event_queue(bool enable);
188 sh_css_sp_set_disable_continuous_viewfinder(bool flag);
191 sh_css_sp_reset_global_vars(void);
194 * @brief Initialize the DMA software-mask in the debug mode.
195 * This API should be ONLY called in the debugging mode.
196 * And it should be always called before the first call of
197 * "sh_css_set_dma_sw_reg(...)".
199 * @param[in] dma_id The ID of the target DMA.
202 * - true, if it is successful.
203 * - false, otherwise.
206 sh_css_sp_init_dma_sw_reg(int dma_id);
209 * @brief Set the DMA software-mask in the debug mode.
210 * This API should be ONLYL called in the debugging mode. Must
211 * call "sh_css_set_dma_sw_reg(...)" before this
212 * API is called for the first time.
214 * @param[in] dma_id The ID of the target DMA.
215 * @param[in] channel_id The ID of the target DMA channel.
216 * @param[in] request_type The type of the DMA request.
218 * - "0" indicates the writing request.
219 * - "1" indicates the reading request.
221 * @param[in] enable If it is "true", the target DMA
222 * channel is enabled in the software.
223 * Otherwise, the target DMA channel
224 * is disabled in the software.
227 * - true, if it is successful.
228 * - false, otherwise.
231 sh_css_sp_set_dma_sw_reg(int dma_id,
236 extern struct sh_css_sp_group sh_css_sp_group;
237 extern struct sh_css_sp_stage sh_css_sp_stage;
238 extern struct sh_css_isp_stage sh_css_isp_stage;
240 #endif /* _SH_CSS_SP_H_ */