|
@@ -997,8 +997,6 @@ static int cam_tfe_csid_path_reserve(struct cam_tfe_csid_hw *csid_hw,
|
|
path_data->bayer_bin = reserve->in_port->bayer_bin;
|
|
path_data->bayer_bin = reserve->in_port->bayer_bin;
|
|
path_data->qcfa_bin = reserve->in_port->qcfa_bin;
|
|
path_data->qcfa_bin = reserve->in_port->qcfa_bin;
|
|
path_data->crop_enable = reserve->crop_enable;
|
|
path_data->crop_enable = reserve->crop_enable;
|
|
- path_data->is_shdr_master = reserve->in_port->is_shdr_master;
|
|
|
|
- path_data->is_shdr = reserve->in_port->shdr_en;
|
|
|
|
|
|
|
|
csid_hw->event_cb = reserve->event_cb;
|
|
csid_hw->event_cb = reserve->event_cb;
|
|
csid_hw->event_cb_priv = reserve->event_cb_prv;
|
|
csid_hw->event_cb_priv = reserve->event_cb_prv;
|
|
@@ -1067,6 +1065,38 @@ end:
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void cam_tfe_csid_send_secure_info(
|
|
|
|
+ struct cam_tfe_csid_hw *csid_hw)
|
|
|
|
+{
|
|
|
|
+ struct cam_tfe_csid_secure_info secure_info;
|
|
|
|
+ const struct cam_tfe_csid_reg_offset *csid_reg;
|
|
|
|
+ int phy_sel = 0;
|
|
|
|
+
|
|
|
|
+ csid_reg = csid_hw->csid_info->csid_reg;
|
|
|
|
+
|
|
|
|
+ secure_info.lane_cfg = csid_hw->csi2_rx_cfg.lane_cfg;
|
|
|
|
+ secure_info.cdm_hw_idx_mask = 0;
|
|
|
|
+ secure_info.vc_mask = 0;
|
|
|
|
+ secure_info.csid_hw_idx_mask = BIT(csid_hw->hw_intf->hw_idx);
|
|
|
|
+
|
|
|
|
+ CAM_DBG(CAM_ISP,
|
|
|
|
+ "PHY secure info for CSID[%u], lane_cfg: 0x%x, tfe: 0x%x, cdm: 0x%x, vc_mask: 0x%llx",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, secure_info.lane_cfg, secure_info.csid_hw_idx_mask,
|
|
|
|
+ secure_info.cdm_hw_idx_mask, secure_info.vc_mask);
|
|
|
|
+
|
|
|
|
+ phy_sel = (int)(csid_hw->csi2_rx_cfg.phy_sel - csid_reg->csi2_reg->phy_sel_base);
|
|
|
|
+ if (phy_sel < 0) {
|
|
|
|
+ CAM_WARN(CAM_ISP, "Can't notify csiphy, incorrect phy selected=%d",
|
|
|
|
+ phy_sel);
|
|
|
|
+ } else {
|
|
|
|
+ secure_info.phy_sel = (uint32_t)phy_sel;
|
|
|
|
+ CAM_DBG(CAM_ISP, "Notify CSIPHY: %d", phy_sel);
|
|
|
|
+ cam_subdev_notify_message(CAM_CSIPHY_DEVICE_TYPE,
|
|
|
|
+ CAM_SUBDEV_MESSAGE_DOMAIN_ID_SECURE_PARAMS, (void *)&secure_info);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
static int cam_tfe_csid_enable_csi2(
|
|
static int cam_tfe_csid_enable_csi2(
|
|
struct cam_tfe_csid_hw *csid_hw)
|
|
struct cam_tfe_csid_hw *csid_hw)
|
|
{
|
|
{
|
|
@@ -1248,8 +1278,8 @@ static int cam_tfe_csid_enable_hw(struct cam_tfe_csid_hw *csid_hw)
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "CSID:%d init CSID HW",
|
|
|
|
- csid_hw->hw_intf->hw_idx);
|
|
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID:%d init CSID HW is_secure: %d",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, csid_hw->is_secure);
|
|
|
|
|
|
rc = cam_soc_util_get_clk_level(soc_info, csid_hw->clk_rate,
|
|
rc = cam_soc_util_get_clk_level(soc_info, csid_hw->clk_rate,
|
|
soc_info->src_clk_idx, &clk_lvl);
|
|
soc_info->src_clk_idx, &clk_lvl);
|
|
@@ -1331,6 +1361,9 @@ static int cam_tfe_csid_enable_hw(struct cam_tfe_csid_hw *csid_hw)
|
|
path_data->res_sof_cnt = 0;
|
|
path_data->res_sof_cnt = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (csid_hw->is_secure)
|
|
|
|
+ cam_tfe_csid_send_secure_info(csid_hw);
|
|
|
|
+
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
|
|
|
|
@@ -1669,31 +1702,33 @@ static int cam_tfe_csid_enable_pxl_path(
|
|
|
|
|
|
CAM_DBG(CAM_ISP, "Enable IPP path");
|
|
CAM_DBG(CAM_ISP, "Enable IPP path");
|
|
|
|
|
|
- if ((path_data->is_shdr && path_data->is_shdr_master) ||
|
|
|
|
- (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER))
|
|
|
|
- /* Set halt mode for master */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_MASTER << pxl_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_NONE << pxl_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY << pxl_reg->halt_cmd_shift);
|
|
|
|
- else if ((path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE) ||
|
|
|
|
- (path_data->is_shdr))
|
|
|
|
- /* Set halt mode for slave */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_SLAVE << pxl_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_EXTERNAL << pxl_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY << pxl_reg->halt_cmd_shift);
|
|
|
|
|
|
+ /* Set master or slave path */
|
|
|
|
+ if (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER)
|
|
|
|
+ /* Set halt mode as master */
|
|
|
|
+ val = (TFE_CSID_HALT_MODE_MASTER <<
|
|
|
|
+ pxl_reg->halt_mode_shift) |
|
|
|
|
+ (pxl_reg->halt_master_sel_master_val <<
|
|
|
|
+ pxl_reg->halt_master_sel_shift);
|
|
|
|
+ else if (path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE)
|
|
|
|
+ /* Set halt mode as slave and set master idx */
|
|
|
|
+ val = (TFE_CSID_HALT_MODE_SLAVE << pxl_reg->halt_mode_shift);
|
|
else
|
|
else
|
|
- /* Set halt mode for default */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_INTERNAL << pxl_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_NONE << pxl_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY << pxl_reg->halt_cmd_shift);
|
|
|
|
|
|
+ /* Default is internal halt mode */
|
|
|
|
+ val = 1 << pxl_reg->halt_master_sel_shift;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Resume at frame boundary if Master or No Sync.
|
|
|
|
+ * Slave will get resume command from Master.
|
|
|
|
+ */
|
|
|
|
+ if ((path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER ||
|
|
|
|
+ path_data->sync_mode == CAM_ISP_HW_SYNC_NONE) && !path_data->init_frame_drop)
|
|
|
|
+ val |= CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY;
|
|
|
|
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
pxl_reg->csid_pxl_ctrl_addr);
|
|
pxl_reg->csid_pxl_ctrl_addr);
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "CSID:%d sync_mode=%d IPP_Ctrl:0x%x is_shdr=%d shdr_master=%d",
|
|
|
|
- csid_hw->hw_intf->hw_idx, path_data->sync_mode,
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + pxl_reg->csid_pxl_ctrl_addr),
|
|
|
|
- path_data->is_shdr, path_data->is_shdr_master);
|
|
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID:%d IPP Ctrl val: 0x%x",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, val);
|
|
|
|
|
|
/* Enable the required pxl path interrupts */
|
|
/* Enable the required pxl path interrupts */
|
|
val = TFE_CSID_PATH_INFO_RST_DONE |
|
|
val = TFE_CSID_PATH_INFO_RST_DONE |
|
|
@@ -1769,8 +1804,7 @@ static int cam_tfe_csid_change_pxl_halt_mode(
|
|
static int cam_tfe_csid_disable_pxl_path(
|
|
static int cam_tfe_csid_disable_pxl_path(
|
|
struct cam_tfe_csid_hw *csid_hw,
|
|
struct cam_tfe_csid_hw *csid_hw,
|
|
struct cam_isp_resource_node *res,
|
|
struct cam_isp_resource_node *res,
|
|
- enum cam_tfe_csid_halt_cmd stop_cmd,
|
|
|
|
- bool csid_with_ppp_en)
|
|
|
|
|
|
+ enum cam_tfe_csid_halt_cmd stop_cmd)
|
|
{
|
|
{
|
|
int rc = 0;
|
|
int rc = 0;
|
|
uint32_t val = 0;
|
|
uint32_t val = 0;
|
|
@@ -1824,46 +1858,32 @@ static int cam_tfe_csid_disable_pxl_path(
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
pxl_reg->csid_pxl_irq_mask_addr);
|
|
pxl_reg->csid_pxl_irq_mask_addr);
|
|
|
|
|
|
- path_data->init_frame_drop = 0;
|
|
|
|
- path_data->res_sof_cnt = 0;
|
|
|
|
-
|
|
|
|
- if (((path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER) ||
|
|
|
|
- (path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE)) && !csid_with_ppp_en)
|
|
|
|
- /* Set halt mode for dual master/slave without pdaf */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_GLOBAL << pxl_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_EXTERNAL << pxl_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_HALT_IMMEDIATELY << pxl_reg->halt_cmd_shift);
|
|
|
|
- else if ((path_data->is_shdr && path_data->is_shdr_master) ||
|
|
|
|
- (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER))
|
|
|
|
- /* Set halt mode for shdr/dual master */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_MASTER << pxl_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_NONE << pxl_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_HALT_AT_FRAME_BOUNDARY << pxl_reg->halt_cmd_shift);
|
|
|
|
- else if ((path_data->is_shdr && !path_data->is_shdr_master) ||
|
|
|
|
- (path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE)) {
|
|
|
|
- /* Set halt mode for shdr/dual slave */
|
|
|
|
- CAM_DBG(CAM_ISP, "skip programming halt mode for slave in %s case",
|
|
|
|
- (path_data->is_shdr) ? "SHDR" : "Dual TFE");
|
|
|
|
- goto end;
|
|
|
|
- } else if (csid_with_ppp_en)
|
|
|
|
- /* Set halt mode for single tfe + pdaf */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_INTERNAL << pxl_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_NONE << pxl_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_HALT_AT_FRAME_BOUNDARY << pxl_reg->halt_cmd_shift);
|
|
|
|
- else
|
|
|
|
- /* Set halt mode for default */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_GLOBAL << pxl_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_EXTERNAL << pxl_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_HALT_AT_FRAME_BOUNDARY << pxl_reg->halt_cmd_shift);
|
|
|
|
-
|
|
|
|
- cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
|
|
|
|
+ if (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER ||
|
|
|
|
+ path_data->sync_mode == CAM_ISP_HW_SYNC_NONE) {
|
|
|
|
+ /* configure Halt */
|
|
|
|
+ val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
pxl_reg->csid_pxl_ctrl_addr);
|
|
pxl_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ val &= ~0x3;
|
|
|
|
+ val |= stop_cmd;
|
|
|
|
+ cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
|
|
+ pxl_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ }
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "halt CSID:%d sync_mode:%d res_id:%d IPP path pxl_ctrl=0x%x",
|
|
|
|
- csid_hw->hw_intf->hw_idx, path_data->sync_mode, res->res_id,
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + pxl_reg->csid_pxl_ctrl_addr));
|
|
|
|
|
|
+ if (path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE &&
|
|
|
|
+ stop_cmd == CAM_TFE_CSID_HALT_IMMEDIATELY) {
|
|
|
|
+ /* configure Halt for slave */
|
|
|
|
+ val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
|
|
+ pxl_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ val &= ~0xF;
|
|
|
|
+ val |= stop_cmd;
|
|
|
|
+ val |= (TFE_CSID_HALT_MODE_MASTER << 2);
|
|
|
|
+ cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
|
|
+ pxl_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ path_data->init_frame_drop = 0;
|
|
|
|
+ path_data->res_sof_cnt = 0;
|
|
|
|
|
|
-end:
|
|
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1898,29 +1918,34 @@ static int cam_tfe_csid_enable_ppp_path(
|
|
|
|
|
|
CAM_DBG(CAM_ISP, "CSID:%d Enable PPP path", csid_hw->hw_intf->hw_idx);
|
|
CAM_DBG(CAM_ISP, "CSID:%d Enable PPP path", csid_hw->hw_intf->hw_idx);
|
|
|
|
|
|
- if ((path_data->is_shdr && path_data->is_shdr_master) ||
|
|
|
|
- (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER))
|
|
|
|
- /* Set halt mode for master shdr/dual */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_INTERNAL1 << ppp_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY << ppp_reg->halt_cmd_shift);
|
|
|
|
- else if ((path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE) ||
|
|
|
|
- (path_data->is_shdr))
|
|
|
|
- /* Set halt mode for slave shdr/dual*/
|
|
|
|
- val = (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_INTERNAL2 << ppp_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY << ppp_reg->halt_cmd_shift);
|
|
|
|
|
|
+ /* Set master or slave path */
|
|
|
|
+ if (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER)
|
|
|
|
+ /* Set halt mode as master */
|
|
|
|
+ val = (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift) |
|
|
|
|
+ (ppp_reg->halt_master_sel_master_val <<
|
|
|
|
+ ppp_reg->halt_master_sel_shift);
|
|
|
|
+ else if (path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE)
|
|
|
|
+ /* Set halt mode as slave and set master idx */
|
|
|
|
+ val = (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift) |
|
|
|
|
+ (ppp_reg->halt_master_sel_slave_val <<
|
|
|
|
+ ppp_reg->halt_master_sel_shift);
|
|
else
|
|
else
|
|
- /* Set halt mode for default */
|
|
|
|
- val = (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift) |
|
|
|
|
- (TFE_CSID_HALT_CMD_SOURCE_INTERNAL1 << ppp_reg->halt_master_sel_shift) |
|
|
|
|
- (CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY << ppp_reg->halt_cmd_shift);
|
|
|
|
|
|
+ /* Default is internal halt mode */
|
|
|
|
+ val = (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift) |
|
|
|
|
+ (ppp_reg->halt_master_sel_master_val <<
|
|
|
|
+ ppp_reg->halt_master_sel_shift);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Resume at frame boundary if Master or No Sync.
|
|
|
|
+ * Slave will get resume command from Master.
|
|
|
|
+ */
|
|
|
|
+ if ((path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER ||
|
|
|
|
+ path_data->sync_mode == CAM_ISP_HW_SYNC_NONE) && !path_data->init_frame_drop)
|
|
|
|
+ val |= CAM_TFE_CSID_RESUME_AT_FRAME_BOUNDARY;
|
|
|
|
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base + ppp_reg->csid_pxl_ctrl_addr);
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base + ppp_reg->csid_pxl_ctrl_addr);
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "CSID:%d sync_mode:%d PPP Ctrl val: 0x%x",
|
|
|
|
- csid_hw->hw_intf->hw_idx, path_data->sync_mode,
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + ppp_reg->csid_pxl_ctrl_addr));
|
|
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID:%d PPP Ctrl val: 0x%x", csid_hw->hw_intf->hw_idx, val);
|
|
|
|
|
|
/* Enable the required ppp path interrupts */
|
|
/* Enable the required ppp path interrupts */
|
|
val = TFE_CSID_PATH_INFO_RST_DONE | TFE_CSID_PATH_ERROR_FIFO_OVERFLOW |
|
|
val = TFE_CSID_PATH_INFO_RST_DONE | TFE_CSID_PATH_ERROR_FIFO_OVERFLOW |
|
|
@@ -1949,6 +1974,7 @@ static int cam_tfe_csid_disable_ppp_path(
|
|
enum cam_tfe_csid_halt_cmd stop_cmd)
|
|
enum cam_tfe_csid_halt_cmd stop_cmd)
|
|
{
|
|
{
|
|
int rc = 0;
|
|
int rc = 0;
|
|
|
|
+ uint32_t val = 0;
|
|
const struct cam_tfe_csid_reg_offset *csid_reg;
|
|
const struct cam_tfe_csid_reg_offset *csid_reg;
|
|
struct cam_hw_soc_info *soc_info;
|
|
struct cam_hw_soc_info *soc_info;
|
|
struct cam_tfe_csid_path_cfg *path_data;
|
|
struct cam_tfe_csid_path_cfg *path_data;
|
|
@@ -1998,12 +2024,33 @@ static int cam_tfe_csid_disable_ppp_path(
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
ppp_reg->csid_pxl_irq_mask_addr);
|
|
ppp_reg->csid_pxl_irq_mask_addr);
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "CSID:%d res_id:%d Skip prgramming halt mode for PPP path",
|
|
|
|
- csid_hw->hw_intf->hw_idx, res->res_id);
|
|
|
|
|
|
+ if (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER ||
|
|
|
|
+ path_data->sync_mode == CAM_ISP_HW_SYNC_NONE) {
|
|
|
|
+ /* configure Halt */
|
|
|
|
+ val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
|
|
+ ppp_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ val &= ~0x3F;
|
|
|
|
+ val |= (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift);
|
|
|
|
+ val |= (ppp_reg->halt_master_sel_master_val <<
|
|
|
|
+ ppp_reg->halt_master_sel_shift);
|
|
|
|
+ val |= stop_cmd;
|
|
|
|
+ cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
|
|
+ ppp_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ }
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "CSID:%d sync_mode:%d res_id:%d PPP path halt_ctrl_reg=0x%x",
|
|
|
|
- csid_hw->hw_intf->hw_idx, path_data->sync_mode, res->res_id,
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + ppp_reg->csid_pxl_ctrl_addr));
|
|
|
|
|
|
+ if (path_data->sync_mode == CAM_ISP_HW_SYNC_SLAVE &&
|
|
|
|
+ stop_cmd == CAM_TFE_CSID_HALT_IMMEDIATELY) {
|
|
|
|
+ /* configure Halt for slave */
|
|
|
|
+ val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
|
|
+ ppp_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ val &= ~0x3F;
|
|
|
|
+ val |= (TFE_CSID_HALT_MODE_SLAVE << ppp_reg->halt_mode_shift);
|
|
|
|
+ val |= (ppp_reg->halt_master_sel_slave_val <<
|
|
|
|
+ ppp_reg->halt_master_sel_shift);
|
|
|
|
+ val |= stop_cmd;
|
|
|
|
+ cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
|
|
+ ppp_reg->csid_pxl_ctrl_addr);
|
|
|
|
+ }
|
|
|
|
|
|
path_data->init_frame_drop = 0;
|
|
path_data->init_frame_drop = 0;
|
|
path_data->res_sof_cnt = 0;
|
|
path_data->res_sof_cnt = 0;
|
|
@@ -2307,9 +2354,6 @@ static int cam_tfe_csid_poll_stop_status(
|
|
uint32_t csid_status_addr = 0, val = 0, res_id = 0;
|
|
uint32_t csid_status_addr = 0, val = 0, res_id = 0;
|
|
const struct cam_tfe_csid_reg_offset *csid_reg;
|
|
const struct cam_tfe_csid_reg_offset *csid_reg;
|
|
struct cam_hw_soc_info *soc_info;
|
|
struct cam_hw_soc_info *soc_info;
|
|
- uint32_t csid_ctrl_reg = 0;
|
|
|
|
- uint32_t csid_cfg0_reg = 0;
|
|
|
|
- uint32_t csid_cfg1_reg = 0;
|
|
|
|
|
|
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
soc_info = &csid_hw->hw_info->soc_info;
|
|
soc_info = &csid_hw->hw_info->soc_info;
|
|
@@ -2323,10 +2367,6 @@ static int cam_tfe_csid_poll_stop_status(
|
|
csid_status_addr =
|
|
csid_status_addr =
|
|
csid_reg->ipp_reg->csid_pxl_status_addr;
|
|
csid_reg->ipp_reg->csid_pxl_status_addr;
|
|
|
|
|
|
- csid_ctrl_reg = csid_reg->ipp_reg->csid_pxl_ctrl_addr;
|
|
|
|
- csid_cfg0_reg = csid_reg->ipp_reg->csid_pxl_cfg0_addr;
|
|
|
|
- csid_cfg1_reg = csid_reg->ipp_reg->csid_pxl_cfg1_addr;
|
|
|
|
-
|
|
|
|
if (csid_hw->ipp_res.res_state !=
|
|
if (csid_hw->ipp_res.res_state !=
|
|
CAM_ISP_RESOURCE_STATE_STREAMING)
|
|
CAM_ISP_RESOURCE_STATE_STREAMING)
|
|
continue;
|
|
continue;
|
|
@@ -2334,9 +2374,6 @@ static int cam_tfe_csid_poll_stop_status(
|
|
} else if (res_id == CAM_TFE_CSID_PATH_RES_PPP) {
|
|
} else if (res_id == CAM_TFE_CSID_PATH_RES_PPP) {
|
|
csid_status_addr =
|
|
csid_status_addr =
|
|
csid_reg->ppp_reg->csid_pxl_status_addr;
|
|
csid_reg->ppp_reg->csid_pxl_status_addr;
|
|
- csid_ctrl_reg = csid_reg->ppp_reg->csid_pxl_ctrl_addr;
|
|
|
|
- csid_cfg0_reg = csid_reg->ppp_reg->csid_pxl_cfg0_addr;
|
|
|
|
- csid_cfg1_reg = csid_reg->ppp_reg->csid_pxl_cfg1_addr;
|
|
|
|
|
|
|
|
if (csid_hw->ppp_res.res_state !=
|
|
if (csid_hw->ppp_res.res_state !=
|
|
CAM_ISP_RESOURCE_STATE_STREAMING)
|
|
CAM_ISP_RESOURCE_STATE_STREAMING)
|
|
@@ -2345,9 +2382,6 @@ static int cam_tfe_csid_poll_stop_status(
|
|
} else {
|
|
} else {
|
|
csid_status_addr =
|
|
csid_status_addr =
|
|
csid_reg->rdi_reg[res_id]->csid_rdi_status_addr;
|
|
csid_reg->rdi_reg[res_id]->csid_rdi_status_addr;
|
|
- csid_ctrl_reg = csid_reg->rdi_reg[res_id]->csid_rdi_ctrl_addr;
|
|
|
|
- csid_cfg0_reg = csid_reg->rdi_reg[res_id]->csid_rdi_cfg0_addr;
|
|
|
|
- csid_cfg1_reg = csid_reg->rdi_reg[res_id]->csid_rdi_cfg1_addr;
|
|
|
|
|
|
|
|
if (csid_hw->rdi_res[res_id].res_state !=
|
|
if (csid_hw->rdi_res[res_id].res_state !=
|
|
CAM_ISP_RESOURCE_STATE_STREAMING)
|
|
CAM_ISP_RESOURCE_STATE_STREAMING)
|
|
@@ -2368,13 +2402,6 @@ static int cam_tfe_csid_poll_stop_status(
|
|
if (rc < 0) {
|
|
if (rc < 0) {
|
|
CAM_ERR(CAM_ISP, "CSID:%d res:%d halt failed rc %d",
|
|
CAM_ERR(CAM_ISP, "CSID:%d res:%d halt failed rc %d",
|
|
csid_hw->hw_intf->hw_idx, res_id, rc);
|
|
csid_hw->hw_intf->hw_idx, res_id, rc);
|
|
-
|
|
|
|
- CAM_ERR(CAM_ISP, "CSID:%d status:0x%x ctrl_reg:0x%x cfg0:0x%x cfg1:0x%x",
|
|
|
|
- csid_hw->hw_intf->hw_idx,
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_status_addr),
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_ctrl_reg),
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_cfg0_reg),
|
|
|
|
- cam_io_r_mb(soc_info->reg_map[0].mem_base + csid_cfg1_reg));
|
|
|
|
rc = -ETIMEDOUT;
|
|
rc = -ETIMEDOUT;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -2699,8 +2726,10 @@ static int cam_tfe_csid_reserve(void *hw_priv,
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "res_type %d, CSID: %u",
|
|
|
|
- reserv->res_type, csid_hw->hw_intf->hw_idx);
|
|
|
|
|
|
+ csid_hw->is_secure = reserv->out_port->secure_mode;
|
|
|
|
+
|
|
|
|
+ CAM_DBG(CAM_ISP, "res_type %d, CSID: %u is_secure: %d",
|
|
|
|
+ reserv->res_type, csid_hw->hw_intf->hw_idx, csid_hw->is_secure);
|
|
|
|
|
|
mutex_lock(&csid_hw->hw_info->hw_mutex);
|
|
mutex_lock(&csid_hw->hw_info->hw_mutex);
|
|
rc = cam_tfe_csid_path_reserve(csid_hw, reserv);
|
|
rc = cam_tfe_csid_path_reserve(csid_hw, reserv);
|
|
@@ -2746,6 +2775,7 @@ static int cam_tfe_csid_release(void *hw_priv,
|
|
|
|
|
|
csid_hw->event_cb = NULL;
|
|
csid_hw->event_cb = NULL;
|
|
csid_hw->event_cb_priv = NULL;
|
|
csid_hw->event_cb_priv = NULL;
|
|
|
|
+ csid_hw->is_secure = false;
|
|
|
|
|
|
if ((res->res_state <= CAM_ISP_RESOURCE_STATE_AVAILABLE) ||
|
|
if ((res->res_state <= CAM_ISP_RESOURCE_STATE_AVAILABLE) ||
|
|
(res->res_state >= CAM_ISP_RESOURCE_STATE_STREAMING)) {
|
|
(res->res_state >= CAM_ISP_RESOURCE_STATE_STREAMING)) {
|
|
@@ -3065,7 +3095,6 @@ static int cam_tfe_csid_stop(void *hw_priv,
|
|
struct cam_tfe_csid_hw_stop_args *csid_stop;
|
|
struct cam_tfe_csid_hw_stop_args *csid_stop;
|
|
uint32_t i;
|
|
uint32_t i;
|
|
uint32_t res_mask = 0;
|
|
uint32_t res_mask = 0;
|
|
- bool csid_with_ppp_en = false;
|
|
|
|
|
|
|
|
if (!hw_priv || !stop_args ||
|
|
if (!hw_priv || !stop_args ||
|
|
(arg_size != sizeof(struct cam_tfe_csid_hw_stop_args))) {
|
|
(arg_size != sizeof(struct cam_tfe_csid_hw_stop_args))) {
|
|
@@ -3081,13 +3110,9 @@ static int cam_tfe_csid_stop(void *hw_priv,
|
|
|
|
|
|
csid_hw_info = (struct cam_hw_info *)hw_priv;
|
|
csid_hw_info = (struct cam_hw_info *)hw_priv;
|
|
csid_hw = (struct cam_tfe_csid_hw *)csid_hw_info->core_info;
|
|
csid_hw = (struct cam_tfe_csid_hw *)csid_hw_info->core_info;
|
|
-
|
|
|
|
- if (csid_hw->ppp_res.res_state == CAM_ISP_RESOURCE_STATE_STREAMING)
|
|
|
|
- csid_with_ppp_en = true;
|
|
|
|
-
|
|
|
|
- CAM_DBG(CAM_ISP, "CSID:%d num_res %d csid_with_ppp_en:%d",
|
|
|
|
- csid_hw->hw_intf->hw_idx, csid_stop->num_res,
|
|
|
|
- csid_with_ppp_en);
|
|
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID:%d num_res %d",
|
|
|
|
+ csid_hw->hw_intf->hw_idx,
|
|
|
|
+ csid_stop->num_res);
|
|
|
|
|
|
/* Stop the resource first */
|
|
/* Stop the resource first */
|
|
for (i = 0; i < csid_stop->num_res; i++) {
|
|
for (i = 0; i < csid_stop->num_res; i++) {
|
|
@@ -3100,7 +3125,7 @@ static int cam_tfe_csid_stop(void *hw_priv,
|
|
res_mask |= (1 << res->res_id);
|
|
res_mask |= (1 << res->res_id);
|
|
if (res->res_id == CAM_TFE_CSID_PATH_RES_IPP)
|
|
if (res->res_id == CAM_TFE_CSID_PATH_RES_IPP)
|
|
rc = cam_tfe_csid_disable_pxl_path(csid_hw,
|
|
rc = cam_tfe_csid_disable_pxl_path(csid_hw,
|
|
- res, csid_stop->stop_cmd, csid_with_ppp_en);
|
|
|
|
|
|
+ res, csid_stop->stop_cmd);
|
|
else if (res->res_id == CAM_TFE_CSID_PATH_RES_PPP)
|
|
else if (res->res_id == CAM_TFE_CSID_PATH_RES_PPP)
|
|
rc = cam_tfe_csid_disable_ppp_path(csid_hw,
|
|
rc = cam_tfe_csid_disable_ppp_path(csid_hw,
|
|
res, csid_stop->stop_cmd);
|
|
res, csid_stop->stop_cmd);
|