diff --git a/drivers/cpuidle/lpm-levels-of.c b/drivers/cpuidle/lpm-levels-of.c index db77b020c4a2..28cf6c6a3791 100644 --- a/drivers/cpuidle/lpm-levels-of.c +++ b/drivers/cpuidle/lpm-levels-of.c @@ -549,6 +549,7 @@ static int parse_cpu_levels(struct device_node *dn, struct lpm_cluster *c) cpu->parent = c; + of_property_read_string(dn, "label", &cpu->domain_name); ret = lpm_of_read_u32(dn, "qcom,psci-mode-shift", &cpu->psci_mode_shift, true); if (ret) @@ -696,7 +697,7 @@ static void add_rimps_tmr_register(struct device_node *dn, { struct lpm_cpu *lpm_cpu; uint32_t rimps_threshold = 0; - static uint32_t i; + uint32_t index; if (list_empty(&cl->cpu)) { struct lpm_cluster *n; @@ -708,7 +709,18 @@ static void add_rimps_tmr_register(struct device_node *dn, list_for_each_entry(lpm_cpu, &cl->cpu, list) { int idx = lpm_cpu->nlevels-1; - lpm_cpu->rimps_tmr_base = of_iomap(dn, i++); + if (!lpm_cpu->domain_name) { + pr_debug("cpu domain name not found\n"); + return; + } + + index = of_property_match_string(dn, "reg-names", lpm_cpu->domain_name); + if (index < 0) { + pr_debug("reg name field not found for %s\n", lpm_cpu->domain_name); + return; + } + + lpm_cpu->rimps_tmr_base = of_iomap(dn, index); if (!lpm_cpu->rimps_tmr_base) { pr_debug("Unable to get rimps base address\n"); return; diff --git a/drivers/cpuidle/lpm-levels.h b/drivers/cpuidle/lpm-levels.h index e0f844b10cee..5b4fa93f1632 100644 --- a/drivers/cpuidle/lpm-levels.h +++ b/drivers/cpuidle/lpm-levels.h @@ -56,6 +56,7 @@ struct lpm_cpu { struct cpumask related_cpus; struct lpm_cpu_level levels[NR_LPM_LEVELS]; int nlevels; + const char *domain_name; unsigned int psci_mode_shift; unsigned int psci_mode_mask; uint32_t ref_stddev;