Browse Source

Merge "msm: camera: isp: Add header file VFE and CSID for Diwali" into camera-kernel.lnx.5.0

Camera Software Integration 3 năm trước cách đây
mục cha
commit
af97f4555c

+ 31 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid570.h

@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _CAM_IFE_CSID_570_H_
+#define _CAM_IFE_CSID_570_H_
+
+#include <linux/module.h>
+#include "camera_main.h"
+#include "cam_ife_csid_dev.h"
+#include "cam_ife_csid_common.h"
+#include "cam_ife_csid_hw_ver1.h"
+
+/* Settings for 570 CSID are leveraged from 480 */
+static struct cam_ife_csid_ver1_reg_info cam_ife_csid_570_reg_info = {
+	.cmn_reg          = &cam_ife_csid_480_cmn_reg_info,
+	.csi2_reg         = &cam_ife_csid_480_csi2_reg_info,
+	.ipp_reg          = &cam_ife_csid_480_ipp_reg_info,
+	.ppp_reg          = &cam_ife_csid_480_ppp_reg_info,
+	.rdi_reg = {
+		&cam_ife_csid_480_rdi_0_reg_info,
+		&cam_ife_csid_480_rdi_1_reg_info,
+		&cam_ife_csid_480_rdi_2_reg_info,
+		NULL,
+		},
+	.tpg_reg = &cam_ife_csid_480_tpg_reg_info,
+	.width_fuse_max_val = 3,
+	.fused_max_width = {5612, 6048, 7308, UINT_MAX},
+};
+#endif /*_CAM_IFE_CSID_570_H_ */

+ 4 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_lite_mod.c

@@ -52,6 +52,10 @@ static const struct of_device_id cam_ife_csid_lite_dt_match[] = {
 		.compatible = "qcom,csid-lite480",
 		.data = &cam_ife_csid_lite_480_hw_info,
 	},
