Преглед на файлове

msm: camera: isp: Fix csid full and lite headers

Several bits for path based error IRQs are not subscribed
and few shift values are missing. Add missing info and fix
incorrect info in csid headers. Add hbi vbi printing in
format measure logging to give complete info at once.

CRs-Fixed: 3388992, 3376293
Change-Id: I9eb7ee7a4f3384774688184742300d66930ffa0c
Signed-off-by: Mukund Madhusudan Atre <[email protected]>
Mukund Madhusudan Atre преди 2 години
родител
ревизия
7e732bb355

+ 14 - 14
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid780.h

@@ -512,8 +512,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.bin_pd_detect_y_end_shift_val    = 16,
 		.lut_bank_0_sel_val               = 0,
 		.lut_bank_1_sel_val               = 1,
-		.fatal_err_mask                   = 0x186007,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000006,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -618,8 +618,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.start_master_sel_shift_val       = 4,
 		.lut_bank_0_sel_val               = 0,
 		.lut_bank_1_sel_val               = 1,
-		.fatal_err_mask                   = 0x186007,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000006,
 		.rup_aup_mask                     = 0x40004,
 		.top_irq_mask                     = 0x40,
 		.epoch0_shift_val                 = 16,
@@ -719,8 +719,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -827,8 +827,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -934,8 +934,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -1039,8 +1039,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -1143,8 +1143,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val   = 2,
 		.offline_mode_en_shift_val       = 2,
 		.ccif_violation_en               = 1,
-		.fatal_err_mask                  = 0x186005,
-		.non_fatal_err_mask              = 0x10000000,
+		.fatal_err_mask                  = 0x20186001,
+		.non_fatal_err_mask              = 0x12000004,
 		.sof_irq_mask                    = 0x10,
 		.rup_irq_mask                    = 0x800000,
 		.epoch0_irq_mask                 = 0x200000,

+ 15 - 15
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid880.h

@@ -525,8 +525,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.bin_pd_detect_y_end_shift_val    = 16,
 		.lut_bank_0_sel_val               = 0,
 		.lut_bank_1_sel_val               = 1,
-		.fatal_err_mask                   = 0x186007,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -634,8 +634,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.start_master_sel_shift_val       = 4,
 		.lut_bank_0_sel_val               = 0,
 		.lut_bank_1_sel_val               = 1,
-		.fatal_err_mask                   = 0x186007,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.rup_aup_mask                     = 0x40004,
 		.top_irq_mask                     = 0x40,
 		.epoch0_shift_val                 = 16,
@@ -738,8 +738,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -849,8 +849,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -959,8 +959,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -1067,8 +1067,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val    = 2,
 		.offline_mode_en_shift_val        = 2,
 		.ccif_violation_en                = 1,
-		.fatal_err_mask                   = 0x186005,
-		.non_fatal_err_mask               = 0x10000000,
+		.fatal_err_mask                   = 0x20186001,
+		.non_fatal_err_mask               = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -1174,8 +1174,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.debug_byte_cntr_rst_shift_val   = 2,
 		.offline_mode_en_shift_val       = 2,
 		.ccif_violation_en               = 1,
-		.fatal_err_mask                  = 0x186005,
-		.non_fatal_err_mask              = 0x10000000,
+		.fatal_err_mask                  = 0x20186001,
+		.non_fatal_err_mask              = 0x12000004,
 		.sof_irq_mask                     = 0x10,
 		.rup_irq_mask                     = 0x800000,
 		.epoch0_irq_mask                  = 0x200000,
@@ -1256,7 +1256,7 @@ static struct cam_ife_csid_csi2_rx_reg_info
 		.epd_mode_shift_en               = 8,
 		.eotp_shift_en                   = 9,
 		.dyn_sensor_switch_shift_en      = 10,
-		.rup_aup_latch_shift             = 11,
+		.rup_aup_latch_shift             = 13,
 		.rup_aup_latch_supported         = true,
 		.long_pkt_strobe_rst_shift       = 0,
 		.short_pkt_strobe_rst_shift      = 1,

+ 11 - 4
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c

@@ -62,6 +62,10 @@ static void cam_ife_csid_ver2_print_debug_reg_status(
 	struct cam_ife_csid_ver2_hw *csid_hw,
 	struct cam_isp_resource_node    *res);
 
