[PATCH 19/23] i2c: Convert CONFIG_POWER_I2C et al to Kconfig

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


This converts the following to Kconfig:
   CONFIG_POWER_I2C
   CONFIG_POWER_LEGACY

They are handled at the same time due to a dependency between them.
Update the Makefile rule to use legacy power only in U-Boot proper.

Unfortunately a separate rule is needed in SPL to be able to build legacy
power. All of this can be cleaned up when boards are migrated or removed.

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

 configs/cl-som-imx7_defconfig                 |  2 +
 configs/cm_t43_defconfig                      |  2 +
 configs/gwventana_emmc_defconfig              |  2 +
 configs/gwventana_gw5904_defconfig            |  2 +
 configs/gwventana_nand_defconfig              |  2 +
 configs/hikey_defconfig                       |  1 +
 configs/imx8mp_evk_defconfig                  |  2 +
 configs/imx8mq_evk_defconfig                  |  2 +
 configs/ls1046ardb_emmc_defconfig             |  2 +
 configs/ls1046ardb_qspi_SECURE_BOOT_defconfig |  2 +
 configs/ls1046ardb_qspi_defconfig             |  2 +
 configs/ls1046ardb_qspi_spl_defconfig         |  2 +
 .../ls1046ardb_sdcard_SECURE_BOOT_defconfig   |  2 +
 configs/ls1046ardb_sdcard_defconfig           |  2 +
 configs/ls1046ardb_tfa_SECURE_BOOT_defconfig  |  2 +
 configs/ls1046ardb_tfa_defconfig              |  2 +
 configs/mx51evk_defconfig                     |  1 +
 configs/mx53loco_defconfig                    |  2 +
 configs/mx6sabreauto_defconfig                |  2 +
 configs/mx6sabresd_defconfig                  |  2 +
 configs/novena_defconfig                      |  2 +
 configs/phycore-imx8mp_defconfig              |  2 +
 configs/pico-dwarf-imx7d_defconfig            |  2 +
 configs/pico-hobbit-imx7d_defconfig           |  2 +
 configs/pico-imx7d_bl33_defconfig             |  2 +
 configs/pico-imx7d_defconfig                  |  2 +
 configs/pico-nymph-imx7d_defconfig            |  2 +
 configs/pico-pi-imx7d_defconfig               |  2 +
 configs/udoo_neo_defconfig                    |  2 +
 configs/vining_2000_defconfig                 |  2 +
 configs/warp_defconfig                        |  2 +
 drivers/power/Kconfig                         | 39 +++++++++++++++++++
 drivers/power/Makefile                        |  2 +-
 include/configs/am43xx_evm.h                  |  4 --
 include/configs/cl-som-imx7.h                 |  2 -
 include/configs/cm_t43.h                      |  2 -
 include/configs/el6x_common.h                 |  2 -
 include/configs/gw_ventana.h                  |  2 -
 include/configs/hikey.h                       |  1 -
 include/configs/imx8mp_evk.h                  |  2 -
 include/configs/imx8mq_evk.h                  |  2 -
 include/configs/imx8mq_phanbell.h             |  3 --
 include/configs/ls1046ardb.h                  |  4 --
 include/configs/mx51evk.h                     |  1 -
 include/configs/mx53loco.h                    |  2 -
 include/configs/mx6sabreauto.h                |  2 -
 include/configs/mx6sabresd.h                  |  2 -
 include/configs/novena.h                      |  2 -
 include/configs/phycore_imx8mp.h              |  2 -
 include/configs/pico-imx7d.h                  |  2 -
 include/configs/pico-imx8mq.h                 |  3 --
 include/configs/tqma6.h                       |  2 -
 include/configs/udoo_neo.h                    |  2 -
 include/configs/vining_2000.h                 |  2 -
 include/configs/warp.h                        |  2 -
 scripts/config_whitelist.txt                  |  2 -
 56 files changed, 100 insertions(+), 51 deletions(-)

diff --git a/configs/cl-som-imx7_defconfig b/configs/cl-som-imx7_defconfig
index a65dd4993a7..64cc4e5061c 100644
--- a/configs/cl-som-imx7_defconfig
+++ b/configs/cl-som-imx7_defconfig
@@ -77,7 +77,9 @@ CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_ATHEROS=y
 CONFIG_MII=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/cm_t43_defconfig b/configs/cm_t43_defconfig
