Suresh Vankadara | c092e59 | 2018-01-11 18:52:41 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef CAM_ICP_HW_MGR_H |
| 14 | #define CAM_ICP_HW_MGR_H |
| 15 | |
| 16 | #include <linux/types.h> |
| 17 | #include <linux/completion.h> |
| 18 | #include <media/cam_icp.h> |
| 19 | #include "cam_icp_hw_intf.h" |
| 20 | #include "cam_hw_mgr_intf.h" |
| 21 | #include "cam_hw_intf.h" |
| 22 | #include "cam_a5_hw_intf.h" |
| 23 | #include "hfi_session_defs.h" |
| 24 | #include "cam_req_mgr_workq.h" |
| 25 | #include "cam_mem_mgr.h" |
Lakshmi Narayana Kalavala | 2743a0d | 2017-05-30 10:41:37 -0700 | [diff] [blame] | 26 | #include "cam_smmu_api.h" |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 27 | #include "cam_soc_util.h" |
Junzhe Zou | bc37c56 | 2017-11-20 18:23:49 -0800 | [diff] [blame] | 28 | #include "cam_req_mgr_timer.h" |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 29 | |
| 30 | #define CAM_ICP_ROLE_PARENT 1 |
| 31 | #define CAM_ICP_ROLE_CHILD 2 |
| 32 | |
| 33 | #define CAM_FRAME_CMD_MAX 20 |
| 34 | |
| 35 | #define CAM_MAX_OUT_RES 6 |
Sagar Gore | f13f75c | 2017-11-02 17:50:15 -0700 | [diff] [blame] | 36 | #define CAM_MAX_IN_RES 8 |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 37 | |
Suresh Vankadara | 38f7a65 | 2017-09-25 20:58:41 +0530 | [diff] [blame] | 38 | #define ICP_WORKQ_NUM_TASK 100 |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 39 | #define ICP_WORKQ_TASK_CMD_TYPE 1 |
| 40 | #define ICP_WORKQ_TASK_MSG_TYPE 2 |
| 41 | |
| 42 | #define ICP_PACKET_SIZE 0 |
| 43 | #define ICP_PACKET_TYPE 1 |
Suresh Vankadara | 8e06cfb | 2017-06-13 16:27:08 +0530 | [diff] [blame] | 44 | #define ICP_PACKET_OPCODE 2 |
Suresh Vankadara | adcf058 | 2017-05-24 09:53:36 +0530 | [diff] [blame] | 45 | #define ICP_MAX_OUTPUT_SUPPORTED 6 |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 46 | |
Suresh Vankadara | 22697d3 | 2017-07-03 12:14:09 -0700 | [diff] [blame] | 47 | #define ICP_FRAME_PROCESS_SUCCESS 0 |
| 48 | #define ICP_FRAME_PROCESS_FAILURE 1 |
Lakshmi Narayana Kalavala | dac0b6c | 2017-09-13 15:33:42 -0700 | [diff] [blame] | 49 | #define ICP_MSG_BUF_SIZE 256 |
| 50 | #define ICP_DBG_BUF_SIZE 102400 |
Suresh Vankadara | 22697d3 | 2017-07-03 12:14:09 -0700 | [diff] [blame] | 51 | |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 52 | #define ICP_CLK_HW_IPE 0x0 |
| 53 | #define ICP_CLK_HW_BPS 0x1 |
| 54 | #define ICP_CLK_HW_MAX 0x2 |
| 55 | |
| 56 | #define ICP_OVER_CLK_THRESHOLD 15 |
| 57 | |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 58 | #define CPAS_IPE0_BIT 0x1000 |
| 59 | #define CPAS_IPE1_BIT 0x2000 |
| 60 | #define CPAS_BPS_BIT 0x400 |
| 61 | |
Alok Pandey | 78093d3 | 2017-11-08 18:56:54 +0530 | [diff] [blame] | 62 | #define ICP_PWR_CLP_BPS 0x00000001 |
| 63 | #define ICP_PWR_CLP_IPE0 0x00010000 |
| 64 | #define ICP_PWR_CLP_IPE1 0x00020000 |
| 65 | |
Suresh Vankadara | c7b0c67 | 2017-11-25 00:44:10 +0530 | [diff] [blame] | 66 | #define CAM_ICP_CTX_STATE_FREE 0x0 |
| 67 | #define CAM_ICP_CTX_STATE_IN_USE 0x1 |
| 68 | #define CAM_ICP_CTX_STATE_ACQUIRED 0x2 |
| 69 | #define CAM_ICP_CTX_STATE_RELEASE 0x3 |
| 70 | |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 71 | /** |
| 72 | * struct icp_hfi_mem_info |
| 73 | * @qtbl: Memory info of queue table |
| 74 | * @cmd_q: Memory info of command queue |
| 75 | * @msg_q: Memory info of message queue |
| 76 | * @dbg_q: Memory info of debug queue |
| 77 | * @sec_heap: Memory info of secondary heap |
| 78 | * @fw_buf: Memory info of firmware |
| 79 | */ |
| 80 | struct icp_hfi_mem_info { |
| 81 | struct cam_mem_mgr_memory_desc qtbl; |
| 82 | struct cam_mem_mgr_memory_desc cmd_q; |
| 83 | struct cam_mem_mgr_memory_desc msg_q; |
| 84 | struct cam_mem_mgr_memory_desc dbg_q; |
| 85 | struct cam_mem_mgr_memory_desc sec_heap; |
| 86 | struct cam_mem_mgr_memory_desc fw_buf; |
Lakshmi Narayana Kalavala | 2743a0d | 2017-05-30 10:41:37 -0700 | [diff] [blame] | 87 | struct cam_smmu_region_info shmem; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 88 | }; |
| 89 | |
| 90 | /** |
| 91 | * struct hfi_cmd_work_data |
| 92 | * @type: Task type |
| 93 | * @data: Pointer to command data |
| 94 | * @request_id: Request id |
| 95 | */ |
| 96 | struct hfi_cmd_work_data { |
| 97 | uint32_t type; |
| 98 | void *data; |
| 99 | int32_t request_id; |
| 100 | }; |
| 101 | |
| 102 | /** |
| 103 | * struct hfi_msg_work_data |
| 104 | * @type: Task type |
| 105 | * @data: Pointer to message data |
| 106 | * @irq_status: IRQ status |
| 107 | */ |
| 108 | struct hfi_msg_work_data { |
| 109 | uint32_t type; |
| 110 | void *data; |
| 111 | uint32_t irq_status; |
| 112 | }; |
| 113 | |
| 114 | /** |
Junzhe Zou | bc37c56 | 2017-11-20 18:23:49 -0800 | [diff] [blame] | 115 | * struct clk_work_data |
| 116 | * @type: Task type |
| 117 | * @data: Pointer to clock info |
| 118 | */ |
| 119 | struct clk_work_data { |
| 120 | uint32_t type; |
| 121 | void *data; |
| 122 | }; |
| 123 | |
| 124 | /** |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 125 | * struct hfi_frame_process_info |
| 126 | * @hfi_frame_cmd: Frame process command info |
| 127 | * @bitmap: Bitmap for hfi_frame_cmd |
| 128 | * @bits: Used in hfi_frame_cmd bitmap |
| 129 | * @lock: Lock for hfi_frame_cmd |
| 130 | * @request_id: Request id list |
| 131 | * @num_out_resources: Number of out syncs |
| 132 | * @out_resource: Out sync info |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 133 | * @fw_process_flag: Frame process flag |
| 134 | * @clk_info: Clock information for a request |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 135 | */ |
| 136 | struct hfi_frame_process_info { |
| 137 | struct hfi_cmd_ipebps_async hfi_frame_cmd[CAM_FRAME_CMD_MAX]; |
| 138 | void *bitmap; |
| 139 | size_t bits; |
| 140 | struct mutex lock; |
Sagar Gore | cdd6a5e | 2017-05-17 19:06:59 -0700 | [diff] [blame] | 141 | uint64_t request_id[CAM_FRAME_CMD_MAX]; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 142 | uint32_t num_out_resources[CAM_FRAME_CMD_MAX]; |
| 143 | uint32_t out_resource[CAM_FRAME_CMD_MAX][CAM_MAX_OUT_RES]; |
Suresh Vankadara | ad2d3a9 | 2017-09-25 12:18:11 +0530 | [diff] [blame] | 144 | uint32_t in_resource[CAM_FRAME_CMD_MAX]; |
Junzhe Zou | 4b11e7a | 2017-11-13 17:21:32 -0800 | [diff] [blame] | 145 | uint32_t in_free_resource[CAM_FRAME_CMD_MAX]; |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 146 | uint32_t fw_process_flag[CAM_FRAME_CMD_MAX]; |
| 147 | struct cam_icp_clk_bw_request clk_info[CAM_FRAME_CMD_MAX]; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 148 | }; |
| 149 | |
| 150 | /** |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 151 | * struct cam_ctx_clk_info |
| 152 | * @curr_fc: Context latest request frame cycles |
| 153 | * @rt_flag: Flag to indicate real time request |
| 154 | * @base_clk: Base clock to process the request |
Suresh Vankadara | 38f7a65 | 2017-09-25 20:58:41 +0530 | [diff] [blame] | 155 | * @reserved: Reserved field |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 156 | * #uncompressed_bw: Current bandwidth voting |
| 157 | * @compressed_bw: Current compressed bandwidth voting |
| 158 | * @clk_rate: Supported clock rates for the context |
| 159 | */ |
| 160 | struct cam_ctx_clk_info { |
| 161 | uint32_t curr_fc; |
| 162 | uint32_t rt_flag; |
| 163 | uint32_t base_clk; |
Suresh Vankadara | 38f7a65 | 2017-09-25 20:58:41 +0530 | [diff] [blame] | 164 | uint32_t reserved; |
| 165 | uint64_t uncompressed_bw; |
| 166 | uint64_t compressed_bw; |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 167 | int32_t clk_rate[CAM_MAX_VOTE]; |
| 168 | }; |
| 169 | /** |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 170 | * struct cam_icp_hw_ctx_data |
| 171 | * @context_priv: Context private data |
| 172 | * @ctx_mutex: Mutex for context |
| 173 | * @fw_handle: Firmware handle |
| 174 | * @scratch_mem_size: Scratch memory size |
| 175 | * @acquire_dev_cmd: Acquire command |
| 176 | * @icp_dev_acquire_info: Acquire device info |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 177 | * @ctxt_event_cb: Context callback function |
Suresh Vankadara | c7b0c67 | 2017-11-25 00:44:10 +0530 | [diff] [blame] | 178 | * @state: context state |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 179 | * @role: Role of a context in case of chaining |
| 180 | * @chain_ctx: Peer context |
| 181 | * @hfi_frame_process: Frame process command |
| 182 | * @wait_complete: Completion info |
| 183 | * @temp_payload: Payload for destroy handle data |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 184 | * @ctx_id: Context Id |
| 185 | * @clk_info: Current clock info of a context |
Suresh Vankadara | c092e59 | 2018-01-11 18:52:41 +0530 | [diff] [blame] | 186 | * @watch_dog: watchdog timer handle |
| 187 | * @watch_dog_reset_counter: Counter for watch dog reset |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 188 | */ |
| 189 | struct cam_icp_hw_ctx_data { |
| 190 | void *context_priv; |
| 191 | struct mutex ctx_mutex; |
| 192 | uint32_t fw_handle; |
| 193 | uint32_t scratch_mem_size; |
| 194 | struct cam_acquire_dev_cmd acquire_dev_cmd; |
Suresh Vankadara | adcf058 | 2017-05-24 09:53:36 +0530 | [diff] [blame] | 195 | struct cam_icp_acquire_dev_info *icp_dev_acquire_info; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 196 | cam_hw_event_cb_func ctxt_event_cb; |
Suresh Vankadara | c7b0c67 | 2017-11-25 00:44:10 +0530 | [diff] [blame] | 197 | uint32_t state; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 198 | uint32_t role; |
| 199 | struct cam_icp_hw_ctx_data *chain_ctx; |
| 200 | struct hfi_frame_process_info hfi_frame_process; |
| 201 | struct completion wait_complete; |
| 202 | struct ipe_bps_destroy temp_payload; |
Suresh Vankadara | 5a1ae56 | 2017-06-03 12:59:15 +0530 | [diff] [blame] | 203 | uint32_t ctx_id; |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 204 | struct cam_ctx_clk_info clk_info; |
Suresh Vankadara | c092e59 | 2018-01-11 18:52:41 +0530 | [diff] [blame] | 205 | struct cam_req_mgr_timer *watch_dog; |
| 206 | uint32_t watch_dog_reset_counter; |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 207 | }; |
| 208 | |
| 209 | /** |
| 210 | * struct icp_cmd_generic_blob |
| 211 | * @ctx: Current context info |
| 212 | * @frame_info_idx: Index used for frame process info |
| 213 | */ |
| 214 | struct icp_cmd_generic_blob { |
| 215 | struct cam_icp_hw_ctx_data *ctx; |
| 216 | uint32_t frame_info_idx; |
| 217 | }; |
| 218 | |
| 219 | /** |
| 220 | * struct cam_icp_clk_info |
| 221 | * @base_clk: Base clock to process request |
| 222 | * @curr_clk: Current clock of hadrware |
| 223 | * @threshold: Threshold for overclk count |
| 224 | * @over_clked: Over clock count |
Junzhe Zou | bc37c56 | 2017-11-20 18:23:49 -0800 | [diff] [blame] | 225 | * @uncompressed_bw: Current bandwidth voting |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 226 | * @compressed_bw: Current compressed bandwidth voting |
Junzhe Zou | bc37c56 | 2017-11-20 18:23:49 -0800 | [diff] [blame] | 227 | * @hw_type: IPE/BPS device type |
| 228 | * @watch_dog: watchdog timer handle |
Suresh Vankadara | c092e59 | 2018-01-11 18:52:41 +0530 | [diff] [blame] | 229 | * @watch_dog_reset_counter: Counter for watch dog reset |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 230 | */ |
| 231 | struct cam_icp_clk_info { |
| 232 | uint32_t base_clk; |
| 233 | uint32_t curr_clk; |
| 234 | uint32_t threshold; |
| 235 | uint32_t over_clked; |
Suresh Vankadara | 38f7a65 | 2017-09-25 20:58:41 +0530 | [diff] [blame] | 236 | uint64_t uncompressed_bw; |
| 237 | uint64_t compressed_bw; |
Junzhe Zou | bc37c56 | 2017-11-20 18:23:49 -0800 | [diff] [blame] | 238 | uint32_t hw_type; |
| 239 | struct cam_req_mgr_timer *watch_dog; |
Suresh Vankadara | c092e59 | 2018-01-11 18:52:41 +0530 | [diff] [blame] | 240 | uint32_t watch_dog_reset_counter; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 241 | }; |
| 242 | |
| 243 | /** |
| 244 | * struct cam_icp_hw_mgr |
| 245 | * @hw_mgr_mutex: Mutex for ICP hardware manager |
| 246 | * @hw_mgr_lock: Spinlock for ICP hardware manager |
| 247 | * @devices: Devices of ICP hardware manager |
| 248 | * @ctx_data: Context data |
| 249 | * @icp_caps: ICP capabilities |
| 250 | * @fw_download: Firmware download state |
| 251 | * @iommu_hdl: Non secure IOMMU handle |
| 252 | * @iommu_sec_hdl: Secure IOMMU handle |
| 253 | * @hfi_mem: Memory for hfi |
| 254 | * @cmd_work: Work queue for hfi commands |
| 255 | * @msg_work: Work queue for hfi messages |
| 256 | * @msg_buf: Buffer for message data from firmware |
| 257 | * @dbg_buf: Buffer for debug data from firmware |
| 258 | * @a5_complete: Completion info |
| 259 | * @cmd_work_data: Pointer to command work queue task |
| 260 | * @msg_work_data: Pointer to message work queue task |
| 261 | * @ctxt_cnt: Active context count |
Suresh Vankadara | 6657bc2 | 2017-07-31 10:33:04 +0530 | [diff] [blame] | 262 | * @ipe_ctxt_cnt: IPE Active context count |
| 263 | * @bps_ctxt_cnt: BPS Active context count |
| 264 | * @dentry: Debugfs entry |
| 265 | * @a5_debug: A5 debug flag |
| 266 | * @icp_pc_flag: Flag to enable/disable power collapse |
Alok Pandey | 1aef7b5 | 2017-12-16 20:42:03 +0530 | [diff] [blame] | 267 | * @ipe_bps_pc_flag: Flag to enable/disable |
| 268 | * power collapse for ipe & bps |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 269 | * @icp_debug_clk: Set clock based on debug value |
| 270 | * @icp_default_clk: Set this clok if user doesn't supply |
| 271 | * @clk_info: Clock info of hardware |
Lakshmi Narayana Kalavala | 2c71428 | 2017-09-08 12:27:36 -0700 | [diff] [blame] | 272 | * @secure_mode: Flag to enable/disable secure camera |
Lakshmi Narayana Kalavala | dac0b6c | 2017-09-13 15:33:42 -0700 | [diff] [blame] | 273 | * @a5_jtag_debug: entry to enable A5 JTAG debugging |
| 274 | * @a5_debug_q : entry to enable FW debug message |
| 275 | * @a5_dbg_lvl : debug level set to FW. |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 276 | * @ipe0_enable: Flag for IPE0 |
| 277 | * @ipe1_enable: Flag for IPE1 |
| 278 | * @bps_enable: Flag for BPS |
Suresh Vankadara | 466bed2 | 2017-11-30 06:30:20 +0530 | [diff] [blame] | 279 | * @core_info: 32 bit value , tells IPE0/1 and BPS |
Vishalsingh Hajeri | 71fc3c5 | 2018-01-15 20:28:29 -0800 | [diff] [blame] | 280 | * @a5_dev_intf : Device interface for A5 |
| 281 | * @ipe0_dev_intf: Device interface for IPE0 |
| 282 | * @ipe1_dev_intf: Device interface for IPE1 |
| 283 | * @bps_dev_intf: Device interface for BPS |
| 284 | * @ipe_clk_state: IPE clock state flag |
| 285 | * @bps_clk_state: BPS clock state flag |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 286 | */ |
| 287 | struct cam_icp_hw_mgr { |
| 288 | struct mutex hw_mgr_mutex; |
| 289 | spinlock_t hw_mgr_lock; |
| 290 | |
| 291 | struct cam_hw_intf **devices[CAM_ICP_DEV_MAX]; |
| 292 | struct cam_icp_hw_ctx_data ctx_data[CAM_ICP_CTX_MAX]; |
| 293 | struct cam_icp_query_cap_cmd icp_caps; |
| 294 | |
| 295 | bool fw_download; |
| 296 | int32_t iommu_hdl; |
| 297 | int32_t iommu_sec_hdl; |
| 298 | struct icp_hfi_mem_info hfi_mem; |
| 299 | struct cam_req_mgr_core_workq *cmd_work; |
| 300 | struct cam_req_mgr_core_workq *msg_work; |
Lakshmi Narayana Kalavala | dac0b6c | 2017-09-13 15:33:42 -0700 | [diff] [blame] | 301 | uint32_t msg_buf[ICP_MSG_BUF_SIZE]; |
| 302 | uint32_t dbg_buf[ICP_DBG_BUF_SIZE]; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 303 | struct completion a5_complete; |
| 304 | struct hfi_cmd_work_data *cmd_work_data; |
| 305 | struct hfi_msg_work_data *msg_work_data; |
| 306 | uint32_t ctxt_cnt; |
Suresh Vankadara | 6657bc2 | 2017-07-31 10:33:04 +0530 | [diff] [blame] | 307 | uint32_t ipe_ctxt_cnt; |
| 308 | uint32_t bps_ctxt_cnt; |
Lakshmi Narayana Kalavala | 2743a0d | 2017-05-30 10:41:37 -0700 | [diff] [blame] | 309 | struct dentry *dentry; |
| 310 | bool a5_debug; |
Suresh Vankadara | 6657bc2 | 2017-07-31 10:33:04 +0530 | [diff] [blame] | 311 | bool icp_pc_flag; |
Alok Pandey | 1aef7b5 | 2017-12-16 20:42:03 +0530 | [diff] [blame] | 312 | bool ipe_bps_pc_flag; |
Suresh Vankadara | 34494fc | 2017-08-12 18:18:09 +0530 | [diff] [blame] | 313 | uint64_t icp_debug_clk; |
| 314 | uint64_t icp_default_clk; |
| 315 | struct cam_icp_clk_info clk_info[ICP_CLK_HW_MAX]; |
Lakshmi Narayana Kalavala | 2c71428 | 2017-09-08 12:27:36 -0700 | [diff] [blame] | 316 | bool secure_mode; |
Lakshmi Narayana Kalavala | dac0b6c | 2017-09-13 15:33:42 -0700 | [diff] [blame] | 317 | bool a5_jtag_debug; |
| 318 | bool a5_debug_q; |
| 319 | u64 a5_dbg_lvl; |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 320 | bool ipe0_enable; |
| 321 | bool ipe1_enable; |
| 322 | bool bps_enable; |
Suresh Vankadara | 466bed2 | 2017-11-30 06:30:20 +0530 | [diff] [blame] | 323 | uint32_t core_info; |
Karthik Anantha Ram | 9f13d0e | 2017-11-30 14:55:44 -0800 | [diff] [blame] | 324 | struct cam_hw_intf *a5_dev_intf; |
| 325 | struct cam_hw_intf *ipe0_dev_intf; |
| 326 | struct cam_hw_intf *ipe1_dev_intf; |
| 327 | struct cam_hw_intf *bps_dev_intf; |
Vishalsingh Hajeri | 71fc3c5 | 2018-01-15 20:28:29 -0800 | [diff] [blame] | 328 | bool ipe_clk_state; |
| 329 | bool bps_clk_state; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 330 | }; |
| 331 | |
Suresh Vankadara | 5499a5f | 2017-06-16 22:13:56 +0530 | [diff] [blame] | 332 | static int cam_icp_mgr_hw_close(void *hw_priv, void *hw_close_args); |
Harsh Shah | 6baba8c | 2017-10-16 19:23:29 -0700 | [diff] [blame] | 333 | static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args); |
Suresh Vankadara | 466bed2 | 2017-11-30 06:30:20 +0530 | [diff] [blame] | 334 | static int cam_icp_mgr_icp_resume(struct cam_icp_hw_mgr *hw_mgr); |
| 335 | static int cam_icp_mgr_icp_power_collapse(struct cam_icp_hw_mgr *hw_mgr); |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 336 | #endif /* CAM_ICP_HW_MGR_H */ |