diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-09-13 05:43:52 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-09-13 05:43:52 -0700 |
| commit | d58d587e95f6d19f903a4e4c0cbd26cfcadb1f6c (patch) | |
| tree | 51a66187c75470a1e3a4e8a668b33bb4931fd51a | |
| parent | 212c5900df410a9cb7d2f4d658bfafcedc7cecb6 (diff) | |
| parent | 98e5fbba6aae2c22de939393ebdc0c85169f14ac (diff) | |
Merge "scsi: ufs-qcom: configure ufs clocks core memory"
| -rw-r--r-- | drivers/scsi/ufs/ufs-qcom.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 09c5b71be8cb..fde0d408d27e 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -349,6 +349,28 @@ out: return err; } +static void ufs_qcom_force_mem_config(struct ufs_hba *hba) +{ + struct ufs_clk_info *clki; + + /* + * Configure the behavior of ufs clocks core and peripheral + * memory state when they are turned off. + * This configuration is required to allow retaining + * ICE crypto configuration (including keys) when + * core_clk_ice is turned off, and powering down + * non-ICE RAMs of host controller. + */ + list_for_each_entry(clki, &hba->clk_list_head, list) { + if (!strcmp(clki->name, "core_clk_ice")) + clk_set_flags(clki->clk, CLKFLAG_RETAIN_MEM); + else + clk_set_flags(clki->clk, CLKFLAG_NORETAIN_MEM); + clk_set_flags(clki->clk, CLKFLAG_NORETAIN_PERIPH); + clk_set_flags(clki->clk, CLKFLAG_PERIPH_OFF_CLEAR); + } +} + static int ufs_qcom_hce_enable_notify(struct ufs_hba *hba, enum ufs_notify_change_status status) { @@ -357,6 +379,7 @@ static int ufs_qcom_hce_enable_notify(struct ufs_hba *hba, switch (status) { case PRE_CHANGE: + ufs_qcom_force_mem_config(hba); ufs_qcom_power_up_sequence(hba); /* * The PHY PLL output is the source of tx/rx lane symbol |
