Revert "msm: camera: csiphy: Integrate mink call for secure camera"
External dependency has been reverted, change not ready. This reverts commit b76d66be06cb035886ddebbf7671e02c93fdd1af. CRs-Fixed: 3317248 Change-Id: If82504f1eb22b1c908d08d256f3b4c4cbad60bc9 Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
This commit is contained in:

committed by
Vepuri Vinay Kumar

parent
d65382f14f
commit
aabbfaffeb
@@ -482,13 +482,6 @@ static int cam_csiphy_update_secure_info(struct csiphy_device *csiphy_dev, int32
|
||||
uint32_t cpas_version;
|
||||
int rc;
|
||||
|
||||
if (csiphy_dev->domain_id_security) {
|
||||
CAM_DBG(CAM_CSIPHY, "Domain ID scheme for CSIPHY [%u], skipping legacy update",
|
||||
csiphy_dev->soc_info.index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
lane_assign = csiphy_dev->csiphy_info[index].lane_assign;
|
||||
lane_cnt = csiphy_dev->csiphy_info[index].lane_cnt;
|
||||
|
||||
@@ -1233,26 +1226,22 @@ static int cam_csiphy_program_secure_mode(struct csiphy_device *csiphy_dev,
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (csiphy_dev->domain_id_security && protect) {
|
||||
if (!csiphy_dev->csiphy_info[offset].secure_info_updated) {
|
||||
CAM_ERR(CAM_CSIPHY,
|
||||
"PHY[%u] domain id info not updated, aborting secure call",
|
||||
csiphy_dev->soc_info.index);
|
||||
if (!csiphy_dev->domain_id_security)
|
||||
rc = cam_csiphy_notify_secure_mode(csiphy_dev, protect, offset);
|
||||
|
||||
/* Else a new scm call here */
|
||||
else {
|
||||
if (protect && !csiphy_dev->csiphy_info[offset].secure_info_updated) {
|
||||
CAM_ERR(CAM_CSIPHY, "Secure info not updated prior to stream on");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = cam_cpas_enable_clks_for_domain_id(true);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
csiphy_dev->csiphy_info[offset].secure_info.protect = protect;
|
||||
CAM_DBG(CAM_CSIPHY, "To call new scm, protect: %d, offset: %d",
|
||||
protect, offset);
|
||||
|
||||
rc = cam_csiphy_notify_secure_mode(csiphy_dev, protect, offset);
|
||||
|
||||
if (csiphy_dev->domain_id_security && !protect) {
|
||||
cam_cpas_enable_clks_for_domain_id(false);
|
||||
|
||||
csiphy_dev->csiphy_info[offset].secure_info_updated = false;
|
||||
if (!protect)
|
||||
csiphy_dev->csiphy_info[offset].secure_info_updated = false;
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
@@ -28,13 +28,27 @@ static inline void cam_csiphy_trigger_reg_dump(struct csiphy_device *csiphy_dev)
|
||||
}
|
||||
}
|
||||
|
||||
static int cam_csiphy_format_secure_phy_lane_info(
|
||||
struct csiphy_device *csiphy_dev, int offset, uint64_t *mask)
|
||||
int cam_csiphy_format_secure_phy_lane_info(
|
||||
struct csiphy_device *csiphy_dev, int offset)
|
||||
{
|
||||
struct cam_csiphy_tz_secure_info *tz_secure_info;
|
||||
struct cam_csiphy_param *param;
|
||||
uint64_t phy_lane_sel_mask = 0;
|
||||
|
||||
if (!csiphy_dev) {
|
||||
CAM_ERR(CAM_CSIPHY, "Invalid param, csiphy_dev: %s",
|
||||
CAM_IS_NULL_TO_STR(csiphy_dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (offset >= CSIPHY_MAX_INSTANCES_PER_PHY) {
|
||||
CAM_ERR(CAM_CSIPHY, "Invalid CSIPHY param offset: %d",
|
||||
offset);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
param = &csiphy_dev->csiphy_info[offset];
|
||||
tz_secure_info = ¶m->secure_info;
|
||||
|
||||
if (param->csiphy_3phase) {
|
||||
if (param->lane_enable & CPHY_LANE_0)
|
||||
@@ -60,12 +74,12 @@ static int cam_csiphy_format_secure_phy_lane_info(
|
||||
csiphy_dev->soc_info.index);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
phy_lane_sel_mask |= BIT(csiphy_dev->soc_info.index);
|
||||
*mask = phy_lane_sel_mask;
|
||||
tz_secure_info->phy_lane_sel_mask |= phy_lane_sel_mask;
|
||||
|
||||
CAM_DBG(CAM_CSIPHY, "Formatted PHY[%u] phy_lane_sel_mask: 0x%llx",
|
||||
csiphy_dev->soc_info.index, *mask);
|
||||
csiphy_dev->soc_info.index,
|
||||
tz_secure_info->phy_lane_sel_mask);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -94,34 +108,35 @@ static void cam_csiphy_populate_secure_info(
|
||||
struct cam_csiphy_secure_info *secure_info =
|
||||
(struct cam_csiphy_secure_info *)data;
|
||||
struct cam_csiphy_param *param;
|
||||
struct cam_csiphy_tz_secure_info *tz_secure_info;
|
||||
|
||||
for (i = 0; i < CSIPHY_MAX_INSTANCES_PER_PHY; i++) {
|
||||
param = &csiphy_dev->csiphy_info[i];
|
||||
|
||||
if (param->secure_mode &&
|
||||
param->lane_assign == secure_info->lane_assign) {
|
||||
tz_secure_info = ¶m->secure_info;
|
||||
|
||||
param->secure_info.cdm_hw_idx_mask = secure_info->cdm_hw_idx_mask;
|
||||
param->secure_info.csid_hw_idx_mask = secure_info->csid_hw_idx_mask;
|
||||
param->secure_info.vc_mask = secure_info->vc_mask;
|
||||
param->secure_info.phy_lane_sel_mask = 0;
|
||||
tz_secure_info->cdm_hw_idx_mask = secure_info->cdm_hw_idx_mask;
|
||||
tz_secure_info->csid_hw_idx_mask = secure_info->csid_hw_idx_mask;
|
||||
tz_secure_info->vc_mask = secure_info->vc_mask;
|
||||
tz_secure_info->phy_lane_sel_mask = 0;
|
||||
|
||||
if (!cam_csiphy_format_secure_phy_lane_info(csiphy_dev, i,
|
||||
¶m->csiphy_phy_lane_sel_mask)) {
|
||||
if (!cam_csiphy_format_secure_phy_lane_info(csiphy_dev, i)) {
|
||||
param->secure_info_updated = true;
|
||||
|
||||
CAM_DBG(CAM_CSIPHY,
|
||||
"PHY[%d] secure info, phy_lane_mask: 0x%llx, ife: 0x%x, cdm: 0x%x, vc_mask: 0x%llx",
|
||||
csiphy_dev->soc_info.index,
|
||||
param->csiphy_phy_lane_sel_mask,
|
||||
param->secure_info.csid_hw_idx_mask,
|
||||
param->secure_info.cdm_hw_idx_mask,
|
||||
param->secure_info.vc_mask);
|
||||
tz_secure_info->phy_lane_sel_mask,
|
||||
tz_secure_info->csid_hw_idx_mask,
|
||||
tz_secure_info->cdm_hw_idx_mask,
|
||||
tz_secure_info->vc_mask);
|
||||
} else
|
||||
CAM_ERR(CAM_CSIPHY,
|
||||
"Error in formatting PHY[%u] phy_lane_sel_mask: 0x%llx",
|
||||
csiphy_dev->soc_info.index,
|
||||
param->csiphy_phy_lane_sel_mask);
|
||||
tz_secure_info->phy_lane_sel_mask);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@@ -123,6 +123,28 @@ struct cam_csiphy_secure_info {
|
||||
uint32_t cdm_hw_idx_mask;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cam_csiphy_tz_secure_info
|
||||
*
|
||||
* This is the struct containing all the necessary values
|
||||
* for scm programming of domain id
|
||||
*
|
||||
* @phy_lane_sel_mask: This value to be filled completely by csiphy
|
||||
* @csid_hw_idx_mask: Bit position denoting CSID(s) in use for secure
|
||||
* session
|
||||
* @cdm_hw_idx_mask: Bit position denoting CDM in use for secure
|
||||
* session
|
||||
* @vc_mask: VC mask (unused in mobile case)
|
||||
* @protect: To protect or reset previously protected lanes
|
||||
*/
|
||||
struct cam_csiphy_tz_secure_info {
|
||||
uint64_t phy_lane_sel_mask;
|
||||
uint32_t csid_hw_idx_mask;
|
||||
uint32_t cdm_hw_idx_mask;
|
||||
uint32_t vc_mask;
|
||||
uint32_t protect;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cam_csiphy_aon_sel_params_t
|
||||
* @aon_cam_sel_offset : AON Cam Select Register offset in cpas top
|
||||
@@ -307,10 +329,9 @@ struct csiphy_ctrl_t {
|
||||
* @csiphy_3phase : To identify DPHY or CPHY
|
||||
* @mipi_flags : MIPI phy flags
|
||||
* @csiphy_cpas_cp_reg_mask : CP reg mask for phy instance
|
||||
* @csiphy_phy_lane_sel_mask : Generic format for CP information for PHY and lane
|
||||
* @hdl_data : CSIPHY handle table
|
||||
* @secure_info : All domain-id security related information packed in proper
|
||||
* format for mink call
|
||||
* format for scm call
|
||||
* @secure_info_updated : If all information in the secure_info struct above
|
||||
* is passed and formatted properly from CSID driver
|
||||
* @conn_csid_idx : Connected CSID core idx (Primary csid in case of dual ife)
|
||||
@@ -327,9 +348,8 @@ struct cam_csiphy_param {
|
||||
int csiphy_3phase;
|
||||
uint16_t mipi_flags;
|
||||
uint64_t csiphy_cpas_cp_reg_mask;
|
||||
uint64_t csiphy_phy_lane_sel_mask;
|
||||
struct csiphy_hdl_tbl hdl_data;
|
||||
struct cam_csiphy_secure_info secure_info;
|
||||
struct cam_csiphy_tz_secure_info secure_info;
|
||||
bool secure_info_updated;
|
||||
int32_t conn_csid_idx;
|
||||
bool use_hw_client_voting;
|
||||
|
Reference in New Issue
Block a user