Ver código fonte

Merge "msm: camera: isp: Print the faulting IFE/SFE module" into camera-kernel.lnx.5.0

Savita Patted 4 anos atrás
pai
commit
75f34dc77d

+ 16 - 14
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe680.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
 
 #ifndef _CAM_SFE680_H_
@@ -176,19 +176,6 @@ static struct cam_sfe_top_common_reg_offset  sfe680_top_commong_reg  = {
 	.diag_sensor_status_1          = 0x0000003C,
 	.diag_sensor_frame_cnt_status0 = 0x00000040,
 	.diag_sensor_frame_cnt_status1 = 0x00000044,
-	.top_debug_0                   = 0x0000004C,
-	.top_debug_1                   = 0x00000050,
-	.top_debug_2                   = 0x00000054,
-	.top_debug_3                   = 0x00000058,
-	.top_debug_4                   = 0x0000005C,
-	.top_debug_5                   = 0x00000060,
-	.top_debug_6                   = 0x00000064,
-	.top_debug_7                   = 0x00000068,
-	.top_debug_8                   = 0x0000006C,
-	.top_debug_9                   = 0x00000070,
-	.top_debug_10                  = 0x00000074,
-	.top_debug_11                  = 0x00000078,
-	.top_debug_cfg                 = 0x0000007C,
 	.stats_ch2_throttle_cfg        = 0x000000B0,
 	.stats_ch1_throttle_cfg        = 0x000000B4,
 	.stats_ch0_throttle_cfg        = 0x000000B8,
@@ -196,6 +183,21 @@ static struct cam_sfe_top_common_reg_offset  sfe680_top_commong_reg  = {
 	.hdr_throttle_cfg              = 0x000000C0,
 	.sfe_op_throttle_cfg           = 0x000000C4,
 	.bus_overflow_status           = 0x00000868,
+	.top_debug_cfg                 = 0x0000007C,
+	.top_debug = {
+		0x0000004C,
+		0x00000050,
+		0x00000054,
+		0x00000058,
+		0x0000005C,
+		0x00000060,
+		0x00000064,
+		0x00000068,
+		0x0000006C,
+		0x00000070,
+		0x00000074,
+		0x00000078,
+	},
 };
 
 static struct cam_sfe_modules_common_reg_offset sfe680_modules_common_reg = {

+ 371 - 30
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_top/cam_sfe_top.c

@@ -70,6 +70,320 @@ struct cam_sfe_path_data {
 
 static int start_stop_cnt;
 
+struct cam_sfe_top_debug_info {
+	uint32_t  shift;
+	char     *clc_name;
+};
+
+static const struct cam_sfe_top_debug_info sfe_dbg_list[][8] = {
+	{
+		{
+			.shift = 0,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 4,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 8,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 12,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 16,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 20,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 24,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 28,
+			.clc_name = "test_bus_reserved"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "zsl_throttle"
+		},
+		{
+			.shift = 4,
+			.clc_name = "crc_zsl"
+		},
+		{
+			.shift = 8,
+			.clc_name = "comp_zsl"
+		},
+		{
+			.shift = 12,
+			.clc_name = "crc_prev"
+		},
+		{
+			.shift = 16,
+			.clc_name = "hdrc_ch2"
+		},
+		{
+			.shift = 20,
+			.clc_name = "hdrc_ch1"
+		},
+		{
+			.shift = 24,
+			.clc_name = "hdrc_ch0"
+		},
+		{
+			.shift = 28,
+			.clc_name = "stats_bhist_ch0"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "stats_bg_ch0"
+		},
+		{
+			.shift = 4,
+			.clc_name = "lsc_ch0"
+		},
+		{
+			.shift = 8,
+			.clc_name = "crc_ch0"
+		},
+		{
+			.shift = 12,
+			.clc_name = "ccif_2x2_to_2x1"
+		},
+		{
+			.shift = 16,
+			.clc_name = "decomp"
+		},
+		{
+			.shift = 20,
+			.clc_name = "msb_align_ch0"
+		},
+		{
+			.shift = 24,
+			.clc_name = "bpc_pdpc"
+		},
+		{
+			.shift = 28,
+			.clc_name = "ch0_gain"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "bhist_ch1"
+		},
+		{
+			.shift = 4,
+			.clc_name = "stats_bg_ch1"
+		},
+		{
+			.shift = 8,
+			.clc_name = "lsc_ch1"
+		},
+		{
+			.shift = 12,
+			.clc_name = "crc_ch1"
+		},
+		{
+			.shift = 16,
+			.clc_name = "msb_align_ch1"
+		},
+		{
+			.shift = 20,
+			.clc_name = "ch1_gain"
+		},
+		{
+			.shift = 24,
+			.clc_name = "bhist_ch2"
+		},
+		{
+			.shift = 28,
+			.clc_name = "stats_bg_ch2"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "lsc_ch2"
+		},
+		{
+			.shift = 4,
+			.clc_name = "crc_ch2"
+		},
+		{
+			.shift = 8,
+			.clc_name = "msb_align_ch2"
+		},
+		{
+			.shift = 12,
+			.clc_name = "ch2_gain"
+		},
+		{
+			.shift = 16,
+			.clc_name = "lcr_throttle"
+		},
+		{
+			.shift = 20,
+			.clc_name = "lcr"
+		},
+		{
+			.shift = 24,
+			.clc_name = "demux_fetch2"
+		},
+		{
+			.shift = 28,
+			.clc_name = "demux_fetch1"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "demux_fetch0"
+		},
+		{
+			.shift = 4,
+			.clc_name = "csid_ccif"
+		},
+		{
+			.shift = 8,
+			.clc_name = "RDI4"
+		},
+		{
+			.shift = 12,
+			.clc_name = "RDI3"
+		},
+		{
+			.shift = 16,
+			.clc_name = "RDI2"
+		},
+		{
+			.shift = 20,
+			.clc_name = "RDI1"
+		},
+		{
+			.shift = 24,
+			.clc_name = "RDI0"
+		},
+		{
+			.shift = 28,
+			.clc_name = "bhist2_bus_wr"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "bg2_bus_wr"
+		},
+		{
+			.shift = 4,
+			.clc_name = "bhist1_bus_wr"
+		},
+		{
+			.shift = 8,
+			.clc_name = "bg1_bus_wr"
+		},
+		{
+			.shift = 12,
+			.clc_name = "bhist0_bus_wr"
+		},
+		{
+			.shift = 16,
+			.clc_name = "bg0_bus_wr"
+		},
+		{
+			.shift = 20,
+			.clc_name = "lcr_bus_wr"
+		},
+		{
+			.shift = 24,
+			.clc_name = "zsl_bus_wr"
+		},
+		{
+			.shift = 28,
+			.clc_name = "sfe_op_throttle"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "line_smooth"
+		},
+		{
+			.shift = 4,
+			.clc_name = "pp"
+		},
+		{
+			.shift = 8,
+			.clc_name = "bus_conv_ch2"
+		},
+		{
+			.shift = 12,
+			.clc_name = "bus_conv_ch1"
+		},
+		{
+			.shift = 16,
+			.clc_name = "bus_conv_ch0"
+		},
+		{
+			.shift = 20,
+			.clc_name = "fe_ch2"
+		},
+		{
+			.shift = 24,
+			.clc_name = "fe_ch1"
+		},
+		{
+			.shift = 28,
+			.clc_name = "fe_ch0"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "rdi4"
+		},
+		{
+			.shift = 4,
+			.clc_name = "rdi3"
+		},
+		{
+			.shift = 8,
+			.clc_name = "rdi2"
+		},
+		{
+			.shift = 12,
+			.clc_name = "rdi1"
+		},
+		{
+			.shift = 16,
+			.clc_name = "rdi0"
+		},
+		{
+			.shift = 20,
+			.clc_name = "pixel"
+		},
+		{
+			.shift = 24,
+			.clc_name = "reserved"
+		},
+		{
+			.shift = 28,
+			.clc_name = "reserved"
+		},
+	},
+};
+
 static const char *cam_sfe_top_res_id_to_string(
 	uint32_t res_id)
 {
@@ -91,47 +405,74 @@ static const char *cam_sfe_top_res_id_to_string(
 	}
 }
 
+static void cam_sfe_top_check_module_status(
+	uint32_t num_reg, uint32_t *reg_val,
+	const struct cam_sfe_top_debug_info status_list[][8])
+{
+	bool found = false;
+	uint32_t i, j, val = 0, len = 0;
+	uint8_t log_buf[1024];
+
+	if (!status_list)
+		return;
+
+	for (i = 0; i < num_reg; i++) {
+		/* Check for ideal values */
+		if ((reg_val[i] == 0) || (reg_val[i] == 0x55555555))
+			continue;
+
+		for (j = 0; j < 8; j++) {
+			val = reg_val[i] >> status_list[i][j].shift;
+			val &= 0xF;
+			if (val == 0 || val == 5)
+				continue;
+
+			len += scnprintf(log_buf + len, 1024 -
+				len, "\nCAM_INFO: %s [I:%u V:%u R:%u]",
+				status_list[i][j].clc_name,
+				((val >> 2) & 1), ((val >> 1) & 1),
+				(val & 1));
+			found = true;
+		}
+		if (found)
+			CAM_INFO_RATE_LIMIT(CAM_SFE, "Check config for Debug%u - %s", log_buf);
+		len = 0;
+		found = false;
+		memset(log_buf, 0, sizeof(uint8_t)*1024);
+	}
+}
+
 static void cam_sfe_top_print_debug_reg_info(
 	struct cam_sfe_top_priv *top_priv)
 {
 	void __iomem                    *mem_base;
 	struct cam_sfe_top_common_data  *common_data;
 	struct cam_hw_soc_info          *soc_info;
+	uint32_t                        *reg_val = NULL;
+	uint32_t num_reg = CAM_SFE_TOP_DBG_REG_MAX;
+	int i = 0, j;
 
 	common_data = &top_priv->common_data;
 	soc_info = common_data->soc_info;
 	mem_base = soc_info->reg_map[SFE_CORE_BASE_IDX].mem_base;
+	reg_val    = kcalloc(num_reg, sizeof(uint32_t), GFP_KERNEL);
+	if (!reg_val)
+		return;
+
+	while (i < num_reg) {
+		for (j = 0; j < 4 && i < num_reg; j++, i++) {
+			reg_val[i] = cam_io_r(mem_base +
+				common_data->common_reg->top_debug[i]);
+		}
+		CAM_INFO(CAM_SFE, "Debug%u: 0x%x Debug%u: 0x%x Debug%u: 0x%x Debug%u: 0x%x",
+			(i - 4), reg_val[i - 4], (i - 3), reg_val[i - 3],
+			(i - 2), reg_val[i - 2], (i - 1), reg_val[i - 1]);
+	}
+
+	cam_sfe_top_check_module_status(num_reg,
+		reg_val, sfe_dbg_list);
 
-	CAM_INFO(CAM_SFE,
-		"Debug0: 0x%x Debug1: 0x%x Debug2: 0x%x Debug3: 0x%x",
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_0),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_1),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_2),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_3));
-	CAM_INFO(CAM_SFE,
-		"Debug4: 0x%x Debug5: 0x%x Debug6: 0x%x Debug7: 0x%x",
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_4),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_5),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_6),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_7));
-	CAM_INFO(CAM_SFE,
-		"Debug8: 0x%x Debug9: 0x%x Debug10: 0x%x Debug11: 0x%x",
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_8),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_9),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_10),
-		cam_io_r_mb(mem_base +
-			common_data->common_reg->top_debug_11));
+	kfree(reg_val);
 }
 
 static struct cam_axi_vote *cam_sfe_top_delay_bw_reduction(

+ 5 - 14
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_top/cam_sfe_top.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
 
 #ifndef _CAM_SFE_TOP_H_
@@ -20,6 +20,8 @@
 #define CAM_SHIFT_TOP_CORE_CFG_OPS_MODE_CFG    1
 #define CAM_SHIFT_TOP_CORE_CFG_FS_MODE_CFG     0
 
+#define CAM_SFE_TOP_DBG_REG_MAX                12
+
 struct cam_sfe_top_module_desc {
 	uint32_t id;
 	uint8_t *desc;
@@ -48,19 +50,6 @@ struct cam_sfe_top_common_reg_offset {
 	uint32_t diag_sensor_status_1;
 	uint32_t diag_sensor_frame_cnt_status0;
 	uint32_t diag_sensor_frame_cnt_status1;
-	uint32_t top_debug_0;
-	uint32_t top_debug_1;
-	uint32_t top_debug_2;
-	uint32_t top_debug_3;
-	uint32_t top_debug_4;
-	uint32_t top_debug_5;
-	uint32_t top_debug_6;
-	uint32_t top_debug_7;
-	uint32_t top_debug_8;
-	uint32_t top_debug_9;
-	uint32_t top_debug_10;
-	uint32_t top_debug_11;
-	uint32_t top_debug_cfg;
 	uint32_t stats_ch2_throttle_cfg;
 	uint32_t stats_ch1_throttle_cfg;
 	uint32_t stats_ch0_throttle_cfg;
@@ -68,6 +57,8 @@ struct cam_sfe_top_common_reg_offset {
 	uint32_t hdr_throttle_cfg;
 	uint32_t sfe_op_throttle_cfg;
 	uint32_t bus_overflow_status;
+	uint32_t top_debug_cfg;
+	uint32_t top_debug[CAM_SFE_TOP_DBG_REG_MAX];
 };
 
 struct cam_sfe_modules_common_reg_offset {

+ 634 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c

@@ -90,6 +90,592 @@ struct cam_vfe_mux_ver4_data {
 	struct timespec64                     error_ts;
 };
 
+struct cam_vfe_top_debug_info {
+	uint32_t  shift;
+	char     *clc_name;
+};
+
+static const struct cam_vfe_top_debug_info vfe_dbg_list[][8] = {
+	{
+		{
+			.shift = 0,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 4,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 8,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 12,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 16,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 20,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 24,
+			.clc_name = "test_bus_reserved"
+		},
+		{
+			.shift = 28,
+			.clc_name = "test_bus_reserved"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "STATS_IHIST"
+		},
+		{
+			.shift = 4,
+			.clc_name = "STATS_RS"
+		},
+		{
+			.shift = 8,
+			.clc_name = "STATS_BAF"
+		},
+		{
+			.shift = 12,
+			.clc_name = "GTM_BHIST"
+		},
+		{
+			.shift = 16,
+			.clc_name = "TINTLESS_BG"
+		},
+		{
+			.shift = 20,
+			.clc_name = "STATS_BFW"
+		},
+		{
+			.shift = 24,
+			.clc_name = "STATS_BG"
+		},
+		{
+			.shift = 28,
+			.clc_name = "STATS_BHIST"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "STATS_BE"
+		},
+		{
+			.shift = 4,
+			.clc_name = "R2PD_DS16_C_VID"
+		},
+		{
+			.shift = 8,
+			.clc_name = "R2PD_DS16_Y_VID"
+		},
+		{
+			.shift = 12,
+			.clc_name = "crop_rnd_clamp_post_downscale_C_DS16_VID"
+		},
+		{
+			.shift = 16,
+			.clc_name = "4to1_C_DS16_VID"
+		},
+		{
+			.shift = 20,
+			.clc_name = "crop_rnd_clamp_post_downscale_Y_DS16_VID"
+		},
+		{
+			.shift = 24,
+			.clc_name = "4to1_Y_DS16_VID"
+		},
+		{
+			.shift = 28,
+			.clc_name = "crop_rnd_clamp_post_dsx_C_VID"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "R2PD_DS4_VID_C"
+		},
+		{
+			.shift = 4,
+			.clc_name = "R2PD_DS4_VID_Y"
+		},
+		{
+			.shift = 8,
+			.clc_name = "DSX_C"
+		},
+		{
+			.shift = 12,
+			.clc_name = "crop_rnd_clamp_post_dsx_Y_VID"
+		},
+		{
+			.shift = 16,
+			.clc_name = "DSX_Y"
+		},
+		{
+			.shift = 20,
+			.clc_name = "crop_rnd_clamp_post_downscale_mn_C_VID"
+		},
+		{
+			.shift = 24,
+			.clc_name = "downscale_mn_C_VID"
+		},
+		{
+			.shift = 28,
+			.clc_name = "crop_rnd_clamp_post_downscale_mn_Y_VID"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "MNDS_Y_VID"
+		},
+		{
+			.shift = 4,
+			.clc_name = "R2PD_DS16_C_DISP"
+		},
+		{
+			.shift = 8,
+			.clc_name = "R2PD_DS16_Y_DISP"
+		},
+		{
+			.shift = 12,
+			.clc_name = "crop_rnd_clamp_post_downscale_C_DS16_DISP"
+		},
+		{
+			.shift = 16,
+			.clc_name = "4to1_C_DS16_DISP"
+		},
+		{
+			.shift = 20,
+			.clc_name = "crop_rnd_clamp_post_downscale_Y_DS16_DISP"
+		},
+		{
+			.shift = 24,
+			.clc_name = "4to1_Y_DS16_DISP"
+		},
+		{
+			.shift = 28,
+			.clc_name = "R2PD_DS4_C_DISP"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "R2PD_DS4_Y_DISP"
+		},
+		{
+			.shift = 4,
+			.clc_name = "crop_rnd_clamp_post_downscale_C_DS4_DISP"
+		},
+		{
+			.shift = 8,
+			.clc_name = "4to1_C_DS4_DISP"
+		},
+		{
+			.shift = 12,
+			.clc_name = "crop_rnd_clamp_post_downscale_Y_DS4_DISP"
+		},
+		{
+			.shift = 16,
+			.clc_name = "4to1_Y_DS4_DISP"
+		},
+		{
+			.shift = 20,
+			.clc_name = "crop_rnd_clamp_post_downscale_mn_C_DISP"
+		},
+		{
+			.shift = 24,
+			.clc_name = "downscale_mn_C_DISP"
+		},
+		{
+			.shift = 28,
+			.clc_name = "crop_rnd_clamp_post_downscale_mn_Y_DISP"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "downscale_mn_Y_DISP"
+		},
+		{
+			.shift = 4,
+			.clc_name = "crop_rnd_clamp_post_downscale_mn_C_FD"
+		},
+		{
+			.shift = 8,
+			.clc_name = "downscale_mn_C_FD"
+		},
+		{
+			.shift = 12,
+			.clc_name = "crop_rnd_clamp_post_downscale_mn_Y_FD"
+		},
+		{
+			.shift = 16,
+			.clc_name = "downscale_mn_Y_FD"
+		},
+		{
+			.shift = 20,
+			.clc_name = "gtm_fd_out"
+		},
+		{
+			.shift = 24,
+			.clc_name = "uvg"
+		},
+		{
+			.shift = 28,
+			.clc_name = "color_xform"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "glut"
+		},
+		{
+			.shift = 4,
+			.clc_name = "gtm"
+		},
+		{
+			.shift = 8,
+			.clc_name = "color_correct"
+		},
+		{
+			.shift = 12,
+			.clc_name = "demosaic"
+		},
+		{
+			.shift = 16,
+			.clc_name = "hvx_tap2"
+		},
+		{
+			.shift = 20,
+			.clc_name = "lcac"
+		},
+		{
+			.shift = 24,
+			.clc_name = "bayer_ltm"
+		},
+		{
+			.shift = 28,
+			.clc_name = "bayer_gtm"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "bls"
+		},
+		{
+			.shift = 4,
+			.clc_name = "bpc_abf"
+		},
+		{
+			.shift = 8,
+			.clc_name = "gic"
+		},
+		{
+			.shift = 12,
+			.clc_name = "wb_gain"
+		},
+		{
+			.shift = 16,
+			.clc_name = "lsc"
+		},
+		{
+			.shift = 20,
+			.clc_name = "compdecomp_hxv_rx"
+		},
+		{
+			.shift = 24,
+			.clc_name = "compdecomp_hxv_tx"
+		},
+		{
+			.shift = 28,
+			.clc_name = "hvx_tap1"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "decompand"
+		},
+		{
+			.shift = 4,
+			.clc_name = "reserved"
+		},
+		{
+			.shift = 8,
+			.clc_name = "bincorrect"
+		},
+		{
+			.shift = 12,
+			.clc_name = "bpc_pdpc"
+		},
+		{
+			.shift = 16,
+			.clc_name = "channel_gain"
+		},
+		{
+			.shift = 20,
+			.clc_name = "bayer_argb_ccif_converter"
+		},
+		{
+			.shift = 24,
+			.clc_name = "crop_rnd_clamp_pre_argb_packer"
+		},
+		{
+			.shift = 28,
+			.clc_name = "chroma_up_uv"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "chroma_up_y"
+		},
+		{
+			.shift = 4,
+			.clc_name = "demux"
+		},
+		{
+			.shift = 8,
+			.clc_name = "hxv_tap0"
+		},
+		{
+			.shift = 12,
+			.clc_name = "preprocess"
+		},
+		{
+			.shift = 16,
+			.clc_name = "sparse_pd_ext"
+		},
+		{
+			.shift = 20,
+			.clc_name = "lcr"
+		},
+		{
+			.shift = 24,
+			.clc_name = "bayer_ltm_bus_wr"
+		},
+		{
+			.shift = 28,
+			.clc_name = "RDI2"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "RDI1"
+		},
+		{
+			.shift = 4,
+			.clc_name = "RDI0"
+		},
+		{
+			.shift = 8,
+			.clc_name = "lcr_bus_wr"
+		},
+		{
+			.shift = 12,
+			.clc_name = "pdaf_sad_bus_wr"
+		},
+		{
+			.shift = 16,
+			.clc_name = "pd_data_bus_wr"
+		},
+		{
+			.shift = 20,
+			.clc_name = "sparse_pd_bus_wr"
+		},
+		{
+			.shift = 24,
+			.clc_name = "ihist_bus_wr"
+		},
+		{
+			.shift = 28,
+			.clc_name = "flicker_rs_bus_wr"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "gtm_bhist_bus_wr"
+		},
+		{
+			.shift = 4,
+			.clc_name = "baf_bus_wr"
+		},
+		{
+			.shift = 8,
+			.clc_name = "bfw_bus_wr"
+		},
+		{
+			.shift = 12,
+			.clc_name = "bg_bus_wr"
+		},
+		{
+			.shift = 16,
+			.clc_name = "tintless_bg_bus_wr"
+		},
+		{
+			.shift = 20,
+			.clc_name = "bhist_bus_wr"
+		},
+		{
+			.shift = 24,
+			.clc_name = "be_bus_wr"
+		},
+		{
+			.shift = 28,
+			.clc_name = "pixel_raw_bus_wr"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "fd_c_bus_wr"
+		},
+		{
+			.shift = 4,
+			.clc_name = "fd_y_bus_wr"
+		},
+		{
+			.shift = 8,
+			.clc_name = "disp_ds16_bus_wr"
+		},
+		{
+			.shift = 12,
+			.clc_name = "disp_ds4_bus_wr"
+		},
+		{
+			.shift = 16,
+			.clc_name = "disp_c_bus_wr"
+		},
+		{
+			.shift = 20,
+			.clc_name = "disp_y_bus_wr"
+		},
+		{
+			.shift = 24,
+			.clc_name = "vid_ds16_bus_Wr"
+		},
+		{
+			.shift = 28,
+			.clc_name = "vid_ds4_bus_Wr"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "vid_c_bus_wr"
+		},
+		{
+			.shift = 4,
+			.clc_name = "vid_y_bus_wr"
+		},
+		{
+			.shift = 8,
+			.clc_name = "CLC_PDAF"
+		},
+		{
+			.shift = 12,
+			.clc_name = "PIX_PP"
+		},
+		{
+			.shift = 16,
+			.clc_name = "reserved"
+		},
+		{
+			.shift = 20,
+			.clc_name = "reserved"
+		},
+		{
+			.shift = 24,
+			.clc_name = "reserved"
+		},
+		{
+			.shift = 28,
+			.clc_name = "reserved"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 4,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 8,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 12,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 16,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 20,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 24,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 28,
+			.clc_name = "r2pd_reserved"
+		},
+	},
+	{
+		{
+			.shift = 0,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 4,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 8,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 12,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 16,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 20,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 24,
+			.clc_name = "r2pd_reserved"
+		},
+		{
+			.shift = 28,
+			.clc_name = "r2pd_reserved"
+		},
+	},
+};
+
 static int cam_vfe_top_ver4_mux_get_base(struct cam_vfe_top_ver4_priv *top_priv,
 	void *cmd_args, uint32_t arg_size)
 {
@@ -250,6 +836,42 @@ static int cam_vfe_top_ver4_clock_update(
 	return rc;
 }
 
+static void cam_vfe_top_ver4_check_module_status(
+	uint32_t num_reg, uint32_t *reg_val,
+	const struct cam_vfe_top_debug_info status_list[][8])
+{
+	bool found = false;
+	uint32_t i, j, val = 0, len = 0;
+	uint8_t log_buf[1024];
+
+	if (!status_list)
+		return;
+
+	for (i = 0; i < num_reg; i++) {
+		/* Check for ideal values */
+		if ((reg_val[i] == 0) || (reg_val[i] == 0x55555555))
+			continue;
+
+		for (j = 0; j < 8; j++) {
+			val = reg_val[i] >> status_list[i][j].shift;
+			val &= 0xF;
+			if (val == 0 || val == 5)
+				continue;
+
+			len += scnprintf(log_buf + len, 1024 -
+				len, "\nCAM_INFO: %s [I:%u V:%u R:%u]",
+				status_list[i][j].clc_name, ((val >> 2) & 1),
+				((val >> 1) & 1), (val & 1));
+			found = true;
+		}
+		if (found)
+			CAM_INFO_RATE_LIMIT(CAM_ISP, "Check config for Debug%u - %s", i, log_buf);
+		len = 0;
+		found = false;
+		memset(log_buf, 0, sizeof(uint8_t)*1024);
+	}
+}
+
 static void cam_vfe_top_ver4_print_debug_reg_status(
 	struct cam_vfe_top_ver4_priv *top_priv)
 {
@@ -258,14 +880,21 @@ static void cam_vfe_top_ver4_print_debug_reg_status(
 	uint32_t                                    num_reg =  0;
 	uint32_t                                    i = 0, j, len = 0;
 	uint8_t                                    *log_buf;
+	uint32_t                                   *reg_val = NULL;
 	struct cam_hw_soc_info                     *soc_info;
+	struct cam_vfe_soc_private                 *soc_priv;
 	void __iomem                               *base;
 
 	soc_info   =  top_priv->common_data.soc_info;
+	soc_priv   =  soc_info->soc_private;
 	common_reg =  top_priv->common_data.common_reg;
 	num_reg    =  common_reg->num_top_debug_reg;
 	base       =  soc_info->reg_map[VFE_CORE_BASE_IDX].mem_base;
 	log_buf    =  top_priv->log_buf;
+	reg_val    = kcalloc(num_reg, sizeof(uint32_t), GFP_KERNEL);
+
+	if (!reg_val)
+		return;
 
 	while (i < num_reg) {
 		len += scnprintf(log_buf + len, CAM_VFE_LEN_LOG_BUF - len,
@@ -274,6 +903,7 @@ static void cam_vfe_top_ver4_print_debug_reg_status(
 		for(j = 0; j < 4 && i < num_reg; j++, i++) {
 			val = cam_io_r(base +
 				common_reg->top_debug[i]);
+			reg_val[i] = val;
 			len += scnprintf(log_buf + len, CAM_VFE_LEN_LOG_BUF -
 				len, "\nstatus %2d : 0x%08x", i, val);
 		}
@@ -282,6 +912,8 @@ static void cam_vfe_top_ver4_print_debug_reg_status(
 		memset(log_buf, 0, sizeof(uint8_t)*CAM_VFE_LEN_LOG_BUF);
 	}
 
+	cam_vfe_top_ver4_check_module_status(num_reg, reg_val,
+		((soc_priv->is_ife_lite) ? NULL : vfe_dbg_list));
 	CAM_ERR(CAM_ISP, "VFE[%u] Bus overflow status 0x%x",
 		soc_info->index,
 		cam_io_r(base + common_reg->bus_overflow_status));
@@ -289,6 +921,8 @@ static void cam_vfe_top_ver4_print_debug_reg_status(
 	CAM_ERR(CAM_ISP, "VFE[%u] Bus  Violation status 0x%x",
 		soc_info->index,
 		cam_io_r(base + common_reg->bus_violation_status));
+
+	kfree(reg_val);
 }
 
 int cam_vfe_top_ver4_dump_timestamps(