index 682c07fad02..0563886d64e 100644
--- a/configs/cm_t43_defconfig
+++ b/configs/cm_t43_defconfig
@@ -77,6 +77,8 @@ CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_ATHEROS=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig
index 7679fbd6ac4..a9d6383cd95 100644
--- a/configs/gwventana_emmc_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -93,8 +93,10 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_POWER_I2C=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
diff --git a/configs/gwventana_gw5904_defconfig b/configs/gwventana_gw5904_defconfig
index 36de1007598..4ec707bc06e 100644
--- a/configs/gwventana_gw5904_defconfig
+++ b/configs/gwventana_gw5904_defconfig
@@ -97,8 +97,10 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_POWER_I2C=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig
index 2515eb5d834..8fb05f34b87 100644
--- a/configs/gwventana_nand_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -99,8 +99,10 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_POWER_I2C=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
diff --git a/configs/hikey_defconfig b/configs/hikey_defconfig
index 0ec1ed78a0b..31cf83704a5 100644
--- a/configs/hikey_defconfig
+++ b/configs/hikey_defconfig
@@ -24,6 +24,7 @@ CONFIG_SYS_MMC_ENV_PART=2
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_K3=y
 CONFIG_DM_ETH=y
+CONFIG_POWER_LEGACY=y
 CONFIG_CONS_INDEX=4
 CONFIG_USB=y
 CONFIG_USB_DWC2=y
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index d63a3a4f32f..11f9cb28f55 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -80,9 +80,11 @@ CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
diff --git a/configs/imx8mq_evk_defconfig b/configs/imx8mq_evk_defconfig
index 6a8e105dbd4..c62d335b00c 100644
--- a/configs/imx8mq_evk_defconfig
+++ b/configs/imx8mq_evk_defconfig
@@ -48,11 +48,13 @@ CONFIG_PHY=y
 CONFIG_PHY_IMX8MQ_USB=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
+CONFIG_POWER_LEGACY=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_IMX8M_POWER_DOMAIN=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_POWER_I2C=y
 CONFIG_DM_RESET=y
 CONFIG_MXC_UART=y
 CONFIG_DM_THERMAL=y
diff --git a/configs/ls1046ardb_emmc_defconfig b/configs/ls1046ardb_emmc_defconfig
index 614597ef824..9a7a82d1b22 100644
--- a/configs/ls1046ardb_emmc_defconfig
+++ b/configs/ls1046ardb_emmc_defconfig
@@ -70,6 +70,8 @@ CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_SYS_QE_FMAN_FW_IN_MMC=y
 CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
index edb20e7e9f8..88ae9cc077c 100644
--- a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
@@ -52,6 +52,8 @@ CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH=y
 CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/ls1046ardb_qspi_defconfig b/configs/ls1046ardb_qspi_defconfig
index 087c17bb613..b8f1e284175 100644
--- a/configs/ls1046ardb_qspi_defconfig
+++ b/configs/ls1046ardb_qspi_defconfig
@@ -56,6 +56,8 @@ CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH=y
 CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/ls1046ardb_qspi_spl_defconfig b/configs/ls1046ardb_qspi_spl_defconfig
index 8ef17ab9e0a..3dc4675f4f3 100644
--- a/configs/ls1046ardb_qspi_spl_defconfig
+++ b/configs/ls1046ardb_qspi_spl_defconfig
@@ -74,6 +74,8 @@ CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH=y
 CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
index efc58918306..abe1f7d15e7 100644
--- a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
@@ -69,6 +69,8 @@ CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_SYS_QE_FMAN_FW_IN_MMC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
diff --git a/configs/ls1046ardb_sdcard_defconfig b/configs/ls1046ardb_sdcard_defconfig
index faa93e8e38d..11cd51056eb 100644
--- a/configs/ls1046ardb_sdcard_defconfig
+++ b/configs/ls1046ardb_sdcard_defconfig
@@ -69,6 +69,8 @@ CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_SYS_QE_FMAN_FW_IN_MMC=y
 CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