+	{
+		.compatible = "qcom,csid-lite570",
+		.data = &cam_ife_csid_lite_480_hw_info,
+	},
 	{
 		.compatible = "qcom,csid-lite580",
 		.data = &cam_ife_csid_lite_480_hw_info,

+ 10 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_mod.c

@@ -14,6 +14,7 @@
 #include "cam_ife_csid175.h"
 #include "cam_ife_csid175_200.h"
 #include "cam_ife_csid480.h"
+#include "cam_ife_csid570.h"
 #include "cam_ife_csid580.h"
 #include "cam_ife_csid680.h"
 #include "cam_ife_csid780.h"
@@ -50,6 +51,11 @@ static struct cam_ife_csid_core_info cam_ife_csid480_hw_info = {
 	.sw_version  = CAM_IFE_CSID_VER_1_0,
 };
 
+static struct cam_ife_csid_core_info cam_ife_csid570_hw_info = {
+	.csid_reg = &cam_ife_csid_570_reg_info,
+	.sw_version  = CAM_IFE_CSID_VER_1_0,
+};
+
 static struct cam_ife_csid_core_info cam_ife_csid580_hw_info = {
 	.csid_reg = &cam_ife_csid_580_reg_info,
 	.sw_version  = CAM_IFE_CSID_VER_1_0,
@@ -91,6 +97,10 @@ static const struct of_device_id cam_ife_csid_dt_match[] = {
 		.compatible = "qcom,csid480",
 		.data = &cam_ife_csid480_hw_info,
 	},
+	{
+		.compatible = "qcom,csid570",
+		.data = &cam_ife_csid570_hw_info,
+	},
 	{
 		.compatible = "qcom,csid580",
 		.data = &cam_ife_csid580_hw_info,

+ 9 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe.c

@@ -9,6 +9,7 @@
 #include "cam_vfe175.h"
 #include "cam_vfe175_130.h"
 #include "cam_vfe480.h"
+#include "cam_vfe570.h"
 #include "cam_vfe580.h"
 #include "cam_vfe680.h"
 #include "cam_vfe780.h"
@@ -42,6 +43,10 @@ static const struct of_device_id cam_vfe_dt_match[] = {
 		.compatible = "qcom,vfe480",
 		.data = &cam_vfe480_hw_info,
 	},
+	{
+		.compatible = "qcom,vfe570",
+		.data = &cam_vfe570_hw_info,
+	},
 	{
 		.compatible = "qcom,vfe580",
 		.data = &cam_vfe580_hw_info,
@@ -66,6 +71,10 @@ static const struct of_device_id cam_vfe_dt_match[] = {
 		.compatible = "qcom,vfe-lite480",
 		.data = &cam_vfe_lite48x_hw_info,
 	},
+	{
+		.compatible = "qcom,vfe-lite570",
+		.data = &cam_vfe_lite48x_hw_info,
+	},
 	{
 		.compatible = "qcom,vfe-lite580",
 		.data = &cam_vfe_lite48x_hw_info,

+ 129 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe570.h

@@ -0,0 +1,129 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ */
+
+
+#ifndef _CAM_VFE570_H_
+#define _CAM_VFE570_H_
+#include "cam_vfe480.h"
+#include "cam_vfe_top_ver3.h"
+#include "cam_vfe_core.h"
+
+static struct cam_vfe_camif_ver3_reg_data vfe_570_camif_reg_data = {
+	.pp_extern_reg_update_shift      = 4,
+	.dual_pd_extern_reg_update_shift = 17,
+	.extern_reg_update_mask          = 1,
+	.dual_ife_pix_en_shift           = 3,
+	.dual_ife_sync_sel_shift         = 18,
+	.operating_mode_shift            = 11,
+	.input_mux_sel_shift             = 5,
+	.pixel_pattern_shift             = 24,
+	.pixel_pattern_mask              = 0x7,
+	.dsp_mode_shift                  = 24,
+	.dsp_mode_mask                   = 0x1,
+	.dsp_en_shift                    = 23,
+	.dsp_en_mask                     = 0x1,
+	.reg_update_cmd_data             = 0x41,
+	.epoch_line_cfg                  = 0x00000014,
+	.sof_irq_mask                    = 0x00000001,
+	.epoch0_irq_mask                 = 0x00000004,
+	.epoch1_irq_mask                 = 0x00000008,
+	.eof_irq_mask                    = 0x00000002,
+	.error_irq_mask0                 = 0x82000200,
+	.error_irq_mask2                 = 0x30301F80,
+	.subscribe_irq_mask1             = 0x00000007,
+	.enable_diagnostic_hw            = 0x1,
+	.pp_camif_cfg_en_shift           = 0,
+	.pp_camif_cfg_ife_out_en_shift   = 8,
+	.top_debug_cfg_en                = 1,
+	.dual_vfe_sync_mask              = 0x3,
+	.input_bayer_fmt                 = 0,
+	.input_yuv_fmt                   = 1,
+
+};
+
+static struct cam_vfe_camif_lite_ver3_reg_data vfe570_camif_rdi1_reg_data = {
+	.extern_reg_update_shift         = 0,
+	.input_mux_sel_shift             = 7,
+	.reg_update_cmd_data             = 0x4,
+	.epoch_line_cfg                  = 0x0,
+	.sof_irq_mask                    = 0x100,
+	.epoch0_irq_mask                 = 0x400,
+	.epoch1_irq_mask                 = 0x800,
+	.eof_irq_mask                    = 0x200,
+	.error_irq_mask0                 = 0x10000000,
+	.error_irq_mask2                 = 0x40000,
+	.subscribe_irq_mask1             = 0x300,
+	.enable_diagnostic_hw            = 0x1,
+};
+
+struct cam_vfe_camif_lite_ver3_hw_info
+	vfe570_rdi_hw_info_arr[CAM_VFE_RDI_VER2_MAX] = {
+	{
+		.common_reg     = &vfe480_top_common_reg,
+		.camif_lite_reg = &vfe480_camif_rdi[0],
+		.reg_data       = &vfe480_camif_rdi_reg_data[0],
+	},
+	{
+		.common_reg     = &vfe480_top_common_reg,
+		.camif_lite_reg = &vfe480_camif_rdi[1],
+		.reg_data       = &vfe570_camif_rdi1_reg_data,
+	},
+	{
+		.common_reg     = &vfe480_top_common_reg,
+		.camif_lite_reg = &vfe480_camif_rdi[2],
+		.reg_data       = &vfe480_camif_rdi_reg_data[2],
+	},
+};
+
+static struct cam_vfe_top_ver3_hw_info vfe570_top_hw_info = {
+	.common_reg = &vfe480_top_common_reg,
+	.camif_hw_info = {
+		.common_reg     = &vfe480_top_common_reg,
+		.camif_reg      = &vfe480_camif_reg,
+		.reg_data       = &vfe_570_camif_reg_data,
+		},
+	.pdlib_hw_info = {
+		.common_reg     = &vfe480_top_common_reg,
+		.camif_lite_reg = &vfe480_camif_pd,
+		.reg_data       = &vfe480_camif_pd_reg_data,
+		},
+	.rdi_hw_info[0] = &vfe570_rdi_hw_info_arr[0],
+	.rdi_hw_info[1] = &vfe570_rdi_hw_info_arr[1],
+	.rdi_hw_info[2] = &vfe570_rdi_hw_info_arr[2],
+	.lcr_hw_info = {
+		.common_reg     = &vfe480_top_common_reg,
+		.camif_lite_reg = &vfe480_camif_lcr,
+		.reg_data       = &vfe480_camif_lcr_reg_data,
+		},
+	.num_mux = 6,
+	.mux_type = {
+		CAM_VFE_CAMIF_VER_3_0,
+		CAM_VFE_RDI_VER_1_0,
+		CAM_VFE_RDI_VER_1_0,
+		CAM_VFE_RDI_VER_1_0,
+		CAM_VFE_PDLIB_VER_1_0,
+		CAM_VFE_LCR_VER_1_0,
+	},
+	.num_path_port_map = 2,
+	.path_port_map = {
+		{CAM_ISP_HW_VFE_IN_LCR, CAM_ISP_IFE_OUT_RES_LCR},
+		{CAM_ISP_HW_VFE_IN_PDLIB, CAM_ISP_IFE_OUT_RES_2PD},
+	},
+};
+
+static struct cam_vfe_hw_info cam_vfe570_hw_info = {
+	.irq_hw_info                   = &vfe480_irq_hw_info,
+
+	.bus_version                   = CAM_VFE_BUS_VER_3_0,
+	.bus_hw_info                   = &vfe480_bus_hw_info,
+
+	.bus_rd_version                = CAM_VFE_BUS_RD_VER_1_0,
+	.bus_rd_hw_info                = &vfe480_bus_rd_hw_info,
+
+	.top_version                   = CAM_VFE_TOP_VER_3_0,
+	.top_hw_info                   = &vfe570_top_hw_info,
+};
+
+#endif /* _CAM_VFE570_H_ */

+ 1 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_lite_ver3.c

@@ -1103,6 +1103,7 @@ static int cam_vfe_camif_lite_handle_irq_bottom_half(
 	evt_info.hw_idx   = camif_lite_node->hw_intf->hw_idx;
 	evt_info.res_id   = camif_lite_node->res_id;
 	evt_info.res_type = camif_lite_node->res_type;
+	evt_info.hw_type  = CAM_ISP_HW_TYPE_VFE;
 
 	CAM_DBG(CAM_ISP,
 		"VFE:%d CAMIF LITE:%d %s IRQ status_0: 0x%X status_1: 0x%X status_2: 0x%X",

+ 1 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_ver3.c

@@ -1389,6 +1389,7 @@ static int cam_vfe_camif_ver3_handle_irq_bottom_half(void *handler_priv,
 	evt_info.res_id   = camif_node->res_id;
 	evt_info.res_type = camif_node->res_type;
 	evt_info.reg_val = 0;
+	evt_info.hw_type = CAM_ISP_HW_TYPE_VFE;
 
 	if (irq_status[CAM_IFE_IRQ_CAMIF_REG_STATUS1]
 		& camif_priv->reg_data->sof_irq_mask) {