mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
scsi: ufs-qcom: configure ufs clocks core memory
Configure the ufs clocks core and peripheral memory state when turned off. This configuration is required to allow retaining ICE crypto configuration (including keys) when ice_core_clk is turned off, and powering down non-ICE RAMs of host controller. Change-Id: I93584851fd50c7006ccd48979087d707ab4c6408 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [vbadigan@codeaurora.org: updated clk_set_flag API with new API] Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
This commit is contained in:
parent
ceeea50cd7
commit
e0c9c1fe3c
1 changed files with 32 additions and 0 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/reset-controller.h>
|
||||
#include <linux/interconnect.h>
|
||||
#include <linux/phy/phy-qcom-ufs.h>
|
||||
#include <linux/clk/qcom.h>
|
||||
#include <linux/devfreq.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/blk-mq.h>
|
||||
|
|
@ -591,6 +592,36 @@ 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.
|
||||
*
|
||||
* This is applicable only to gcc clocks.
|
||||
*/
|
||||
list_for_each_entry(clki, &hba->clk_list_head, list) {
|
||||
|
||||
/* skip it for non-gcc (rpmh) clocks */
|
||||
if (!strcmp(clki->name, "ref_clk"))
|
||||
continue;
|
||||
|
||||
if (!strcmp(clki->name, "core_clk_ice") ||
|
||||
!strcmp(clki->name, "core_clk_ice_hw_ctl"))
|
||||
qcom_clk_set_flags(clki->clk, CLKFLAG_RETAIN_MEM);
|
||||
else
|
||||
qcom_clk_set_flags(clki->clk, CLKFLAG_NORETAIN_MEM);
|
||||
qcom_clk_set_flags(clki->clk, CLKFLAG_NORETAIN_PERIPH);
|
||||
qcom_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)
|
||||
{
|
||||
|
|
@ -599,6 +630,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
|
||||
|
|
|
|||
Loading…
Reference in a new issue