Selaa lähdekoodia

msm: camera: ope: Fixed for IRQ mask and log printing

Adding fixes to set IRQ mask after reset and strings to
print OPE CPAS PATH enums.

CRs-Fixed: 2594541
Change-Id: I5873b8b0494623c36ca94edf7a26cc952fbb5e68
Signed-off-by: Rishabh Jain <[email protected]>
Rishabh Jain 5 vuotta sitten
vanhempi
sitoutus
eb74ea19e4

+ 13 - 1
drivers/cam_cpas/cam_cpas_intf.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  */
  */
 
 
 #include <linux/of.h>
 #include <linux/of.h>
@@ -83,6 +83,18 @@ const char *cam_cpas_axi_util_path_type_to_string(
 	case CAM_AXI_PATH_DATA_IPE_WR_REF:
 	case CAM_AXI_PATH_DATA_IPE_WR_REF:
 		return "IPE_WR_REF";
 		return "IPE_WR_REF";
 
 
+	/* OPE Paths */
+	case CAM_AXI_PATH_DATA_OPE_RD_IN:
+		return "OPE_RD_IN";
+	case CAM_AXI_PATH_DATA_OPE_RD_REF:
+		return "OPE_RD_REF";
+	case CAM_AXI_PATH_DATA_OPE_WR_VID:
+		return "OPE_WR_VID";
+	case CAM_AXI_PATH_DATA_OPE_WR_DISP:
+		return "OPE_WR_DISP";
+	case CAM_AXI_PATH_DATA_OPE_WR_REF:
+		return "OPE_WR_REF";
+
 	/* Common Paths */
 	/* Common Paths */
 	case CAM_AXI_PATH_DATA_ALL:
 	case CAM_AXI_PATH_DATA_ALL:
 		return "DATA_ALL";
 		return "DATA_ALL";

+ 1 - 1
drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c

@@ -3372,7 +3372,7 @@ static int cam_isp_tfe_packet_generic_blob_handler(void *user_data,
 		if ((hfr_config->num_ports != 0) && (blob_size <
 		if ((hfr_config->num_ports != 0) && (blob_size <
 			(sizeof(struct cam_isp_tfe_resource_hfr_config) +
 			(sizeof(struct cam_isp_tfe_resource_hfr_config) +
 			(hfr_config->num_ports - 1) *
 			(hfr_config->num_ports - 1) *
-			sizeof(struct cam_isp_tfe_resource_hfr_config)))) {
+			sizeof(struct cam_isp_tfe_port_hfr_config)))) {
 			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
 			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
 				blob_size,
 				blob_size,
 				sizeof(struct cam_isp_tfe_resource_hfr_config) +
 				sizeof(struct cam_isp_tfe_resource_hfr_config) +

+ 1 - 7
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c

@@ -535,7 +535,7 @@ static int cam_tfe_bus_acquire_wm(
 				rsrc_data->format);
 				rsrc_data->format);
 			return -EINVAL;
 			return -EINVAL;
 		}
 		}
-	} else if (rsrc_data->index == 0) {
+	} else if (rsrc_data->index == 0 || rsrc_data->index == 1) {
 	/*  WM 0 FULL_OUT */
 	/*  WM 0 FULL_OUT */
 		switch (rsrc_data->format) {
 		switch (rsrc_data->format) {
 		case CAM_FORMAT_MIPI_RAW_8:
 		case CAM_FORMAT_MIPI_RAW_8:
@@ -571,12 +571,6 @@ static int cam_tfe_bus_acquire_wm(
 		rsrc_data->height = 0;
 		rsrc_data->height = 0;
 		rsrc_data->stride = 1;
 		rsrc_data->stride = 1;
 		rsrc_data->en_cfg = (0x1 << 16) | 0x1;
 		rsrc_data->en_cfg = (0x1 << 16) | 0x1;
-	} else if (rsrc_data->index == 1) {
-		/* WM 1 Raw dump */
-		rsrc_data->stride = rsrc_data->width;
-		rsrc_data->en_cfg = 0x1;
-		/* LSB aligned */
-		rsrc_data->pack_fmt |= 0x10;
 	} else {
 	} else {
 		CAM_ERR(CAM_ISP, "Invalid WM:%d requested", rsrc_data->index);
 		CAM_ERR(CAM_ISP, "Invalid WM:%d requested", rsrc_data->index);
 		return -EINVAL;
 		return -EINVAL;

+ 0 - 7
drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.c

@@ -1858,13 +1858,6 @@ static int cam_ope_get_acquire_info(struct cam_ope_hw_mgr *hw_mgr,
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
-	if (args->acquire_info_size <
-		sizeof(struct ope_acquire_dev_info)) {
-		CAM_ERR(CAM_OPE, "Invalid acquire size = %d",
-			args->acquire_info_size);
-		return -EINVAL;
-	}
-
 	if (copy_from_user(&ctx->ope_acquire,
 	if (copy_from_user(&ctx->ope_acquire,
 		(void __user *)args->acquire_info,
 		(void __user *)args->acquire_info,
 		sizeof(struct ope_acquire_dev_info))) {
 		sizeof(struct ope_acquire_dev_info))) {

+ 2 - 0
drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.h

@@ -67,6 +67,7 @@
  * @budget_ns: Time required to process frame
  * @budget_ns: Time required to process frame
  * @frame_cycles: Frame cycles needed to process the frame
  * @frame_cycles: Frame cycles needed to process the frame
  * @rt_flag: Flag to indicate real time stream
  * @rt_flag: Flag to indicate real time stream
+ * @reserved: Reserved for future use
  * @num_paths: Number of paths for per path bw vote
  * @num_paths: Number of paths for per path bw vote
  * @axi_path: Per path vote info for OPE
  * @axi_path: Per path vote info for OPE
  */
  */
@@ -74,6 +75,7 @@ struct cam_ope_clk_bw_req_internal_v2 {
 	uint64_t budget_ns;
 	uint64_t budget_ns;
 	uint32_t frame_cycles;
 	uint32_t frame_cycles;
 	uint32_t rt_flag;
 	uint32_t rt_flag;
+	uint32_t reserved;
 	uint32_t num_paths;
 	uint32_t num_paths;
 	struct cam_axi_per_path_bw_vote axi_path[CAM_OPE_MAX_PER_PATH_VOTES];
 	struct cam_axi_per_path_bw_vote axi_path[CAM_OPE_MAX_PER_PATH_VOTES];
 };
 };

+ 0 - 4
drivers/cam_ope/ope_hw_mgr/ope_hw/bus_wr/ope_bus_wr.c

@@ -691,7 +691,6 @@ static int cam_ope_bus_wr_isr(struct ope_hw *ope_hw_info,
 	uint32_t irq_status_0, irq_status_1;
 	uint32_t irq_status_0, irq_status_1;
 	struct cam_ope_bus_wr_reg *bus_wr_reg;
 	struct cam_ope_bus_wr_reg *bus_wr_reg;
 	struct cam_ope_bus_wr_reg_val *bus_wr_reg_val;
 	struct cam_ope_bus_wr_reg_val *bus_wr_reg_val;
-	struct cam_ope_irq_data *irq_data = data;
 
 
 	if (!ope_hw_info) {
 	if (!ope_hw_info) {
 		CAM_ERR(CAM_OPE, "Invalid ope_hw_info");
 		CAM_ERR(CAM_OPE, "Invalid ope_hw_info");
@@ -713,17 +712,14 @@ static int cam_ope_bus_wr_isr(struct ope_hw *ope_hw_info,
 		bus_wr_reg->base + bus_wr_reg->irq_cmd);
 		bus_wr_reg->base + bus_wr_reg->irq_cmd);
 
 
 	if (irq_status_0 & bus_wr_reg_val->cons_violation) {
 	if (irq_status_0 & bus_wr_reg_val->cons_violation) {
-		irq_data->error = 1;
 		CAM_ERR(CAM_OPE, "ope bus wr cons_violation");
 		CAM_ERR(CAM_OPE, "ope bus wr cons_violation");
 	}
 	}
 
 
 	if (irq_status_0 & bus_wr_reg_val->violation) {
 	if (irq_status_0 & bus_wr_reg_val->violation) {
-		irq_data->error = 1;
 		CAM_ERR(CAM_OPE, "ope bus wr  vioalation");
 		CAM_ERR(CAM_OPE, "ope bus wr  vioalation");
 	}
 	}
 
 
 	if (irq_status_0 & bus_wr_reg_val->img_size_violation) {
 	if (irq_status_0 & bus_wr_reg_val->img_size_violation) {
-		irq_data->error = 1;
 		CAM_ERR(CAM_OPE, "ope bus wr  img_size_violation");
 		CAM_ERR(CAM_OPE, "ope bus wr  img_size_violation");
 	}
 	}
 
 

+ 8 - 0
drivers/cam_ope/ope_hw_mgr/ope_hw/top/ope_top.c

@@ -66,6 +66,10 @@ static int cam_ope_top_reset(struct ope_hw *ope_hw_info,
 		rc = 0;
 		rc = 0;
 	}
 	}
 
 
+	/* enable interrupt mask */
+	cam_io_w_mb(top_reg_val->irq_mask,
+		ope_hw_info->top_reg->base + top_reg->irq_mask);
+
 	return rc;
 	return rc;
 }
 }
 
 
@@ -131,6 +135,10 @@ static int cam_ope_top_init(struct ope_hw *ope_hw_info,
 			&ope_top_info.reset_complete,
 			&ope_top_info.reset_complete,
 			msecs_to_jiffies(30));
 			msecs_to_jiffies(30));
 
 
+	/* enable interrupt mask */
+	cam_io_w_mb(top_reg_val->irq_mask,
+		ope_hw_info->top_reg->base + top_reg->irq_mask);
+
 	if (!rc || rc < 0) {
 	if (!rc || rc < 0) {
 		CAM_ERR(CAM_OPE, "reset error result = %d", rc);
 		CAM_ERR(CAM_OPE, "reset error result = %d", rc);
 		if (!rc)
 		if (!rc)