diff --git a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c index 5de31cf35b..dbf67f2e9d 100644 --- a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +++ b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c @@ -2196,6 +2196,23 @@ static int cam_convert_rdi_out_res_id_to_src(int res_id) return CAM_ISP_HW_VFE_IN_MAX; } +static int cam_convert_csid_res_to_path(int res_id) +{ + if (res_id == CAM_IFE_PIX_PATH_RES_IPP) + return CAM_ISP_PXL_PATH; + else if (res_id == CAM_IFE_PIX_PATH_RES_PPP) + return CAM_ISP_PPP_PATH; + else if (res_id == CAM_IFE_PIX_PATH_RES_RDI_0) + return CAM_ISP_RDI0_PATH; + else if (res_id == CAM_IFE_PIX_PATH_RES_RDI_1) + return CAM_ISP_RDI1_PATH; + else if (res_id == CAM_IFE_PIX_PATH_RES_RDI_2) + return CAM_ISP_RDI2_PATH; + else if (res_id == CAM_IFE_PIX_PATH_RES_RDI_3) + return CAM_ISP_RDI3_PATH; + return 0; +} + static int cam_convert_res_id_to_hw_path(int res_id) { if (res_id == CAM_ISP_HW_VFE_IN_LCR) @@ -3273,7 +3290,8 @@ static enum cam_ife_pix_path_res_id static int cam_ife_hw_mgr_acquire_res_ife_csid_rdi( struct cam_ife_hw_mgr_ctx *ife_ctx, - struct cam_isp_in_port_generic_info *in_port) + struct cam_isp_in_port_generic_info *in_port, + uint32_t *acquired_hw_path) { int rc = -EINVAL; int i; @@ -3362,6 +3380,9 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_rdi( ife_ctx->left_hw_idx = csid_res->hw_res[0]->hw_intf->hw_idx; } + if (ife_ctx->flags.is_sfe_shdr) + *acquired_hw_path |= cam_convert_csid_res_to_path( + csid_res->res_id); cam_ife_hw_mgr_put_res(&ife_ctx->res_list_ife_csid, &csid_res); } @@ -4161,7 +4182,8 @@ skip_csid_pxl: if (in_port->rdi_count) { /* get ife csid RDI resource */ - rc = cam_ife_hw_mgr_acquire_res_ife_csid_rdi(ife_ctx, in_port); + rc = cam_ife_hw_mgr_acquire_res_ife_csid_rdi(ife_ctx, in_port, + acquired_hw_path); if (rc) { CAM_ERR(CAM_ISP, "Acquire IFE CSID RDI resource Failed"); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid680.h b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid680.h index e919a60b40..4882962046 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid680.h +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid680.h @@ -422,8 +422,6 @@ static struct cam_ife_csid_ver2_pxl_reg_info .bin_pd_detect_x_end_shift_val = 16, .bin_pd_detect_y_offset_shift_val = 0, .bin_pd_detect_y_end_shift_val = 16, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .lut_bank_0_sel_val = 0, .lut_bank_1_sel_val = 1, .fatal_err_mask = 0x186004, @@ -617,8 +615,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186004, .non_fatal_err_mask = 0x10000000, @@ -713,8 +709,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186004, .non_fatal_err_mask = 0x10000000, @@ -809,8 +803,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186004, .non_fatal_err_mask = 0x10000000, @@ -905,8 +897,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186004, .non_fatal_err_mask = 0x10000000, @@ -1001,8 +991,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .format_measure_en_shift_val = 3, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186004, .non_fatal_err_mask = 0x10000000, diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid780.h b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid780.h index 48a462ff49..a79a9a07e6 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid780.h +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid780.h @@ -450,8 +450,6 @@ static struct cam_ife_csid_ver2_pxl_reg_info .bin_pd_detect_x_end_shift_val = 16, .bin_pd_detect_y_offset_shift_val = 0, .bin_pd_detect_y_end_shift_val = 16, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .lut_bank_0_sel_val = 0, .lut_bank_1_sel_val = 1, .fatal_err_mask = 0x186007, @@ -642,8 +640,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186007, .non_fatal_err_mask = 0x10000000, @@ -738,8 +734,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186007, .non_fatal_err_mask = 0x10000000, @@ -834,8 +828,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186007, .non_fatal_err_mask = 0x10000000, @@ -930,8 +922,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .timestamp_en_shift_val = 4, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186007, .non_fatal_err_mask = 0x10000000, @@ -1026,8 +1016,6 @@ static struct cam_ife_csid_ver2_rdi_reg_info .format_measure_en_shift_val = 3, .debug_byte_cntr_rst_shift_val = 2, .offline_mode_en_shift_val = 2, - .pix_pattern_shift_val = 24, - .stripe_loc_shift_val = 20, .ccif_violation_en = 1, .fatal_err_mask = 0x186007, .non_fatal_err_mask = 0x10000000, diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c index e7f7a7508d..7d26725d83 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c @@ -1856,7 +1856,6 @@ static int cam_ife_csid_hw_ver2_config_path_data( path_cfg->vertical_bin = reserve->in_port->vertical_bin; path_cfg->qcfa_bin = reserve->in_port->qcfa_bin; path_cfg->num_bytes_out = reserve->in_port->num_bytes_out; - path_cfg->pix_pattern = reserve->in_port->test_pattern; if (reserve->sync_mode == CAM_ISP_HW_SYNC_MASTER) { path_cfg->start_pixel = reserve->in_port->left_start; path_cfg->end_pixel = reserve->in_port->left_stop; @@ -2004,12 +2003,9 @@ static int cam_ife_csid_ver_config_camif( path_cfg->camif_data.epoch0 = epoch0; - path_cfg->camif_data.pix_pattern = reserve->in_port->test_pattern; - end: - CAM_DBG(CAM_ISP, "CSID[%d] pix_pattern: %d epoch0: 0x%x", - csid_hw->hw_intf->hw_idx, - path_cfg->camif_data.pix_pattern, epoch0); + CAM_DBG(CAM_ISP, "CSID[%d] epoch0: 0x%x", + csid_hw->hw_intf->hw_idx, epoch0); return rc; } @@ -2438,9 +2434,6 @@ static int cam_ife_csid_ver2_init_config_rdi_path( /* set frame drop pattern to 0 and period to 1 */ cam_io_w_mb(1, mem_base + path_reg->frm_drop_period_addr); cam_io_w_mb(0, mem_base + path_reg->frm_drop_pattern_addr); - /* set irq sub sample pattern to 1 and period to 0 */ - cam_io_w_mb(0, mem_base + path_reg->irq_subsample_period_addr); - cam_io_w_mb(1, mem_base + path_reg->irq_subsample_pattern_addr); /*TODO Need to check for any hw errata like 480 and 580*/ /* set pxl drop pattern to 0 and period to 1 */ @@ -2618,9 +2611,6 @@ static int cam_ife_csid_ver2_init_config_pxl_path( /* set frame drop pattern to 0 and period to 1 */ cam_io_w_mb(1, mem_base + path_reg->frm_drop_period_addr); cam_io_w_mb(0, mem_base + path_reg->frm_drop_pattern_addr); - /* set irq sub sample pattern to 1 and period to 1 */ - cam_io_w_mb(0, mem_base + path_reg->irq_subsample_period_addr); - cam_io_w_mb(1, mem_base + path_reg->irq_subsample_pattern_addr); /* set pxl drop pattern to 0 and period to 1 */ cam_io_w_mb(0, mem_base + path_reg->pix_drop_pattern_addr); cam_io_w_mb(1, mem_base + path_reg->pix_drop_period_addr); @@ -2731,12 +2721,6 @@ static int cam_ife_csid_ver2_program_rdi_path( csid_hw->hw_intf->hw_idx, res->res_id); /*Program the camif part */ - val = (path_cfg->camif_data.pix_pattern << - path_reg->pix_pattern_shift_val) | - (path_cfg->camif_data.stripe_loc << - path_reg->stripe_loc_shift_val); - - cam_io_w_mb(val, mem_base + path_reg->camif_frame_cfg_addr); cam_io_w_mb(path_cfg->camif_data.epoch0 << path_reg->epoch0_shift_val, mem_base + path_reg->epoch_irq_cfg_addr); @@ -2869,12 +2853,6 @@ static int cam_ife_csid_ver2_program_ipp_path( mem_base = soc_info->reg_map[CAM_IFE_CSID_CLC_MEM_BASE_ID].mem_base; path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; - val = (path_cfg->camif_data.pix_pattern << - path_reg->pix_pattern_shift_val) | - (path_cfg->camif_data.stripe_loc << - path_reg->stripe_loc_shift_val); - - cam_io_w_mb(val, mem_base + path_reg->camif_frame_cfg_addr); cam_io_w_mb(path_cfg->camif_data.epoch0 << path_reg->epoch0_shift_val, mem_base + path_reg->epoch_irq_cfg_addr); @@ -3085,12 +3063,6 @@ static int cam_ife_csid_ver2_program_ppp_path( path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; - val = (path_cfg->camif_data.pix_pattern << - path_reg->pix_pattern_shift_val) | - (path_cfg->camif_data.stripe_loc << - path_reg->stripe_loc_shift_val); - - cam_io_w_mb(val, mem_base + path_reg->camif_frame_cfg_addr); cam_io_w_mb(path_cfg->camif_data.epoch0 << path_reg->epoch0_shift_val, mem_base + path_reg->epoch_irq_cfg_addr); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.h b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.h index 3383b788f7..4bc1a39325 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.h +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.h @@ -115,16 +115,12 @@ struct cam_ife_csid_ver2_evt_payload { }; /* - * struct cam_ife_csid_ver2_path_cfg: place holder for path parameters + * struct cam_ife_csid_ver2_camif_data: place holder for camif parameters * - * @pix_pattern: Pix pattern for incoming data - * @stripe_loc: Stripe location * @epoch0_cfg: Epoch 0 configuration value * @epoch1_cfg: Epoch 1 configuration value */ struct cam_ife_csid_ver2_camif_data { - uint32_t pix_pattern; - uint32_t stripe_loc; uint32_t epoch0; uint32_t epoch1; }; @@ -149,7 +145,6 @@ struct cam_ife_csid_ver2_camif_data { * @qcfa_bin : qcfa binning enable/disable on path * @hor_ver_bin : horizontal vertical binning enable/disable on path * @num_bytes_out: Number of bytes out - * @pix_pattern: Pixel Pattern * @irq_handle: IRQ handle * @err_irq_handle: Error IRQ handle * @discard_irq_handle: IRQ handle for SOF when discarding initial frames @@ -183,7 +178,6 @@ struct cam_ife_csid_ver2_path_cfg { uint32_t qcfa_bin; uint32_t hor_ver_bin; uint32_t num_bytes_out; - uint32_t pix_pattern; uint32_t irq_handle; uint32_t err_irq_handle; uint32_t discard_irq_handle; @@ -295,14 +289,11 @@ struct cam_ife_csid_ver2_rdi_reg_info { uint32_t byte_cntr_en_shift_val; uint32_t offline_mode_en_shift_val; uint32_t debug_byte_cntr_rst_shift_val; - uint32_t stripe_loc_shift_val; - uint32_t pix_pattern_shift_val; uint32_t ccif_violation_en; uint32_t overflow_ctrl_mode_val; uint32_t overflow_ctrl_en; uint32_t fatal_err_mask; uint32_t non_fatal_err_mask; - uint32_t pix_pattern_shift; uint32_t camif_irq_mask; uint32_t rup_aup_mask; uint32_t top_irq_mask; @@ -410,8 +401,6 @@ struct cam_ife_csid_ver2_pxl_reg_info { uint32_t bin_pd_detect_x_end_shift_val; uint32_t bin_pd_detect_y_offset_shift_val; uint32_t bin_pd_detect_y_end_shift_val; - uint32_t stripe_loc_shift_val; - uint32_t pix_pattern_shift_val; uint32_t epoch0_cfg_val; uint32_t epoch1_cfg_val; uint32_t epoch0_shift_val; @@ -473,8 +462,6 @@ struct cam_ife_csid_ver2_common_reg_info { uint32_t num_padding_rows_shift_val; uint32_t num_vbi_lines_shift_val; uint32_t num_hbi_cycles_shift_val; - uint32_t camif_stripe_loc_shift_val; - uint32_t camif_pix_pattern_shift_val; uint32_t epoch0_line_shift_val; uint32_t epoch1_line_shift_val; uint32_t camif_width_shift_val;