Loading Documentation/devicetree/bindings/arm/msm/spm-v2.txt +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ only on SAW2 v3.0 and above. the SPM needs to be used for clock gating. Using the SPM for clock gating would result in auto clock gating being disabled. Use this on targets that do not support or do not use auto clock gating. - qcom,use-qchannel-for-wfi: This boolean property is used to indicate that the SPM gets triggerd by the qchannel and not by means of wfi. So a wfe could trigger a spm for clock gating as well. Example 1: qcom,spm@f9089000 { Loading drivers/soc/qcom/spm_devices.c +6 −6 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ struct msm_spm_device { bool qchannel_ignore; bool allow_rpm_hs; bool use_spm_clk_gating; bool use_qchannel_for_wfi; }; struct msm_spm_vdd_info { Loading Loading @@ -162,8 +163,8 @@ static void msm_spm_config_q2s(struct msm_spm_device *dev, unsigned int mode) switch (mode) { case MSM_SPM_MODE_DISABLED: case MSM_SPM_MODE_CLOCK_GATING: qchannel_ignore = 1; spm_legacy_mode = dev->use_spm_clk_gating; qchannel_ignore = !dev->use_qchannel_for_wfi; spm_legacy_mode = 0; break; case MSM_SPM_MODE_RETENTION: qchannel_ignore = 0; Loading Loading @@ -198,10 +199,6 @@ static int msm_spm_dev_set_low_power_mode(struct msm_spm_device *dev, || (mode == MSM_SPM_MODE_GDHS)) pc_mode = true; if ((mode == MSM_SPM_MODE_CLOCK_GATING) && (!dev->use_spm_clk_gating)) mode = MSM_SPM_MODE_DISABLED; if (mode == MSM_SPM_MODE_DISABLED) { ret = msm_spm_drv_set_spm_enable(&dev->reg_data, false); } else if (!msm_spm_drv_set_spm_enable(&dev->reg_data, true)) { Loading Loading @@ -638,6 +635,9 @@ static int msm_spm_dev_probe(struct platform_device *pdev) key = "qcom,use-spm-clock-gating"; dev->use_spm_clk_gating = of_property_read_bool(node, key); key = "qcom,use-qchannel-for-wfi"; dev->use_qchannel_for_wfi = of_property_read_bool(node, key); /* * At system boot, cpus and or clusters can remain in reset. CCI SPM * will not be triggered unless SPM_LEGACY_MODE bit is set for the Loading Loading
Documentation/devicetree/bindings/arm/msm/spm-v2.txt +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ only on SAW2 v3.0 and above. the SPM needs to be used for clock gating. Using the SPM for clock gating would result in auto clock gating being disabled. Use this on targets that do not support or do not use auto clock gating. - qcom,use-qchannel-for-wfi: This boolean property is used to indicate that the SPM gets triggerd by the qchannel and not by means of wfi. So a wfe could trigger a spm for clock gating as well. Example 1: qcom,spm@f9089000 { Loading
drivers/soc/qcom/spm_devices.c +6 −6 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ struct msm_spm_device { bool qchannel_ignore; bool allow_rpm_hs; bool use_spm_clk_gating; bool use_qchannel_for_wfi; }; struct msm_spm_vdd_info { Loading Loading @@ -162,8 +163,8 @@ static void msm_spm_config_q2s(struct msm_spm_device *dev, unsigned int mode) switch (mode) { case MSM_SPM_MODE_DISABLED: case MSM_SPM_MODE_CLOCK_GATING: qchannel_ignore = 1; spm_legacy_mode = dev->use_spm_clk_gating; qchannel_ignore = !dev->use_qchannel_for_wfi; spm_legacy_mode = 0; break; case MSM_SPM_MODE_RETENTION: qchannel_ignore = 0; Loading Loading @@ -198,10 +199,6 @@ static int msm_spm_dev_set_low_power_mode(struct msm_spm_device *dev, || (mode == MSM_SPM_MODE_GDHS)) pc_mode = true; if ((mode == MSM_SPM_MODE_CLOCK_GATING) && (!dev->use_spm_clk_gating)) mode = MSM_SPM_MODE_DISABLED; if (mode == MSM_SPM_MODE_DISABLED) { ret = msm_spm_drv_set_spm_enable(&dev->reg_data, false); } else if (!msm_spm_drv_set_spm_enable(&dev->reg_data, true)) { Loading Loading @@ -638,6 +635,9 @@ static int msm_spm_dev_probe(struct platform_device *pdev) key = "qcom,use-spm-clock-gating"; dev->use_spm_clk_gating = of_property_read_bool(node, key); key = "qcom,use-qchannel-for-wfi"; dev->use_qchannel_for_wfi = of_property_read_bool(node, key); /* * At system boot, cpus and or clusters can remain in reset. CCI SPM * will not be triggered unless SPM_LEGACY_MODE bit is set for the Loading