From 72e29a674cb4b7ba60f47dfce5261739b696be0b Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Wed, 5 Dec 2018 15:57:31 +0000 Subject: [PATCH] ANDROID: PM / EM: Document the support for legacy (deprecated) EM Android 4.19 has a compatibility driver enabling to load legacy EMs (now DEPRECATED) into the new framework. Although it is NOT RECOMMENDED to use this feature, it *is* there, so we should at least document it. It's also an opportunity to make clear it's deprecated, and to point at the alternative solutions. Bug: 120440300 Change-Id: I1ec43208c2727b878d31c508153e2a0a0e7fa55b Signed-off-by: Quentin Perret --- Documentation/power/energy-model.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Documentation/power/energy-model.txt b/Documentation/power/energy-model.txt index a2b0ae4c76bd..5a23c6f33d28 100644 --- a/Documentation/power/energy-model.txt +++ b/Documentation/power/energy-model.txt @@ -142,3 +142,28 @@ EM framework. 37 38 return 0; 39 } + + +4. Support for legacy Energy Models (DEPRECATED) +------------------------------------------------ + +The Android kernel version 4.14 and before used a different type of EM for EAS, +referred to as the 'legacy' EM. The legacy EM relies on the out-of-tree +'sched-energy-costs' devicetree bindings to provide the kernel with power costs. +The usage of such bindings in Android has now been DEPRECATED in favour of the +mainline equivalents. + +The currently supported alternatives to populate the EM include: + - using a firmware-based solution such as Arm SCMI (supported in + drivers/cpufreq/scmi-cpufreq.c); + - using the 'dynamic-power-coefficient' devicetree binding together with + PM_OPP. See the of_dev_pm_opp_get_cpu_power() helper in PM_OPP, and the + reference implementation in drivers/cpufreq/cpufreq-dt.c. + +In order to ease the transition to the new EM format, Android 4.19 also provides +a compatibility driver able to load a legacy EM from DT into the EM framework. +*** Please note that THIS FEATURE WILL NOT BE AVAILABLE in future Android +kernels, and as such it must be considered only as a temporary workaround. *** + +If you know what you're doing and still want to use this driver, you need to set +CONFIG_LEGACY_ENERGY_MODEL_DT=y in your kernel configuration to enable it.