From a1e161fc46e86f6ff44f8ba1310eb395db7df87c Mon Sep 17 00:00:00 2001 From: Santosh Mardi Date: Thu, 25 Feb 2021 18:17:01 +0530 Subject: [PATCH] drivers: soc: qcom: rimps_memlat: add configs to get PMU/AMU count Add CONFIG options to get the number of AMUs and PMUs supported on a given target to define the size of structures accordingly in driver. Change-Id: I6ed58465f789156887a28bd49da7220396854e50 Signed-off-by: Santosh Mardi --- drivers/soc/qcom/Kconfig | 11 +++++++++++ drivers/soc/qcom/rimps_memlat.c | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 713614f86c7b..8ed5295b502d 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -859,6 +859,17 @@ config QTI_HW_MEMLAT table, PMU counters and saving the values of PMU counters during LPM and hotplug. +config QTI_HW_NUM_AMU + int + default 7 if ARCH_LAHAINA && QTI_HW_MEMLAT + default 5 if ARCH_HOLI && QTI_HW_MEMLAT + default 5 + +config QTI_HW_NUM_PMU + int + default 6 if (ARCH_LAHAINA || ARCH_HOLI) && QTI_HW_MEMLAT + default 6 + config QTI_HW_MEMLAT_SCMI_CLIENT tristate "Qualcomm Technologies Inc. SCMI client driver for HW MEMLAT" depends on QTI_HW_MEMLAT diff --git a/drivers/soc/qcom/rimps_memlat.c b/drivers/soc/qcom/rimps_memlat.c index 018416aa1055..d517a4df3221 100644 --- a/drivers/soc/qcom/rimps_memlat.c +++ b/drivers/soc/qcom/rimps_memlat.c @@ -102,7 +102,8 @@ struct core_dev_map { struct cpu_pmu_ctrs { uint32_t ccntr_lo; uint32_t ccntr_hi; - uint32_t evcntr[MAX_EVCNTRS]; + uint32_t evcntr[CONFIG_QTI_HW_NUM_PMU]; + uint32_t amu_evcntr[CONFIG_QTI_HW_NUM_AMU * 2]; uint32_t valid; uint32_t unused0; };