index bc37699c0a6..8a2b241cd0e 100644
--- a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
@@ -52,6 +52,8 @@ CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
diff --git a/configs/ls1046ardb_tfa_defconfig b/configs/ls1046ardb_tfa_defconfig
index 997fa1936e7..2bdeec5c614 100644
--- a/configs/ls1046ardb_tfa_defconfig
+++ b/configs/ls1046ardb_tfa_defconfig
@@ -58,6 +58,8 @@ CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_PCIE_LAYERSCAPE_EP=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
diff --git a/configs/mx51evk_defconfig b/configs/mx51evk_defconfig
index 6c8b9b62e51..120133c7991 100644
--- a/configs/mx51evk_defconfig
+++ b/configs/mx51evk_defconfig
@@ -41,6 +41,7 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX5=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig
index 296886dd6c8..27dc959edbb 100644
--- a/configs/mx53loco_defconfig
+++ b/configs/mx53loco_defconfig
@@ -42,9 +42,11 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX5=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_MX5=y
diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 445911336f9..a498770b9c3 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -84,7 +84,9 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 0ce5d93ce8b..e34b5956c6f 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -93,8 +93,10 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/novena_defconfig b/configs/novena_defconfig
index ac978d827bc..e5902574313 100644
--- a/configs/novena_defconfig
+++ b/configs/novena_defconfig
@@ -62,6 +62,8 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_THERMAL=y
diff --git a/configs/phycore-imx8mp_defconfig b/configs/phycore-imx8mp_defconfig
index 059a81835fe..4b0e682cac3 100644
--- a/configs/phycore-imx8mp_defconfig
+++ b/configs/phycore-imx8mp_defconfig
@@ -91,9 +91,11 @@ CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
+CONFIG_POWER_LEGACY=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
diff --git a/configs/pico-dwarf-imx7d_defconfig b/configs/pico-dwarf-imx7d_defconfig
index 05ae3c8fa11..79b1184ce46 100644
--- a/configs/pico-dwarf-imx7d_defconfig
+++ b/configs/pico-dwarf-imx7d_defconfig
@@ -65,6 +65,8 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
diff --git a/configs/pico-hobbit-imx7d_defconfig b/configs/pico-hobbit-imx7d_defconfig
index aec03ace07b..43983e60814 100644
--- a/configs/pico-hobbit-imx7d_defconfig
+++ b/configs/pico-hobbit-imx7d_defconfig
@@ -65,6 +65,8 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
diff --git a/configs/pico-imx7d_bl33_defconfig b/configs/pico-imx7d_bl33_defconfig
index d9a78efc452..d6108246ebf 100644
--- a/configs/pico-imx7d_bl33_defconfig
+++ b/configs/pico-imx7d_bl33_defconfig
@@ -59,6 +59,8 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_CONS_INDEX=4
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig
index 212f852dbee..dd1872d15f1 100644
--- a/configs/pico-imx7d_defconfig
+++ b/configs/pico-imx7d_defconfig
@@ -65,6 +65,8 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
diff --git a/configs/pico-nymph-imx7d_defconfig b/configs/pico-nymph-imx7d_defconfig
index 05ae3c8fa11..79b1184ce46 100644
--- a/configs/pico-nymph-imx7d_defconfig
+++ b/configs/pico-nymph-imx7d_defconfig
@@ -65,6 +65,8 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index 36f75fe7876..0294e4b0589 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -65,6 +65,8 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
diff --git a/configs/udoo_neo_defconfig b/configs/udoo_neo_defconfig
index 0f10b865a1c..ae691588f8e 100644
--- a/configs/udoo_neo_defconfig
+++ b/configs/udoo_neo_defconfig
@@ -46,5 +46,7 @@ CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
diff --git a/configs/vining_2000_defconfig b/configs/vining_2000_defconfig
index 639196b5d45..a447094f11c 100644
--- a/configs/vining_2000_defconfig
+++ b/configs/vining_2000_defconfig
@@ -73,6 +73,8 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_PWM_IMX=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
diff --git a/configs/warp_defconfig b/configs/warp_defconfig
index dce2170354b..5730f113d08 100644
--- a/configs/warp_defconfig
+++ b/configs/warp_defconfig
@@ -34,6 +34,8 @@ CONFIG_DFU_MMC=y
 CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
+CONFIG_POWER_LEGACY=y
+CONFIG_POWER_I2C=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
 CONFIG_WATCHDOG_TIMEOUT_MSECS=30000
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index c5fbf1f832a..73ba145ba83 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -1,5 +1,34 @@
 menu "Power"
 
+config POWER_LEGACY
+	bool "Legacy power support"
+	help
+	  Note: This is a legacy option. Use DM_PMIC instead.
+
+	  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.
+
+config SPL_POWER_LEGACY
+	bool "Legacy power support in SPL"
+	default y if POWER_LEGACY
+	help
+	  Note: This is a legacy option. Use SPL_DM_PMIC instead.
+
+	  Enable support for power control in SPL. 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 SPL 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.
+
 source "drivers/power/acpi_pmc/Kconfig"
 
 source "drivers/power/domain/Kconfig"
@@ -297,6 +326,7 @@ config AXP_DLDO4_VOLT
 	default 0
 	---help---
 	Set the voltage (mV) to program the axp pmic dldo4 at, set to 0 to
+
 	disable dldo4.
 
 config AXP_ELDO1_VOLT
