Loading drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +59 −4 Original line number Diff line number Diff line Loading @@ -1335,6 +1335,10 @@ static int cam_convert_hw_idx_to_ife_hw_num(int hw_idx) return CAM_ISP_IFE1_LITE_HW; else if (hw_idx == 4) return CAM_ISP_IFE2_LITE_HW; else if (hw_idx == 5) return CAM_ISP_IFE3_LITE_HW; else if (hw_idx == 6) return CAM_ISP_IFE4_LITE_HW; break; case CAM_CPAS_TITAN_170_V200: if (hw_idx == 0) Loading Loading @@ -4396,6 +4400,7 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) } } ctx->dual_ife_irq_mismatch_cnt = 0; /* Start IFE root node: do nothing */ CAM_DBG(CAM_ISP, "Start success for ctx id:%d", ctx->ctx_index); Loading Loading @@ -4527,6 +4532,7 @@ static int cam_ife_mgr_release_hw(void *hw_mgr_priv, ctx->dsp_enabled = false; ctx->is_fe_enabled = false; ctx->is_offline = false; ctx->dual_ife_irq_mismatch_cnt = 0; atomic_set(&ctx->overflow_pending, 0); for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { ctx->sof_cnt[i] = 0; Loading Loading @@ -7175,6 +7181,36 @@ static int cam_ife_hw_mgr_handle_hw_rup( return 0; } static void cam_ife_mgr_ctx_irq_dump(struct cam_ife_hw_mgr_ctx *ctx) { struct cam_ife_hw_mgr_res *hw_mgr_res; struct cam_hw_intf *hw_intf; struct cam_isp_hw_get_cmd_update cmd_update; int i = 0; list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { if (hw_mgr_res->res_type == CAM_IFE_HW_MGR_RES_UNINIT) continue; for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { if (!hw_mgr_res->hw_res[i]) continue; switch (hw_mgr_res->hw_res[i]->res_id) { case CAM_ISP_HW_VFE_IN_CAMIF: hw_intf = hw_mgr_res->hw_res[i]->hw_intf; cmd_update.res = hw_mgr_res->hw_res[i]; cmd_update.cmd_type = CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP; hw_intf->hw_ops.process_cmd(hw_intf->hw_priv, CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP, &cmd_update, sizeof(cmd_update)); break; default: break; } } } } static int cam_ife_hw_mgr_check_irq_for_dual_vfe( struct cam_ife_hw_mgr_ctx *ife_hw_mgr_ctx, uint32_t hw_event_type) Loading Loading @@ -7214,18 +7250,37 @@ static int cam_ife_hw_mgr_check_irq_for_dual_vfe( } if ((event_cnt[master_hw_idx] && (event_cnt[master_hw_idx] - event_cnt[slave_hw_idx] > 1)) || ((int)(event_cnt[master_hw_idx] - event_cnt[slave_hw_idx]) > 1 )) || (event_cnt[slave_hw_idx] && (event_cnt[slave_hw_idx] - event_cnt[master_hw_idx] > 1))) { ((int)(event_cnt[slave_hw_idx] - event_cnt[master_hw_idx]) > 1 ))) { CAM_ERR_RATE_LIMIT(CAM_ISP, "One of the VFE could not generate hw event %d master[%d] core_cnt %d slave[%d] core_cnt %d", hw_event_type, master_hw_idx, event_cnt[master_hw_idx], slave_hw_idx, event_cnt[slave_hw_idx]); if (ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt > 10) { rc = -1; return rc; } if (event_cnt[master_hw_idx] >= 2) { event_cnt[master_hw_idx]--; ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt++; } if (event_cnt[slave_hw_idx] >= 2) { event_cnt[slave_hw_idx]--; ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt++; } if (ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt == 1) cam_ife_mgr_ctx_irq_dump(ife_hw_mgr_ctx); rc = 0; } CAM_DBG(CAM_ISP, "Only one core_index has given hw event %d", hw_event_type); Loading drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.h +3 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,8 @@ struct cam_ife_hw_mgr_debug { * @ts captured timestamp when the ctx is acquired * @is_offline Indicate whether context is for offline IFE * @dsp_enabled Indicate whether dsp is enabled in this context * @dual_ife_irq_mismatch_cnt irq mismatch count value per core, used for * dual VFE */ struct cam_ife_hw_mgr_ctx { struct list_head list; Loading Loading @@ -197,6 +199,7 @@ struct cam_ife_hw_mgr_ctx { struct timespec64 ts; bool is_offline; bool dsp_enabled; uint32_t dual_ife_irq_mismatch_cnt; }; /** Loading drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +27 −8 Original line number Diff line number Diff line Loading @@ -1618,7 +1618,7 @@ static int cam_ife_csid_enable_csi2( const struct cam_ife_csid_reg_offset *csid_reg; struct cam_hw_soc_info *soc_info; struct cam_ife_csid_cid_data *cid_data; uint32_t val = 0; uint32_t val = 0, val2; csid_reg = csid_hw->csid_info->csid_reg; soc_info = &csid_hw->hw_info->soc_info; Loading Loading @@ -1670,6 +1670,19 @@ static int cam_ife_csid_enable_csi2( } } /* after configuring the csi rx, reset hw once */ rc = cam_ife_csid_reset_regs(csid_hw, true); if (rc < 0) { val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_reg->csi2_reg->csid_csi2_rx_cfg0_addr); val2 = cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_reg->csi2_reg->csid_csi2_rx_irq_status_addr); CAM_ERR(CAM_ISP, "Failed in HW reset csid hw:%d top reset failed csi rx cfg:0x%x CSI RX status:0x%x", csid_hw->hw_intf->hw_idx, val, val2); return rc; } cam_ife_csid_csi2_irq_ctrl(csid_hw, true); return 0; } Loading Loading @@ -3617,12 +3630,14 @@ int cam_ife_csid_init_hw(void *hw_priv, break; } /* csid hw reset done after configuring the csi2 */ if (res->res_type != CAM_ISP_RESOURCE_CID) { rc = cam_ife_csid_reset_regs(csid_hw, true); if (rc < 0) if (rc) { CAM_ERR(CAM_ISP, "CSID: Failed in HW reset"); if (rc) cam_ife_csid_disable_hw(csid_hw); } } end: mutex_unlock(&csid_hw->hw_info->hw_mutex); Loading Loading @@ -4341,10 +4356,14 @@ static int cam_csid_evt_bottom_half_handler( goto end; } CAM_ERR_RATE_LIMIT(CAM_ISP, "idx %d err %d phy %d cnt %d", CAM_ERR_RATE_LIMIT(CAM_ISP, "idx %d err %d phy %d lane type:%d ln num:%d ln cfg:0x%x cnt %d", csid_hw->hw_intf->hw_idx, evt_payload->evt_type, csid_hw->csi2_rx_cfg.phy_sel, csid_hw->csi2_rx_cfg.lane_type, csid_hw->csi2_rx_cfg.lane_num, csid_hw->csi2_rx_cfg.lane_cfg, csid_hw->csi2_cfg_cnt); for (i = 0; i < CAM_IFE_CSID_IRQ_REG_MAX; i++) Loading drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_isp_hw.h +1 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ enum cam_isp_hw_cmd_type { CAM_ISP_HW_CMD_DUMP_HW, CAM_ISP_HW_CMD_FE_TRIGGER_CMD, CAM_ISP_HW_CMD_CSID_CHANGE_HALT_MODE, CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP, CAM_ISP_HW_CMD_MAX, }; Loading drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c +1 −0 Original line number Diff line number Diff line Loading @@ -597,6 +597,7 @@ int cam_vfe_process_cmd(void *hw_priv, uint32_t cmd_type, case CAM_ISP_HW_CMD_QUERY: case CAM_ISP_HW_CMD_QUERY_DSP_MODE: case CAM_ISP_HW_CMD_CAMIF_DATA: case CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP: rc = core_info->vfe_top->hw_ops.process_cmd( core_info->vfe_top->top_priv, cmd_type, cmd_args, arg_size); Loading Loading
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +59 −4 Original line number Diff line number Diff line Loading @@ -1335,6 +1335,10 @@ static int cam_convert_hw_idx_to_ife_hw_num(int hw_idx) return CAM_ISP_IFE1_LITE_HW; else if (hw_idx == 4) return CAM_ISP_IFE2_LITE_HW; else if (hw_idx == 5) return CAM_ISP_IFE3_LITE_HW; else if (hw_idx == 6) return CAM_ISP_IFE4_LITE_HW; break; case CAM_CPAS_TITAN_170_V200: if (hw_idx == 0) Loading Loading @@ -4396,6 +4400,7 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) } } ctx->dual_ife_irq_mismatch_cnt = 0; /* Start IFE root node: do nothing */ CAM_DBG(CAM_ISP, "Start success for ctx id:%d", ctx->ctx_index); Loading Loading @@ -4527,6 +4532,7 @@ static int cam_ife_mgr_release_hw(void *hw_mgr_priv, ctx->dsp_enabled = false; ctx->is_fe_enabled = false; ctx->is_offline = false; ctx->dual_ife_irq_mismatch_cnt = 0; atomic_set(&ctx->overflow_pending, 0); for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { ctx->sof_cnt[i] = 0; Loading Loading @@ -7175,6 +7181,36 @@ static int cam_ife_hw_mgr_handle_hw_rup( return 0; } static void cam_ife_mgr_ctx_irq_dump(struct cam_ife_hw_mgr_ctx *ctx) { struct cam_ife_hw_mgr_res *hw_mgr_res; struct cam_hw_intf *hw_intf; struct cam_isp_hw_get_cmd_update cmd_update; int i = 0; list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { if (hw_mgr_res->res_type == CAM_IFE_HW_MGR_RES_UNINIT) continue; for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { if (!hw_mgr_res->hw_res[i]) continue; switch (hw_mgr_res->hw_res[i]->res_id) { case CAM_ISP_HW_VFE_IN_CAMIF: hw_intf = hw_mgr_res->hw_res[i]->hw_intf; cmd_update.res = hw_mgr_res->hw_res[i]; cmd_update.cmd_type = CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP; hw_intf->hw_ops.process_cmd(hw_intf->hw_priv, CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP, &cmd_update, sizeof(cmd_update)); break; default: break; } } } } static int cam_ife_hw_mgr_check_irq_for_dual_vfe( struct cam_ife_hw_mgr_ctx *ife_hw_mgr_ctx, uint32_t hw_event_type) Loading Loading @@ -7214,18 +7250,37 @@ static int cam_ife_hw_mgr_check_irq_for_dual_vfe( } if ((event_cnt[master_hw_idx] && (event_cnt[master_hw_idx] - event_cnt[slave_hw_idx] > 1)) || ((int)(event_cnt[master_hw_idx] - event_cnt[slave_hw_idx]) > 1 )) || (event_cnt[slave_hw_idx] && (event_cnt[slave_hw_idx] - event_cnt[master_hw_idx] > 1))) { ((int)(event_cnt[slave_hw_idx] - event_cnt[master_hw_idx]) > 1 ))) { CAM_ERR_RATE_LIMIT(CAM_ISP, "One of the VFE could not generate hw event %d master[%d] core_cnt %d slave[%d] core_cnt %d", hw_event_type, master_hw_idx, event_cnt[master_hw_idx], slave_hw_idx, event_cnt[slave_hw_idx]); if (ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt > 10) { rc = -1; return rc; } if (event_cnt[master_hw_idx] >= 2) { event_cnt[master_hw_idx]--; ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt++; } if (event_cnt[slave_hw_idx] >= 2) { event_cnt[slave_hw_idx]--; ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt++; } if (ife_hw_mgr_ctx->dual_ife_irq_mismatch_cnt == 1) cam_ife_mgr_ctx_irq_dump(ife_hw_mgr_ctx); rc = 0; } CAM_DBG(CAM_ISP, "Only one core_index has given hw event %d", hw_event_type); Loading
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.h +3 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,8 @@ struct cam_ife_hw_mgr_debug { * @ts captured timestamp when the ctx is acquired * @is_offline Indicate whether context is for offline IFE * @dsp_enabled Indicate whether dsp is enabled in this context * @dual_ife_irq_mismatch_cnt irq mismatch count value per core, used for * dual VFE */ struct cam_ife_hw_mgr_ctx { struct list_head list; Loading Loading @@ -197,6 +199,7 @@ struct cam_ife_hw_mgr_ctx { struct timespec64 ts; bool is_offline; bool dsp_enabled; uint32_t dual_ife_irq_mismatch_cnt; }; /** Loading
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +27 −8 Original line number Diff line number Diff line Loading @@ -1618,7 +1618,7 @@ static int cam_ife_csid_enable_csi2( const struct cam_ife_csid_reg_offset *csid_reg; struct cam_hw_soc_info *soc_info; struct cam_ife_csid_cid_data *cid_data; uint32_t val = 0; uint32_t val = 0, val2; csid_reg = csid_hw->csid_info->csid_reg; soc_info = &csid_hw->hw_info->soc_info; Loading Loading @@ -1670,6 +1670,19 @@ static int cam_ife_csid_enable_csi2( } } /* after configuring the csi rx, reset hw once */ rc = cam_ife_csid_reset_regs(csid_hw, true); if (rc < 0) { val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_reg->csi2_reg->csid_csi2_rx_cfg0_addr); val2 = cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_reg->csi2_reg->csid_csi2_rx_irq_status_addr); CAM_ERR(CAM_ISP, "Failed in HW reset csid hw:%d top reset failed csi rx cfg:0x%x CSI RX status:0x%x", csid_hw->hw_intf->hw_idx, val, val2); return rc; } cam_ife_csid_csi2_irq_ctrl(csid_hw, true); return 0; } Loading Loading @@ -3617,12 +3630,14 @@ int cam_ife_csid_init_hw(void *hw_priv, break; } /* csid hw reset done after configuring the csi2 */ if (res->res_type != CAM_ISP_RESOURCE_CID) { rc = cam_ife_csid_reset_regs(csid_hw, true); if (rc < 0) if (rc) { CAM_ERR(CAM_ISP, "CSID: Failed in HW reset"); if (rc) cam_ife_csid_disable_hw(csid_hw); } } end: mutex_unlock(&csid_hw->hw_info->hw_mutex); Loading Loading @@ -4341,10 +4356,14 @@ static int cam_csid_evt_bottom_half_handler( goto end; } CAM_ERR_RATE_LIMIT(CAM_ISP, "idx %d err %d phy %d cnt %d", CAM_ERR_RATE_LIMIT(CAM_ISP, "idx %d err %d phy %d lane type:%d ln num:%d ln cfg:0x%x cnt %d", csid_hw->hw_intf->hw_idx, evt_payload->evt_type, csid_hw->csi2_rx_cfg.phy_sel, csid_hw->csi2_rx_cfg.lane_type, csid_hw->csi2_rx_cfg.lane_num, csid_hw->csi2_rx_cfg.lane_cfg, csid_hw->csi2_cfg_cnt); for (i = 0; i < CAM_IFE_CSID_IRQ_REG_MAX; i++) Loading
drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_isp_hw.h +1 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ enum cam_isp_hw_cmd_type { CAM_ISP_HW_CMD_DUMP_HW, CAM_ISP_HW_CMD_FE_TRIGGER_CMD, CAM_ISP_HW_CMD_CSID_CHANGE_HALT_MODE, CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP, CAM_ISP_HW_CMD_MAX, }; Loading
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c +1 −0 Original line number Diff line number Diff line Loading @@ -597,6 +597,7 @@ int cam_vfe_process_cmd(void *hw_priv, uint32_t cmd_type, case CAM_ISP_HW_CMD_QUERY: case CAM_ISP_HW_CMD_QUERY_DSP_MODE: case CAM_ISP_HW_CMD_CAMIF_DATA: case CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP: rc = core_info->vfe_top->hw_ops.process_cmd( core_info->vfe_top->top_priv, cmd_type, cmd_args, arg_size); Loading