Loading drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c +9 −3 Original line number Diff line number Diff line Loading @@ -418,8 +418,13 @@ int cam_vfe_reset(void *hw_priv, void *reset_core_args, uint32_t arg_size) switch (vfe_hw->soc_info.hw_version) { case CAM_CPAS_TITAN_480_V100: if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) == NULL) top_reset_irq_reg_mask[CAM_IFE_IRQ_CAMIF_REG_STATUS0] = 0x00000001; else top_reset_irq_reg_mask[CAM_IFE_IRQ_CAMIF_REG_STATUS0] = 0x00020000; break; default: top_reset_irq_reg_mask[CAM_IFE_IRQ_CAMIF_REG_STATUS0] Loading Loading @@ -880,7 +885,8 @@ int cam_vfe_core_init(struct cam_vfe_hw_core_info *core_info, } /* Read Bus is not valid for vfe-lite */ if ((hw_intf->hw_idx == 0) || (hw_intf->hw_idx == 1)) { if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) == NULL) { rc = cam_vfe_bus_init(vfe_hw_info->bus_rd_version, BUS_TYPE_RD, soc_info, hw_intf, vfe_hw_info->bus_rd_hw_info, core_info->vfe_irq_controller, &core_info->vfe_rd_bus); Loading drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_soc.c +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ int cam_vfe_init_soc_resources(struct cam_hw_soc_info *soc_info, CAM_ERR(CAM_ISP, "Error! Invalid cpas version rc=%d", rc); goto free_soc_private; } soc_info->hw_version = soc_private->cpas_version; switch (soc_private->cpas_version) { case CAM_CPAS_TITAN_175_V120: Loading drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c +28 −15 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ struct cam_vfe_bus_ver3_common_data { uint32_t secure_mode; uint32_t num_sec_out; uint32_t addr_no_sync; bool is_lite; }; struct cam_vfe_bus_ver3_wm_resource_data { Loading Loading @@ -538,7 +539,7 @@ static int cam_vfe_bus_ver3_get_num_wm( static int cam_vfe_bus_ver3_get_wm_idx( enum cam_vfe_bus_ver3_vfe_out_type vfe_out_res_id, enum cam_vfe_bus_plane_type plane, uint32_t hw_idx) bool is_lite) { int wm_idx = -1; Loading @@ -546,7 +547,7 @@ static int cam_vfe_bus_ver3_get_wm_idx( case CAM_VFE_BUS_VER3_VFE_OUT_RDI0: switch (plane) { case PLANE_Y: if (hw_idx < 2) if (is_lite) wm_idx = 23; else wm_idx = 0; Loading @@ -558,7 +559,7 @@ static int cam_vfe_bus_ver3_get_wm_idx( case CAM_VFE_BUS_VER3_VFE_OUT_RDI1: switch (plane) { case PLANE_Y: if (hw_idx < 2) if (is_lite) wm_idx = 24; else wm_idx = 1; Loading @@ -570,7 +571,7 @@ static int cam_vfe_bus_ver3_get_wm_idx( case CAM_VFE_BUS_VER3_VFE_OUT_RDI2: switch (plane) { case PLANE_Y: if (hw_idx < 2) if (is_lite) wm_idx = 25; else wm_idx = 2; Loading Loading @@ -909,8 +910,7 @@ static int cam_vfe_bus_ver3_acquire_wm( enum cam_vfe_bus_plane_type plane, struct cam_isp_resource_node **wm_res, uint32_t is_dual, enum cam_vfe_bus_ver3_comp_grp_type *comp_grp_id, uint32_t hw_idx) enum cam_vfe_bus_ver3_comp_grp_type *comp_grp_id) { uint32_t wm_idx = 0; struct cam_isp_resource_node *wm_res_local = NULL; Loading @@ -919,7 +919,8 @@ static int cam_vfe_bus_ver3_acquire_wm( *wm_res = NULL; /* No need to allocate for BUS VER2. VFE OUT to WM is fixed. */ wm_idx = cam_vfe_bus_ver3_get_wm_idx(vfe_out_res_id, plane, hw_idx); wm_idx = cam_vfe_bus_ver3_get_wm_idx(vfe_out_res_id, plane, ver3_bus_priv->common_data.is_lite); if (wm_idx < 0 || wm_idx >= ver3_bus_priv->num_client) { CAM_ERR(CAM_ISP, "Unsupported VFE out %d plane %d", vfe_out_res_id, plane); Loading Loading @@ -949,7 +950,7 @@ static int cam_vfe_bus_ver3_acquire_wm( CAM_DBG(CAM_ISP, "WM:%d width %d height %d", rsrc_data->index, rsrc_data->width, rsrc_data->height); if (hw_idx > 1) if (ver3_bus_priv->common_data.is_lite) goto rdi_config; if (rsrc_data->index > 22) { Loading Loading @@ -1210,12 +1211,12 @@ static int cam_vfe_bus_ver3_start_wm(struct cam_isp_resource_node *wm_res) common_data->mem_base + rsrc_data->hw_regs->packer_cfg); /* Configure stride for RDIs on full IFE */ if (wm_res->hw_intf->hw_idx < 2 && rsrc_data->index > 22) if (!common_data->is_lite && rsrc_data->index > 22) cam_io_w_mb(rsrc_data->stride, (common_data->mem_base + rsrc_data->hw_regs->image_cfg_2)); /* Configure stride for RDIs on IFE lite */ if (wm_res->hw_intf->hw_idx >= 2) if (common_data->is_lite) cam_io_w_mb(rsrc_data->stride, (common_data->mem_base + rsrc_data->hw_regs->image_cfg_2)); Loading Loading @@ -1846,8 +1847,7 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, i, &rsrc_data->wm_res[i], out_acquire_args->is_dual, &comp_grp_id, rsrc_node->hw_intf->hw_idx); &comp_grp_id); if (rc) { CAM_ERR(CAM_ISP, "VFE%d WM acquire failed for Out %d rc=%d", Loading Loading @@ -2556,7 +2556,9 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, io_cfg->planes[i].plane_stride, val); if ((wm_data->stride != val || !wm_data->init_cfg_done) && (wm_data->index < 23)) { !wm_data->init_cfg_done) && ((!bus_priv->common_data.is_lite && wm_data->index < 23) || bus_priv->common_data.is_lite)) { CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->image_cfg_2, io_cfg->planes[i].plane_stride); Loading Loading @@ -2602,11 +2604,14 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, io_cfg->planes[i].slice_height; } if (wm_data->index < 3) if ((!bus_priv->common_data.is_lite && wm_data->index > 22) || bus_priv->common_data.is_lite) loop_size = wm_data->irq_subsample_period + 1; else loop_size = 1; /* WM Image address */ for (k = 0; k < loop_size; k++) { if (wm_data->en_ubwc) Loading Loading @@ -2694,7 +2699,9 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, wm_data = vfe_out_data->wm_res[i]->res_priv; if (wm_data->index > 22 && hfr_cfg->subsample_period > 3) { if (((!bus_priv->common_data.is_lite && wm_data->index > 22) || bus_priv->common_data.is_lite) && hfr_cfg->subsample_period > 3) { CAM_ERR(CAM_ISP, "RDI doesn't support irq subsample period %d", hfr_cfg->subsample_period); Loading Loading @@ -3054,6 +3061,12 @@ int cam_vfe_bus_ver3_init( bus_priv->common_data.vfe_irq_controller = vfe_irq_controller; bus_priv->common_data.common_reg = &ver3_hw_info->common_reg; if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) != NULL) bus_priv->common_data.is_lite = true; else bus_priv->common_data.is_lite = false; mutex_init(&bus_priv->common_data.bus_mutex); rc = cam_irq_controller_init(drv_name, bus_priv->common_data.mem_base, Loading drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver3.c +9 −2 Original line number Diff line number Diff line Loading @@ -452,8 +452,15 @@ int cam_vfe_top_ver3_reset(void *device_priv, reg_common = top_priv->common_data.common_reg; /* Mask All the IRQs except RESET */ cam_io_w_mb((1 << 31), CAM_SOC_GET_REG_MAP_START(soc_info, VFE_CORE_BASE_IDX) + 0x5C); if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) == NULL) cam_io_w_mb(0x00000001, CAM_SOC_GET_REG_MAP_START(soc_info, VFE_CORE_BASE_IDX) + 0x3C); else cam_io_w_mb(0x00020000, CAM_SOC_GET_REG_MAP_START(soc_info, VFE_CORE_BASE_IDX) + 0x28); /* Reset HW */ cam_io_w_mb(reset_reg_val, Loading drivers/media/platform/msm/camera/cam_utils/cam_soc_util.c +9 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. */ #include <linux/of.h> Loading Loading @@ -1210,6 +1210,14 @@ int cam_soc_util_get_dt_properties(struct cam_hw_soc_info *soc_info) } } rc = of_property_read_string_index(of_node, "compatible", 0, (const char **)&soc_info->compatible); if (rc) { CAM_DBG(CAM_UTIL, "No compatible string present for: %s", soc_info->dev_name); rc = 0; } rc = cam_soc_util_get_dt_regulator_info(soc_info); if (rc) return rc; Loading Loading
drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c +9 −3 Original line number Diff line number Diff line Loading @@ -418,8 +418,13 @@ int cam_vfe_reset(void *hw_priv, void *reset_core_args, uint32_t arg_size) switch (vfe_hw->soc_info.hw_version) { case CAM_CPAS_TITAN_480_V100: if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) == NULL) top_reset_irq_reg_mask[CAM_IFE_IRQ_CAMIF_REG_STATUS0] = 0x00000001; else top_reset_irq_reg_mask[CAM_IFE_IRQ_CAMIF_REG_STATUS0] = 0x00020000; break; default: top_reset_irq_reg_mask[CAM_IFE_IRQ_CAMIF_REG_STATUS0] Loading Loading @@ -880,7 +885,8 @@ int cam_vfe_core_init(struct cam_vfe_hw_core_info *core_info, } /* Read Bus is not valid for vfe-lite */ if ((hw_intf->hw_idx == 0) || (hw_intf->hw_idx == 1)) { if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) == NULL) { rc = cam_vfe_bus_init(vfe_hw_info->bus_rd_version, BUS_TYPE_RD, soc_info, hw_intf, vfe_hw_info->bus_rd_hw_info, core_info->vfe_irq_controller, &core_info->vfe_rd_bus); Loading
drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_soc.c +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ int cam_vfe_init_soc_resources(struct cam_hw_soc_info *soc_info, CAM_ERR(CAM_ISP, "Error! Invalid cpas version rc=%d", rc); goto free_soc_private; } soc_info->hw_version = soc_private->cpas_version; switch (soc_private->cpas_version) { case CAM_CPAS_TITAN_175_V120: Loading
drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c +28 −15 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ struct cam_vfe_bus_ver3_common_data { uint32_t secure_mode; uint32_t num_sec_out; uint32_t addr_no_sync; bool is_lite; }; struct cam_vfe_bus_ver3_wm_resource_data { Loading Loading @@ -538,7 +539,7 @@ static int cam_vfe_bus_ver3_get_num_wm( static int cam_vfe_bus_ver3_get_wm_idx( enum cam_vfe_bus_ver3_vfe_out_type vfe_out_res_id, enum cam_vfe_bus_plane_type plane, uint32_t hw_idx) bool is_lite) { int wm_idx = -1; Loading @@ -546,7 +547,7 @@ static int cam_vfe_bus_ver3_get_wm_idx( case CAM_VFE_BUS_VER3_VFE_OUT_RDI0: switch (plane) { case PLANE_Y: if (hw_idx < 2) if (is_lite) wm_idx = 23; else wm_idx = 0; Loading @@ -558,7 +559,7 @@ static int cam_vfe_bus_ver3_get_wm_idx( case CAM_VFE_BUS_VER3_VFE_OUT_RDI1: switch (plane) { case PLANE_Y: if (hw_idx < 2) if (is_lite) wm_idx = 24; else wm_idx = 1; Loading @@ -570,7 +571,7 @@ static int cam_vfe_bus_ver3_get_wm_idx( case CAM_VFE_BUS_VER3_VFE_OUT_RDI2: switch (plane) { case PLANE_Y: if (hw_idx < 2) if (is_lite) wm_idx = 25; else wm_idx = 2; Loading Loading @@ -909,8 +910,7 @@ static int cam_vfe_bus_ver3_acquire_wm( enum cam_vfe_bus_plane_type plane, struct cam_isp_resource_node **wm_res, uint32_t is_dual, enum cam_vfe_bus_ver3_comp_grp_type *comp_grp_id, uint32_t hw_idx) enum cam_vfe_bus_ver3_comp_grp_type *comp_grp_id) { uint32_t wm_idx = 0; struct cam_isp_resource_node *wm_res_local = NULL; Loading @@ -919,7 +919,8 @@ static int cam_vfe_bus_ver3_acquire_wm( *wm_res = NULL; /* No need to allocate for BUS VER2. VFE OUT to WM is fixed. */ wm_idx = cam_vfe_bus_ver3_get_wm_idx(vfe_out_res_id, plane, hw_idx); wm_idx = cam_vfe_bus_ver3_get_wm_idx(vfe_out_res_id, plane, ver3_bus_priv->common_data.is_lite); if (wm_idx < 0 || wm_idx >= ver3_bus_priv->num_client) { CAM_ERR(CAM_ISP, "Unsupported VFE out %d plane %d", vfe_out_res_id, plane); Loading Loading @@ -949,7 +950,7 @@ static int cam_vfe_bus_ver3_acquire_wm( CAM_DBG(CAM_ISP, "WM:%d width %d height %d", rsrc_data->index, rsrc_data->width, rsrc_data->height); if (hw_idx > 1) if (ver3_bus_priv->common_data.is_lite) goto rdi_config; if (rsrc_data->index > 22) { Loading Loading @@ -1210,12 +1211,12 @@ static int cam_vfe_bus_ver3_start_wm(struct cam_isp_resource_node *wm_res) common_data->mem_base + rsrc_data->hw_regs->packer_cfg); /* Configure stride for RDIs on full IFE */ if (wm_res->hw_intf->hw_idx < 2 && rsrc_data->index > 22) if (!common_data->is_lite && rsrc_data->index > 22) cam_io_w_mb(rsrc_data->stride, (common_data->mem_base + rsrc_data->hw_regs->image_cfg_2)); /* Configure stride for RDIs on IFE lite */ if (wm_res->hw_intf->hw_idx >= 2) if (common_data->is_lite) cam_io_w_mb(rsrc_data->stride, (common_data->mem_base + rsrc_data->hw_regs->image_cfg_2)); Loading Loading @@ -1846,8 +1847,7 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, i, &rsrc_data->wm_res[i], out_acquire_args->is_dual, &comp_grp_id, rsrc_node->hw_intf->hw_idx); &comp_grp_id); if (rc) { CAM_ERR(CAM_ISP, "VFE%d WM acquire failed for Out %d rc=%d", Loading Loading @@ -2556,7 +2556,9 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, io_cfg->planes[i].plane_stride, val); if ((wm_data->stride != val || !wm_data->init_cfg_done) && (wm_data->index < 23)) { !wm_data->init_cfg_done) && ((!bus_priv->common_data.is_lite && wm_data->index < 23) || bus_priv->common_data.is_lite)) { CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->image_cfg_2, io_cfg->planes[i].plane_stride); Loading Loading @@ -2602,11 +2604,14 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, io_cfg->planes[i].slice_height; } if (wm_data->index < 3) if ((!bus_priv->common_data.is_lite && wm_data->index > 22) || bus_priv->common_data.is_lite) loop_size = wm_data->irq_subsample_period + 1; else loop_size = 1; /* WM Image address */ for (k = 0; k < loop_size; k++) { if (wm_data->en_ubwc) Loading Loading @@ -2694,7 +2699,9 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, wm_data = vfe_out_data->wm_res[i]->res_priv; if (wm_data->index > 22 && hfr_cfg->subsample_period > 3) { if (((!bus_priv->common_data.is_lite && wm_data->index > 22) || bus_priv->common_data.is_lite) && hfr_cfg->subsample_period > 3) { CAM_ERR(CAM_ISP, "RDI doesn't support irq subsample period %d", hfr_cfg->subsample_period); Loading Loading @@ -3054,6 +3061,12 @@ int cam_vfe_bus_ver3_init( bus_priv->common_data.vfe_irq_controller = vfe_irq_controller; bus_priv->common_data.common_reg = &ver3_hw_info->common_reg; if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) != NULL) bus_priv->common_data.is_lite = true; else bus_priv->common_data.is_lite = false; mutex_init(&bus_priv->common_data.bus_mutex); rc = cam_irq_controller_init(drv_name, bus_priv->common_data.mem_base, Loading
drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver3.c +9 −2 Original line number Diff line number Diff line Loading @@ -452,8 +452,15 @@ int cam_vfe_top_ver3_reset(void *device_priv, reg_common = top_priv->common_data.common_reg; /* Mask All the IRQs except RESET */ cam_io_w_mb((1 << 31), CAM_SOC_GET_REG_MAP_START(soc_info, VFE_CORE_BASE_IDX) + 0x5C); if (strnstr(soc_info->compatible, "lite", strlen(soc_info->compatible)) == NULL) cam_io_w_mb(0x00000001, CAM_SOC_GET_REG_MAP_START(soc_info, VFE_CORE_BASE_IDX) + 0x3C); else cam_io_w_mb(0x00020000, CAM_SOC_GET_REG_MAP_START(soc_info, VFE_CORE_BASE_IDX) + 0x28); /* Reset HW */ cam_io_w_mb(reset_reg_val, Loading
drivers/media/platform/msm/camera/cam_utils/cam_soc_util.c +9 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. */ #include <linux/of.h> Loading Loading @@ -1210,6 +1210,14 @@ int cam_soc_util_get_dt_properties(struct cam_hw_soc_info *soc_info) } } rc = of_property_read_string_index(of_node, "compatible", 0, (const char **)&soc_info->compatible); if (rc) { CAM_DBG(CAM_UTIL, "No compatible string present for: %s", soc_info->dev_name); rc = 0; } rc = cam_soc_util_get_dt_regulator_info(soc_info); if (rc) return rc; Loading