@@ -385,4 +415,13 @@ config POWER_MT6323
 	  This adds poweroff driver for mt6323
 	  this pmic is used on mt7623 / Bananapi R2
 
+config POWER_I2C
+	bool "I2C-based power control for legacy power"
+	help
+	  Enable this to use the I2C driver designed for the legacy PMIC
+	  interface.
+
+	  Not to be used for new designs and existing ones should be moved to
+	  the new PMIC interface based on driver model.
+
 endmenu
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index ab52bc1582c..09fe2a958d0 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -16,7 +16,7 @@ obj-$(CONFIG_TPS6586X_POWER)	+= tps6586x.o
 obj-$(CONFIG_TWL4030_POWER)	+= twl4030.o
 obj-$(CONFIG_TWL6030_POWER)	+= twl6030.o
 obj-$(CONFIG_PALMAS_POWER)	+= palmas.o
-obj-$(CONFIG_POWER_LEGACY) += power_core.o
+obj-$(CONFIG_$(SPL_TPL_)POWER_LEGACY) += power_core.o
 obj-$(CONFIG_DIALOG_POWER) += power_dialog.o
 obj-$(CONFIG_POWER_FSL) += power_fsl.o
 obj-$(CONFIG_POWER_I2C) += power_i2c.o
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index febcbf8cf93..15c9a81c3aa 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -26,10 +26,6 @@
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
 
 /* Power */
-#if !CONFIG_IS_ENABLED(DM_I2C)
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
-#endif
 #define CONFIG_POWER_TPS65218
 #define CONFIG_POWER_TPS62362
 
diff --git a/include/configs/cl-som-imx7.h b/include/configs/cl-som-imx7.h
index 652cc2fcfe7..144b4f1b961 100644
--- a/include/configs/cl-som-imx7.h
+++ b/include/configs/cl-som-imx7.h
@@ -25,8 +25,6 @@
 #define IMX_FEC_BASE			ENET_IPS_BASE_ADDR
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE3000
 #define CONFIG_POWER_PFUZE3000_I2C_ADDR	0x08
 
diff --git a/include/configs/cm_t43.h b/include/configs/cm_t43.h
index 7b3ff77e1f6..4111219acdb 100644
--- a/include/configs/cm_t43.h
+++ b/include/configs/cm_t43.h
@@ -50,8 +50,6 @@
 #define CONFIG_AM437X_USB2PHY2_HOST
 
 /* Power */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_TPS65218
 
 /* Enabling L2 Cache */
diff --git a/include/configs/el6x_common.h b/include/configs/el6x_common.h
index 505bff5df72..2e1a36f2ff7 100644
--- a/include/configs/el6x_common.h
+++ b/include/configs/el6x_common.h
@@ -34,8 +34,6 @@
 #define CONFIG_SYS_I2C_SPEED			100000
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index 8e42388692b..dce93c3883b 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -74,8 +74,6 @@
 /*
  * PMIC
  */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 #define CONFIG_POWER_LTC3676
diff --git a/include/configs/hikey.h b/include/configs/hikey.h
index fdb39a4d3aa..b842e5c3eae 100644
--- a/include/configs/hikey.h
+++ b/include/configs/hikey.h
@@ -13,7 +13,6 @@
 
 #include <linux/sizes.h>
 
-#define CONFIG_POWER_LEGACY
 #define CONFIG_POWER_HI6553
 
 #define CONFIG_REMAKE_ELF
diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
index 30b328a6be6..389322df094 100644
--- a/include/configs/imx8mp_evk.h
+++ b/include/configs/imx8mp_evk.h
@@ -32,8 +32,6 @@
 #undef CONFIG_DM_MMC
 #undef CONFIG_DM_PMIC_PFUZE100
 
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PCA9450
 
 #define CONFIG_SYS_I2C_LEGACY
diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index 758c9ce7f5c..c5f55ac5cc0 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -50,8 +50,6 @@
 
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
 #endif
diff --git a/include/configs/imx8mq_phanbell.h b/include/configs/imx8mq_phanbell.h
index 87e430463cd..add3c23790a 100644
--- a/include/configs/imx8mq_phanbell.h
+++ b/include/configs/imx8mq_phanbell.h
@@ -46,9 +46,6 @@
 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
 
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #endif
 
 #define CONFIG_REMAKE_ELF
diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h
index 1b0cf6de895..e6d97d2a156 100644
--- a/include/configs/ls1046ardb.h
+++ b/include/configs/ls1046ardb.h
@@ -145,10 +145,6 @@
 #define I2C_RETIMER_ADDR			0x18
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#ifdef CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
-#endif
 
 /*
  * Environment
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index f6749568523..a599653969d 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -35,7 +35,6 @@
 #define CONFIG_MXC_UART_BASE	UART1_BASE
 
 /* PMIC Controller */
-#define CONFIG_POWER_LEGACY
 #define CONFIG_POWER_SPI
 #define CONFIG_POWER_FSL
 #define CONFIG_FSL_PMIC_BUS	0
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index a1a7c944a73..24c756261be 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -43,8 +43,6 @@
 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
 
 /* PMIC Controller */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_DIALOG_POWER
 #define CONFIG_POWER_FSL
 #define CONFIG_POWER_FSL_MC13892
diff --git a/include/configs/mx6sabreauto.h b/include/configs/mx6sabreauto.h
index 905f434ab13..28a6b1dfd4c 100644
--- a/include/configs/mx6sabreauto.h
+++ b/include/configs/mx6sabreauto.h
@@ -67,8 +67,6 @@
 /* DMA stuff, needed for GPMI/MXS NAND support */
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 
diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
index 62ddd98bf38..58250049df0 100644
--- a/include/configs/mx6sabresd.h
+++ b/include/configs/mx6sabresd.h
@@ -46,8 +46,6 @@
 #define CONFIG_SYS_I2C_SPEED		  100000
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 
diff --git a/include/configs/novena.h b/include/configs/novena.h
index b2679e9f57d..b976dae1785 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -80,8 +80,6 @@
 #endif
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 
diff --git a/include/configs/phycore_imx8mp.h b/include/configs/phycore_imx8mp.h
index 2821b9a1815..215821114ca 100644
--- a/include/configs/phycore_imx8mp.h
+++ b/include/configs/phycore_imx8mp.h
@@ -29,8 +29,6 @@
 
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PCA9450
 
 #define CONFIG_SYS_I2C_LEGACY
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 73fa6fb1e79..c4a0ba0524b 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -135,8 +135,6 @@
 #define CONFIG_SYS_I2C_SPEED		100000
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE3000
 #define CONFIG_POWER_PFUZE3000_I2C_ADDR	0x08
 
diff --git a/include/configs/pico-imx8mq.h b/include/configs/pico-imx8mq.h
index f43d5c6cfc9..16181119e83 100644
--- a/include/configs/pico-imx8mq.h
+++ b/include/configs/pico-imx8mq.h
@@ -45,9 +45,6 @@
 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
 
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #endif
 
 #define CONFIG_REMAKE_ELF
diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h
index 31e1375a6b5..4985cc50538 100644
--- a/include/configs/tqma6.h
+++ b/include/configs/tqma6.h
@@ -45,8 +45,6 @@
 #define CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_DELAY_MS	20
 
 #if !defined(CONFIG_DM_PMIC)
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 #define TQMA6_PFUZE100_I2C_BUS		2
diff --git a/include/configs/udoo_neo.h b/include/configs/udoo_neo.h
index 4d9c25b073b..409b2ecb6ea 100644
--- a/include/configs/udoo_neo.h
+++ b/include/configs/udoo_neo.h
@@ -77,8 +77,6 @@
 #define CONFIG_SYS_I2C_SPEED		100000
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE3000
 #define CONFIG_POWER_PFUZE3000_I2C_ADDR	0x08
 #define PFUZE3000_I2C_BUS	0
diff --git a/include/configs/vining_2000.h b/include/configs/vining_2000.h
index c4826f4f8e1..b6b0a989244 100644
--- a/include/configs/vining_2000.h
+++ b/include/configs/vining_2000.h
@@ -50,8 +50,6 @@
 #define CONFIG_SYS_I2C_SPEED		  100000
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 
diff --git a/include/configs/warp.h b/include/configs/warp.h
index 172ff44a534..96d2efb88ca 100644
--- a/include/configs/warp.h
+++ b/include/configs/warp.h
@@ -60,8 +60,6 @@
 #define CONFIG_SYS_I2C_SPEED		  100000
 
 /* PMIC */
-#define CONFIG_POWER_LEGACY
-#define CONFIG_POWER_I2C
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"script=boot.scr\0" \
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 28fc98ee845..3ad282dbe42 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1143,8 +1143,6 @@ CONFIG_POST_WATCHDOG
 CONFIG_POWER_FSL
 CONFIG_POWER_FSL_MC13892
 CONFIG_POWER_HI6553
-CONFIG_POWER_I2C
-CONFIG_POWER_LEGACY
 CONFIG_POWER_LTC3676
 CONFIG_POWER_LTC3676_I2C_ADDR
 CONFIG_POWER_MAX77696_I2C_ADDR
-- 
2.32.0.605.g8dce9f2422-goog



More information about the U-Boot mailing list