power: Refactor Makefile rules
Move the power/ rules into drivers/power to avoid clutter in the Makefile
and drivers/Makefile files.
We must select SPL_POWER if SPL_POWER_DOMAIN is used, since the two are
currently independent and boards do not necessarily enable SPL_POWER.
Add a TPL_POWER as well, as that is used by one board.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 2618857..690926d 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1038,6 +1038,7 @@
config SPL_POWER_DOMAIN
bool "Support power domain drivers"
+ select SPL_POWER
help
Enable support for power domain control in SPL. Many SoCs allow
power to be applied to or removed from portions of the SoC (power
@@ -1425,6 +1426,18 @@
Enable, if the TPL stage should not inherit its initial
stack-pointer from the settings for the SPL stage.
+config TPL_POWER
+ bool "Support power drivers"
+ help
+ Enable support for power control in TPL. This includes support
+ for PMICs (Power-management Integrated Circuits) and some of the
+ features provided by PMICs. In particular, voltage regulators can
+ be used to enable/disable power and vary its voltage. That can be
+ useful in TPL to turn on boot peripherals and adjust CPU voltage
+ so that the clock speed can be increased. This enables the drivers
+ in drivers/power, drivers/power/pmic and drivers/power/regulator
+ as part of an TPL build.
+
config TPL_TEXT_BASE
hex "Base address for the .text section of the TPL stage"
depends on TPL_NEEDS_SEPARATE_TEXT_BASE