Lines Matching +full:fw +full:- +full:cfg

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2013--2024 Intel Corporation
13 #include "ipu6-bus.h"
14 #include "ipu6-fw-com.h"
15 #include "ipu6-isys.h"
16 #include "ipu6-platform-isys-csi2-reg.h"
17 #include "ipu6-platform-regs.h"
31 struct device *dev = &isys->adev->auxdev.dev; in handle_proxy_response()
35 resp = ipu6_recv_get_token(isys->fwcom, IPU6_BASE_PROXY_RECV_QUEUES); in handle_proxy_response()
40 resp->request_id, resp->error_info.error, in handle_proxy_response()
41 resp->error_info.error_details); in handle_proxy_response()
43 ret = req_id == resp->request_id ? 0 : -EIO; in handle_proxy_response()
45 ipu6_recv_put_token(isys->fwcom, IPU6_BASE_PROXY_RECV_QUEUES); in handle_proxy_response()
55 struct ipu6_fw_com_context *ctx = isys->fwcom; in ipu6_fw_isys_send_proxy_token()
56 struct device *dev = &isys->adev->auxdev.dev; in ipu6_fw_isys_send_proxy_token()
67 return -EBUSY; in ipu6_fw_isys_send_proxy_token()
69 token->request_id = req_id; in ipu6_fw_isys_send_proxy_token()
70 token->region_index = index; in ipu6_fw_isys_send_proxy_token()
71 token->offset = offset; in ipu6_fw_isys_send_proxy_token()
72 token->value = value; in ipu6_fw_isys_send_proxy_token()
80 if (ret == -EIO) { in ipu6_fw_isys_send_proxy_token()
84 timeout--; in ipu6_fw_isys_send_proxy_token()
99 struct ipu6_fw_com_context *ctx = isys->fwcom; in ipu6_fw_isys_complex_cmd()
100 struct device *dev = &isys->adev->auxdev.dev; in ipu6_fw_isys_complex_cmd()
104 return -EINVAL; in ipu6_fw_isys_complex_cmd()
118 return -EBUSY; in ipu6_fw_isys_complex_cmd()
120 token->payload = dma_mapped_buf; in ipu6_fw_isys_complex_cmd()
121 token->buf_handle = (unsigned long)cpu_mapped_buf; in ipu6_fw_isys_complex_cmd()
122 token->send_type = send_type; in ipu6_fw_isys_complex_cmd()
138 struct device *dev = &isys->adev->auxdev.dev; in ipu6_fw_isys_close()
145 * Stop the isys fw. Actual close takes in ipu6_fw_isys_close()
146 * some time as the FW must stop its actions including code fetch in ipu6_fw_isys_close()
150 spin_lock_irqsave(&isys->power_lock, flags); in ipu6_fw_isys_close()
151 ret = ipu6_fw_com_close(isys->fwcom); in ipu6_fw_isys_close()
152 fwcom = isys->fwcom; in ipu6_fw_isys_close()
153 isys->fwcom = NULL; in ipu6_fw_isys_close()
154 spin_unlock_irqrestore(&isys->power_lock, flags); in ipu6_fw_isys_close()
162 retry--; in ipu6_fw_isys_close()
167 spin_lock_irqsave(&isys->power_lock, flags); in ipu6_fw_isys_close()
168 isys->fwcom = fwcom; in ipu6_fw_isys_close()
169 spin_unlock_irqrestore(&isys->power_lock, flags); in ipu6_fw_isys_close()
179 ret = ipu6_fw_com_release(isys->fwcom, 1); in ipu6_fw_isys_cleanup()
181 dev_warn(&isys->adev->auxdev.dev, in ipu6_fw_isys_cleanup()
183 isys->fwcom = NULL; in ipu6_fw_isys_cleanup()
189 void __iomem *spc_regs_base = isys->pdata->base + in start_sp()
190 isys->pdata->ipdata->hw_variant.spc_offset; in start_sp()
195 val |= isys->icache_prefetch ? IPU6_ISYS_SPC_STATUS_ICACHE_PREFETCH : 0; in start_sp()
203 void __iomem *spc_regs_base = isys->pdata->base + in query_sp()
204 isys->pdata->ipdata->hw_variant.spc_offset; in query_sp()
221 struct device *dev = &isys->adev->auxdev.dev; in ipu6_isys_fwcom_cfg_init()
234 max_streams = isys->pdata->ipdata->max_streams; in ipu6_isys_fwcom_cfg_init()
235 max_send_queues = isys->pdata->ipdata->max_send_queues; in ipu6_isys_fwcom_cfg_init()
236 max_sram_blocks = isys->pdata->ipdata->max_sram_blocks; in ipu6_isys_fwcom_cfg_init()
237 max_devq_size = isys->pdata->ipdata->max_devq_size; in ipu6_isys_fwcom_cfg_init()
241 return -ENOMEM; in ipu6_isys_fwcom_cfg_init()
243 isys_fw_cfg->num_send_queues[type_proxy] = IPU6_N_MAX_PROXY_SEND_QUEUES; in ipu6_isys_fwcom_cfg_init()
244 isys_fw_cfg->num_send_queues[type_dev] = IPU6_N_MAX_DEV_SEND_QUEUES; in ipu6_isys_fwcom_cfg_init()
245 isys_fw_cfg->num_send_queues[type_msg] = num_in_message_queues; in ipu6_isys_fwcom_cfg_init()
246 isys_fw_cfg->num_recv_queues[type_proxy] = IPU6_N_MAX_PROXY_RECV_QUEUES; in ipu6_isys_fwcom_cfg_init()
248 isys_fw_cfg->num_recv_queues[type_dev] = 0; in ipu6_isys_fwcom_cfg_init()
249 isys_fw_cfg->num_recv_queues[type_msg] = 1; in ipu6_isys_fwcom_cfg_init()
254 return -ENOMEM; in ipu6_isys_fwcom_cfg_init()
259 return -ENOMEM; in ipu6_isys_fwcom_cfg_init()
261 fwcom->input = input_queue_cfg; in ipu6_isys_fwcom_cfg_init()
262 fwcom->output = output_queue_cfg; in ipu6_isys_fwcom_cfg_init()
264 fwcom->num_input_queues = isys_fw_cfg->num_send_queues[type_proxy] + in ipu6_isys_fwcom_cfg_init()
265 isys_fw_cfg->num_send_queues[type_dev] + in ipu6_isys_fwcom_cfg_init()
266 isys_fw_cfg->num_send_queues[type_msg]; in ipu6_isys_fwcom_cfg_init()
268 fwcom->num_output_queues = isys_fw_cfg->num_recv_queues[type_proxy] + in ipu6_isys_fwcom_cfg_init()
269 isys_fw_cfg->num_recv_queues[type_dev] + in ipu6_isys_fwcom_cfg_init()
270 isys_fw_cfg->num_recv_queues[type_msg]; in ipu6_isys_fwcom_cfg_init()
275 isys_fw_cfg->buffer_partition.num_gda_pages[i] = in ipu6_isys_fwcom_cfg_init()
280 isys_fw_cfg->buffer_partition.num_gda_pages[i] = 0; in ipu6_isys_fwcom_cfg_init()
283 /* FW assumes proxy interface at fwcom queue 0 */ in ipu6_isys_fwcom_cfg_init()
284 for (i = 0; i < isys_fw_cfg->num_send_queues[type_proxy]; i++) { in ipu6_isys_fwcom_cfg_init()
290 for (i = 0; i < isys_fw_cfg->num_send_queues[type_dev]; i++) { in ipu6_isys_fwcom_cfg_init()
296 for (i = 0; i < isys_fw_cfg->num_send_queues[type_msg]; i++) { in ipu6_isys_fwcom_cfg_init()
303 for (i = 0; i < isys_fw_cfg->num_recv_queues[type_proxy]; i++) { in ipu6_isys_fwcom_cfg_init()
310 for (i = 0; i < isys_fw_cfg->num_recv_queues[type_msg]; i++) { in ipu6_isys_fwcom_cfg_init()
317 fwcom->dmem_addr = isys->pdata->ipdata->hw_variant.dmem_offset; in ipu6_isys_fwcom_cfg_init()
318 fwcom->specific_addr = isys_fw_cfg; in ipu6_isys_fwcom_cfg_init()
319 fwcom->specific_size = sizeof(*isys_fw_cfg); in ipu6_isys_fwcom_cfg_init()
326 struct device *dev = &isys->adev->auxdev.dev; in ipu6_fw_isys_init()
337 isys->fwcom = ipu6_fw_com_prepare(&fwcom, isys->adev, in ipu6_fw_isys_init()
338 isys->pdata->base); in ipu6_fw_isys_init()
339 if (!isys->fwcom) { in ipu6_fw_isys_init()
340 dev_err(dev, "isys fw com prepare failed\n"); in ipu6_fw_isys_init()
341 return -EIO; in ipu6_fw_isys_init()
344 ret = ipu6_fw_com_open(isys->fwcom); in ipu6_fw_isys_init()
346 dev_err(dev, "isys fw com open failed %d\n", ret); in ipu6_fw_isys_init()
352 if (ipu6_fw_com_ready(isys->fwcom)) in ipu6_fw_isys_init()
354 retry--; in ipu6_fw_isys_init()
360 ret = -EIO; in ipu6_fw_isys_init()
378 struct ipu6_fw_isys_stream_cfg_data_abi *cfg) in ipu6_fw_isys_dump_stream_cfg() argument
382 dev_dbg(dev, "-----------------------------------------------------\n"); in ipu6_fw_isys_dump_stream_cfg()
385 dev_dbg(dev, "compfmt = %d\n", cfg->vc); in ipu6_fw_isys_dump_stream_cfg()
386 dev_dbg(dev, "src = %d\n", cfg->src); in ipu6_fw_isys_dump_stream_cfg()
387 dev_dbg(dev, "vc = %d\n", cfg->vc); in ipu6_fw_isys_dump_stream_cfg()
388 dev_dbg(dev, "isl_use = %d\n", cfg->isl_use); in ipu6_fw_isys_dump_stream_cfg()
389 dev_dbg(dev, "sensor_type = %d\n", cfg->sensor_type); in ipu6_fw_isys_dump_stream_cfg()
392 cfg->send_irq_sof_discarded); in ipu6_fw_isys_dump_stream_cfg()
394 cfg->send_irq_eof_discarded); in ipu6_fw_isys_dump_stream_cfg()
396 cfg->send_resp_sof_discarded); in ipu6_fw_isys_dump_stream_cfg()
398 cfg->send_resp_eof_discarded); in ipu6_fw_isys_dump_stream_cfg()
401 dev_dbg(dev, "\t.left_top = [%d, %d]\n", cfg->crop.left_offset, in ipu6_fw_isys_dump_stream_cfg()
402 cfg->crop.top_offset); in ipu6_fw_isys_dump_stream_cfg()
403 dev_dbg(dev, "\t.right_bottom = [%d, %d]\n", cfg->crop.right_offset, in ipu6_fw_isys_dump_stream_cfg()
404 cfg->crop.bottom_offset); in ipu6_fw_isys_dump_stream_cfg()
406 dev_dbg(dev, "nof_input_pins = %d\n", cfg->nof_input_pins); in ipu6_fw_isys_dump_stream_cfg()
407 for (i = 0; i < cfg->nof_input_pins; i++) { in ipu6_fw_isys_dump_stream_cfg()
409 dev_dbg(dev, "\t.dt = 0x%0x\n", cfg->input_pins[i].dt); in ipu6_fw_isys_dump_stream_cfg()
411 cfg->input_pins[i].mipi_store_mode); in ipu6_fw_isys_dump_stream_cfg()
413 cfg->input_pins[i].bits_per_pix); in ipu6_fw_isys_dump_stream_cfg()
415 cfg->input_pins[i].mapped_dt); in ipu6_fw_isys_dump_stream_cfg()
417 cfg->input_pins[i].input_res.width, in ipu6_fw_isys_dump_stream_cfg()
418 cfg->input_pins[i].input_res.height); in ipu6_fw_isys_dump_stream_cfg()
420 cfg->input_pins[i].mipi_decompression); in ipu6_fw_isys_dump_stream_cfg()
422 cfg->input_pins[i].capture_mode); in ipu6_fw_isys_dump_stream_cfg()
425 dev_dbg(dev, "nof_output_pins = %d\n", cfg->nof_output_pins); in ipu6_fw_isys_dump_stream_cfg()
426 for (i = 0; i < cfg->nof_output_pins; i++) { in ipu6_fw_isys_dump_stream_cfg()
429 cfg->output_pins[i].input_pin_id); in ipu6_fw_isys_dump_stream_cfg()
431 cfg->output_pins[i].output_res.width, in ipu6_fw_isys_dump_stream_cfg()
432 cfg->output_pins[i].output_res.height); in ipu6_fw_isys_dump_stream_cfg()
433 dev_dbg(dev, "\t.stride = %d\n", cfg->output_pins[i].stride); in ipu6_fw_isys_dump_stream_cfg()
434 dev_dbg(dev, "\t.pt = %d\n", cfg->output_pins[i].pt); in ipu6_fw_isys_dump_stream_cfg()
436 cfg->output_pins[i].payload_buf_size); in ipu6_fw_isys_dump_stream_cfg()
437 dev_dbg(dev, "\t.ft = %d\n", cfg->output_pins[i].ft); in ipu6_fw_isys_dump_stream_cfg()
439 cfg->output_pins[i].watermark_in_lines); in ipu6_fw_isys_dump_stream_cfg()
441 cfg->output_pins[i].send_irq); in ipu6_fw_isys_dump_stream_cfg()
443 cfg->output_pins[i].reserve_compression); in ipu6_fw_isys_dump_stream_cfg()
445 cfg->output_pins[i].snoopable); in ipu6_fw_isys_dump_stream_cfg()
447 cfg->output_pins[i].error_handling_enable); in ipu6_fw_isys_dump_stream_cfg()
449 cfg->output_pins[i].sensor_type); in ipu6_fw_isys_dump_stream_cfg()
451 dev_dbg(dev, "-----------------------------------------------------\n"); in ipu6_fw_isys_dump_stream_cfg()
461 dev_dbg(dev, "-----------------------------------------------------\n"); in ipu6_fw_isys_dump_frame_buff_set()
467 buf->output_pins[i].out_buf_id); in ipu6_fw_isys_dump_frame_buff_set()
468 dev_dbg(dev, "\t.addr = 0x%x\n", buf->output_pins[i].addr); in ipu6_fw_isys_dump_frame_buff_set()
470 buf->output_pins[i].compress); in ipu6_fw_isys_dump_frame_buff_set()
473 dev_dbg(dev, "send_irq_sof = 0x%x\n", buf->send_irq_sof); in ipu6_fw_isys_dump_frame_buff_set()
474 dev_dbg(dev, "send_irq_eof = 0x%x\n", buf->send_irq_eof); in ipu6_fw_isys_dump_frame_buff_set()
475 dev_dbg(dev, "send_resp_sof = 0x%x\n", buf->send_resp_sof); in ipu6_fw_isys_dump_frame_buff_set()
476 dev_dbg(dev, "send_resp_eof = 0x%x\n", buf->send_resp_eof); in ipu6_fw_isys_dump_frame_buff_set()
478 buf->send_irq_capture_ack); in ipu6_fw_isys_dump_frame_buff_set()
480 buf->send_irq_capture_done); in ipu6_fw_isys_dump_frame_buff_set()
482 buf->send_resp_capture_ack); in ipu6_fw_isys_dump_frame_buff_set()
484 buf->send_resp_capture_done); in ipu6_fw_isys_dump_frame_buff_set()
486 dev_dbg(dev, "-----------------------------------------------------\n"); in ipu6_fw_isys_dump_frame_buff_set()