arm64: define hikey620 sys sd energy model
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Thu, 18 Aug 2016 13:27:09 +0000 (14:27 +0100)
committerLukasz Luba <l.luba@partner.samsung.com>
Mon, 10 Sep 2018 08:24:09 +0000 (10:24 +0200)
Hi6220 has a single frequency domain spanning the two clusters. It
needs the SYS sched domain (sd) to let the EAS algorithm work
properly.

The SD_SHARE_CAP_STATES flag is not set on SYS sd.

This lets sd_ea (highest sd w/ energy model data) point to the SYS
sd whereas sd_scs (highest sd w/ SD_SHARE_CAP_STATES set) points to
the DIE sd. This setup allows the code in sched_group_energy() to
set sg_shared_cap to the single sched group of the SYS sd covering
all the cpus in the system as they are all part of the single
frequency domain.

The capacity and idle state vectors only contain entries w/ power
values equal zero, so there is no system-wide energy contribution.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
arch/arm64/kernel/energy_model.h

index 4a86fa37901c8803bcc4c2f6337d7a40120564f6..0a7c13466cdee8c826fddd7bf443ebda693f5d13 100644 (file)
@@ -109,6 +109,24 @@ static struct sched_group_energy energy_core_juno_a57 = {
 
 /* HiKey */
 
+static struct idle_state idle_states_system_hikey[] = {
+       { .power = 0 }, /* arch_cpu_idle() (active idle) = WFI */
+       { .power = 0 }, /* WFI */
+       { .power = 0 }, /* cpu-sleep */
+       { .power = 0 }, /* cluster-sleep */
+};
+
+static struct capacity_state cap_states_system_hikey[] = {
+       { .cap = 1024, .power = 0, },
+};
+
+static struct sched_group_energy energy_system_hikey = {
+       .nr_idle_states = ARRAY_SIZE(idle_states_system_hikey),
+       .idle_states    = idle_states_system_hikey,
+       .nr_cap_states  = ARRAY_SIZE(cap_states_system_hikey),
+       .cap_states     = cap_states_system_hikey,
+};
+
 static struct idle_state idle_states_cluster_hikey[] = {
        { .power = 107 }, /* arch_cpu_idle() (active idle) = WFI */
        { .power = 107 }, /* WFI */
@@ -173,7 +191,7 @@ static struct energy_model juno_model = {
 static struct energy_model hikey_model = {
        { &energy_core_hikey, &energy_core_hikey, },
        { &energy_cluster_hikey, &energy_cluster_hikey, },
-       {},
+       { &energy_system_hikey, &energy_system_hikey, },
 };
 
 static struct of_device_id model_matches[] = {