+static int cam_ife_csid_ver2_print_hbi_vbi(
+	struct cam_ife_csid_ver2_hw  *csid_hw,
+	struct cam_isp_resource_node *res);
+
 static bool cam_ife_csid_ver2_cpas_cb(
 	uint32_t handle, void *user_data, struct cam_cpas_irq_data *irq_data)
 {
@@ -1841,15 +1845,16 @@ void cam_ife_csid_ver2_print_format_measure_info(
 		csid_reg->path_reg[res->res_id];
 	struct cam_hw_soc_info *soc_info = &csid_hw->hw_info->soc_info;
 	void __iomem *base = soc_info->reg_map[CAM_IFE_CSID_CLC_MEM_BASE_ID].mem_base;
-	uint32_t expected_frame = 0, actual_frame = 0;
+	uint32_t expected_frame = 0, actual_frame = 0, format_measure_cfg0 = 0;
 	int data_idx = 0;
 
 	actual_frame = cam_io_r_mb(base + path_reg->format_measure0_addr);
 	expected_frame = cam_io_r_mb(base + path_reg->format_measure_cfg1_addr);
+	format_measure_cfg0 = cam_io_r_mb(base + path_reg->format_measure_cfg0_addr);
 
-	CAM_INFO(CAM_ISP, "CSID[%u] res [id :%d name : %s]",
-		csid_hw->hw_intf->hw_idx,
-		res->res_id, res->res_name);
+	CAM_INFO(CAM_ISP, "CSID[%u] res [id :%d name : %s] format_measure_cfg0:0x%x",
+		csid_hw->hw_intf->hw_idx, res->res_id, res->res_name,
+		format_measure_cfg0);
 	CAM_ERR(CAM_ISP, "CSID[%u] Frame Size Error Expected[h: %u w: %u] Actual[h: %u w: %u]",
 		csid_hw->hw_intf->hw_idx, ((expected_frame >>
 		csid_reg->cmn_reg->format_measure_height_shift_val) &
@@ -1862,6 +1867,8 @@ void cam_ife_csid_ver2_print_format_measure_info(
 		actual_frame &
 		csid_reg->cmn_reg->format_measure_width_mask_val);
 
+	cam_ife_csid_ver2_print_hbi_vbi(csid_hw, res);
+
 	/* AUX settings update to phy for pix and line count errors */
 	data_idx = (int)(csid_hw->rx_cfg.phy_sel - csid_reg->cmn_reg->phy_sel_base_idx);
 	if (data_idx < 0)

+ 17 - 12
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_lite780.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_IFE_CSID_LITE_780_H_
@@ -180,7 +180,7 @@ static const struct cam_ife_csid_irq_desc cam_ife_csid_lite_780_path_irq_desc[]
 	{
 		.bitmask = BIT(14),
 		.err_type = CAM_ISP_HW_ERROR_CSID_FRAME_SIZE,
-		.desc = "ERROR_PIX_COUNT",
+		.desc = "ERROR_LINE_COUNT",
 		.err_handler = cam_ife_csid_ver2_print_format_measure_info,
 	},
 	{
@@ -455,6 +455,10 @@ static struct cam_ife_csid_ver2_common_reg_info
 	.global_reset                                 = 1,
 	.rup_supported                                = 1,
 	.only_master_rup                              = 1,
+	.format_measure_height_mask_val               = 0xFFFF,
+	.format_measure_height_shift_val              = 0x10,
+	.format_measure_width_mask_val                = 0xFFFF,
+	.format_measure_width_shift_val               = 0x0,
 	.top_reset_irq_mask                           = 0x1,
 	.top_buf_done_irq_mask                        = 0x2000,
 	.decode_format_payload_only                   = 0xF,
@@ -627,8 +631,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.overflow_ctrl_mode_val               = 0x8,
 		.min_hbi_shift_val                    = 4,
 		.start_master_sel_shift_val           = 4,
-		.fatal_err_mask                       = 0x7,
-		.non_fatal_err_mask                   = 0x10080000,
+		.fatal_err_mask                       = 0x20186001,
+		.non_fatal_err_mask                   = 0x12000006,
 		.sof_irq_mask                         = 0x10,
 		.rup_irq_mask                         = 0x800000,
 		.epoch0_irq_mask                      = 0x200000,
@@ -718,9 +722,10 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.format_measure_en_shift_val         = 3,
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
+		.sof_retiming_dis_shift              = 5,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                         = 0x10,
 		.rup_irq_mask                         = 0x800000,
 		.epoch0_irq_mask                      = 0x200000,
@@ -811,8 +816,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                         = 0x10,
 		.rup_irq_mask                         = 0x800000,
 		.epoch0_irq_mask                      = 0x200000,
@@ -903,8 +908,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                         = 0x10,
 		.rup_irq_mask                         = 0x800000,
 		.epoch0_irq_mask                      = 0x200000,
@@ -995,8 +1000,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                         = 0x10,
 		.rup_irq_mask                         = 0x800000,
 		.epoch0_irq_mask                      = 0x200000,

+ 17 - 13
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_lite880.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_IFE_CSID_LITE_880_H_
@@ -190,7 +190,7 @@ static const struct cam_ife_csid_irq_desc cam_ife_csid_lite_880_path_irq_desc[]
 	{
 		.bitmask = BIT(14),
 		.err_type = CAM_ISP_HW_ERROR_CSID_FRAME_SIZE,
-		.desc = "ERROR_PIX_COUNT",
+		.desc = "ERROR_LINE_COUNT",
 		.err_handler = cam_ife_csid_ver2_print_format_measure_info,
 	},
 	{
@@ -464,6 +464,10 @@ static struct cam_ife_csid_ver2_common_reg_info
 	.global_reset                                 = 1,
 	.rup_supported                                = 1,
 	.only_master_rup                              = 1,
+	.format_measure_height_mask_val               = 0xFFFF,
+	.format_measure_height_shift_val              = 0x10,
+	.format_measure_width_mask_val                = 0xFFFF,
+	.format_measure_width_shift_val               = 0x0,
 	.top_reset_irq_mask                           = 0x1,
 	.top_buf_done_irq_mask                        = 0x2000,
 	.decode_format_payload_only                   = 0xF,
@@ -540,7 +544,7 @@ static struct cam_ife_csid_csi2_rx_reg_info
 		.epd_mode_shift_en                    = 8,
 		.eotp_shift_en                        = 9,
 		.dyn_sensor_switch_shift_en           = 10,
-		.rup_aup_latch_shift                  = 11,
+		.rup_aup_latch_shift                  = 13,
 		.rup_aup_latch_supported              = true,
 		.long_pkt_strobe_rst_shift            = 0,
 		.short_pkt_strobe_rst_shift           = 1,
@@ -636,8 +640,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.overflow_ctrl_mode_val               = 0x8,
 		.min_hbi_shift_val                    = 4,
 		.start_master_sel_shift_val           = 4,
-		.fatal_err_mask                       = 0x7,
-		.non_fatal_err_mask                   = 0x10080000,
+		.fatal_err_mask                       = 0x20186001,
+		.non_fatal_err_mask                   = 0x12000004,
 		.sof_irq_mask                         = 0x10,
 		.rup_irq_mask                         = 0x800000,
 		.epoch0_irq_mask                      = 0x200000,
@@ -729,8 +733,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                        = 0x10,
 		.rup_irq_mask                        = 0x800000,
 		.epoch0_irq_mask                     = 0x200000,
@@ -822,8 +826,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                        = 0x10,
 		.rup_irq_mask                        = 0x800000,
 		.epoch0_irq_mask                     = 0x200000,
@@ -915,8 +919,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                        = 0x10,
 		.rup_irq_mask                        = 0x800000,
 		.epoch0_irq_mask                     = 0x200000,
@@ -1008,8 +1012,8 @@ static struct cam_ife_csid_ver2_path_reg_info
 		.timestamp_en_shift_val              = 6,
 		.debug_byte_cntr_rst_shift_val       = 2,
 		.ccif_violation_en                   = 1,
-		.fatal_err_mask                      = 0x5,
-		.non_fatal_err_mask                  = 0x10080000,
+		.fatal_err_mask                      = 0x20186001,
+		.non_fatal_err_mask                  = 0x12000004,
 		.sof_irq_mask                        = 0x10,
 		.rup_irq_mask                        = 0x800000,
 		.epoch0_irq_mask                     = 0x200000,