Re: [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Reviewed-by: Maulik Shah <mkshah@xxxxxxxxxxxxxx>

Thanks,
Maulik

On 10/18/2021 4:38 PM, Stephan Gerhold wrote:
Not all RPM firmware versions have the dynamic sleep stats offset
available. Older versions use a fixed offset of 0xdba0.

Add support for this using a new qcom,rpm-legacy-stats compatible
that can be used for older SoCs like MSM8916.

Suggested-by: Maulik Shah <mkshah@xxxxxxxxxxxxxx>
Signed-off-by: Stephan Gerhold <stephan@xxxxxxxxxxx>
---
  drivers/soc/qcom/qcom_stats.c | 10 ++++++++++
  1 file changed, 10 insertions(+)

diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
index 817505bd99b5..67728de718fd 100644
--- a/drivers/soc/qcom/qcom_stats.c
+++ b/drivers/soc/qcom/qcom_stats.c
@@ -237,6 +237,15 @@ static const struct stats_config rpm_data = {
  	.subsystem_stats_in_smem = false,
  };
+/* Older RPM firmwares have the stats at a fixed offset instead */
+static const struct stats_config rpm_legacy_data = {
+	.stats_offset = 0xdba0,
+	.num_records = 2,
+	.appended_stats_avail = true,
+	.dynamic_offset = false,
+	.subsystem_stats_in_smem = false,
+};
+
  static const struct stats_config rpmh_data = {
  	.stats_offset = 0x48,
  	.num_records = 3,
@@ -247,6 +256,7 @@ static const struct stats_config rpmh_data = {
static const struct of_device_id qcom_stats_table[] = {
  	{ .compatible = "qcom,rpm-stats", .data = &rpm_data },
+	{ .compatible = "qcom,rpm-legacy-stats", .data = &rpm_legacy_data },
  	{ .compatible = "qcom,rpmh-stats", .data = &rpmh_data },
  	{ }
  };


--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux