cal_cpu_disable(cpu);
}
-static void cluster_enable(unsigned int cluster_id)
+static DEFINE_PER_CPU(int, vcluster_id);
+static void cluster_enable(unsigned int cpu_id)
{
+ unsigned int cluster_id = per_cpu(vcluster_id, cpu_id);;
cal_cluster_enable(cluster_id);
big_reset_control(1);
}
-static void cluster_disable(unsigned int cluster_id)
+static void cluster_disable(unsigned int cpu_id)
{
+ unsigned int cluster_id = per_cpu(vcluster_id, cpu_id);
big_reset_control(0);
cal_cluster_disable(cluster_id);
}
cpumask_and(&mask, cpu_coregroup_mask(cpu), cpu_online_mask);
if (cpumask_weight(&mask) == 0)
- cluster_enable(cpu_topology[cpu].cluster_id);
+ cluster_enable(cpu);
cpu_enable(cpu);
cpumask_and(&mask, cpu_coregroup_mask(cpu), cpu_online_mask);
if (cpumask_weight(&mask) == 0)
- cluster_disable(cpu_topology[cpu].cluster_id);
+ cluster_disable(cpu);
return 0;
}
*/
switch (mode->type) {
case POWERMODE_TYPE_CLUSTER:
- cluster_disable(cpu_topology[cpu].cluster_id);
+ cluster_disable(cpu);
break;
case POWERMODE_TYPE_SYSTEM:
if (unlikely(exynos_system_idle_enter()))
switch (mode->type) {
case POWERMODE_TYPE_CLUSTER:
- cluster_enable(cpu_topology[cpu].cluster_id);
+ cluster_enable(cpu);
break;
case POWERMODE_TYPE_SYSTEM:
exynos_system_idle_exit(cancel);
if (attr_count)
cpupm_sysfs_node_init(attr_count);
+ dn = of_find_node_by_path("/cpupm/vcpu_topology");
+ if (dn){
+ int i, cluster_cnt = 0;
+ of_property_read_u32(dn, "vcluster_cnt", &cluster_cnt);
+
+ pr_info("%s:Virtual Cluster Info\n", __func__);
+ for (i = 0 ; i < cluster_cnt ; i++) {
+ int cpu;
+ char name[20];
+ struct cpumask sibling;
+ snprintf(name, sizeof(name), "vcluster%d_sibling", i);
+ if (!of_property_read_string(dn, name, &buf)) {
+ cpulist_parse(buf, &sibling);
+
+ pr_info("Cluster%d : ", i);
+ for_each_cpu(cpu, &sibling) {
+ per_cpu(vcluster_id, cpu) = i;
+ pr_info("%d ", cpu);
+ }
+ pr_info("\n");
+ }
+ }
+ }else {
+ pr_info("No Virtual Cluster Info\n");
+ }
+
return 0;
}