|
@@ -1234,11 +1234,11 @@ static int __cam_csiphy_prgm_bist_reg(struct csiphy_device *csiphy_dev, bool is_
|
|
|
}
|
|
|
|
|
|
static int cam_csiphy_program_secure_mode(struct csiphy_device *csiphy_dev,
|
|
|
- bool protect, int32_t offset)
|
|
|
+ bool protect, int32_t offset, bool is_shutdown)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
|
|
|
- if (csiphy_dev->domain_id_security && protect) {
|
|
|
+ if (csiphy_dev->domain_id_security) {
|
|
|
if (!csiphy_dev->csiphy_info[offset].secure_info_updated) {
|
|
|
CAM_ERR(CAM_CSIPHY,
|
|
|
"PHY[%u] domain id info not updated, aborting secure call",
|
|
@@ -1252,12 +1252,12 @@ static int cam_csiphy_program_secure_mode(struct csiphy_device *csiphy_dev,
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
- rc = cam_csiphy_notify_secure_mode(csiphy_dev, protect, offset);
|
|
|
+ rc = cam_csiphy_notify_secure_mode(csiphy_dev, protect, offset, is_shutdown);
|
|
|
|
|
|
- if (csiphy_dev->domain_id_security && !protect) {
|
|
|
+ if (csiphy_dev->domain_id_security) {
|
|
|
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;
|
|
@@ -1436,7 +1436,7 @@ void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)
|
|
|
|
|
|
if (param->secure_mode)
|
|
|
cam_csiphy_program_secure_mode(csiphy_dev,
|
|
|
- CAM_SECURE_MODE_NON_SECURE, i);
|
|
|
+ CAM_SECURE_MODE_NON_SECURE, i, true);
|
|
|
|
|
|
param->secure_mode = CAM_SECURE_MODE_NON_SECURE;
|
|
|
|
|
@@ -2216,7 +2216,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
|
|
if (--csiphy_dev->start_dev_count) {
|
|
|
if (param->secure_mode)
|
|
|
cam_csiphy_program_secure_mode(csiphy_dev,
|
|
|
- CAM_SECURE_MODE_NON_SECURE, offset);
|
|
|
+ CAM_SECURE_MODE_NON_SECURE, offset, false);
|
|
|
|
|
|
param->secure_mode = CAM_SECURE_MODE_NON_SECURE;
|
|
|
param->csiphy_cpas_cp_reg_mask = 0;
|
|
@@ -2253,7 +2253,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
|
|
|
|
|
if (param->secure_mode)
|
|
|
cam_csiphy_program_secure_mode(csiphy_dev, CAM_SECURE_MODE_NON_SECURE,
|
|
|
- offset);
|
|
|
+ offset, false);
|
|
|
|
|
|
param->secure_mode = CAM_SECURE_MODE_NON_SECURE;
|
|
|
param->csiphy_cpas_cp_reg_mask = 0x0;
|
|
@@ -2323,7 +2323,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
|
|
if (csiphy_dev->csiphy_info[offset].secure_mode)
|
|
|
cam_csiphy_program_secure_mode(
|
|
|
csiphy_dev,
|
|
|
- CAM_SECURE_MODE_NON_SECURE, offset);
|
|
|
+ CAM_SECURE_MODE_NON_SECURE, offset, false);
|
|
|
|
|
|
csiphy_dev->csiphy_info[offset].secure_mode =
|
|
|
CAM_SECURE_MODE_NON_SECURE;
|
|
@@ -2503,7 +2503,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
|
|
}
|
|
|
|
|
|
rc = cam_csiphy_program_secure_mode(csiphy_dev,
|
|
|
- CAM_SECURE_MODE_SECURE, offset);
|
|
|
+ CAM_SECURE_MODE_SECURE, offset, false);
|
|
|
if (rc) {
|
|
|
csiphy_dev->csiphy_info[offset]
|
|
|
.secure_mode =
|
|
@@ -2574,7 +2574,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
|
|
|
|
|
rc = cam_csiphy_program_secure_mode(
|
|
|
csiphy_dev,
|
|
|
- CAM_SECURE_MODE_SECURE, offset);
|
|
|
+ CAM_SECURE_MODE_SECURE, offset, false);
|
|
|
if (rc) {
|
|
|
csiphy_dev->csiphy_info[offset].secure_mode =
|
|
|
CAM_SECURE_MODE_NON_SECURE;
|