[PATCH 20/23] power: Add a POWER config

Simon Glass sjg at chromium.org
Sun Aug 8 20:20:28 CEST 2021


At present we have SPL_POWER but not piain POWER. This works because
there is a special build rule in Makefile that always includes the
drivers/power directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

Update the pmic.h header file so that it defines the old pmic struct
always, when driver model is not in use. That will avoid build errors
for boards which enable POWER but not DM_PMIC.

Enable this option always. That seems strange at first sight, but it
actually but mimics the current Makefile behaviour. Once we can drop the
old PMICs it should be easy enough to rename DM_PMIC to POWWER, or
something similar.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 configs/mt8183_pumpkin_defconfig |  1 +
 drivers/power/Kconfig            | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/configs/mt8183_pumpkin_defconfig b/configs/mt8183_pumpkin_defconfig
index a2f06a952ab..ca6fde3daf4 100644
--- a/configs/mt8183_pumpkin_defconfig
+++ b/configs/mt8183_pumpkin_defconfig
@@ -60,6 +60,7 @@ CONFIG_MMC_MTK=y
 CONFIG_DM_ETH=y
 CONFIG_PHY=y
 CONFIG_PHY_MTK_TPHY=y
+# CONFIG_POWER is not set
 CONFIG_BAUDRATE=921600
 CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 73ba145ba83..11fd8b8f9a8 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -1,4 +1,17 @@
-menu "Power"
+menuconfig POWER
+	 bool "Power"
+	 default y
+	 help
+	  Enable support for power control in U-Boot. 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 U-Boot 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 a build.
+
+if POWER
 
 config POWER_LEGACY
 	bool "Legacy power support"
@@ -424,4 +437,4 @@ config POWER_I2C
 	  Not to be used for new designs and existing ones should be moved to
 	  the new PMIC interface based on driver model.
 
-endmenu
+endif
-- 
2.32.0.605.g8dce9f2422-goog



More information about the U-Boot mailing list