[PATCH 21/23] power: Refactor Makefile rules
Jaehoon Chung
jh80.chung at samsung.com
Fri Aug 13 00:21:33 CEST 2021
On 8/9/21 3:20 AM, Simon Glass wrote:
> 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 at chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung at samsung.com>
Best Regars,
Jaehoon Chung
> ---
>
> Makefile | 7 -------
> common/spl/Kconfig | 13 +++++++++++++
> configs/chromebook_coral_defconfig | 2 ++
> drivers/Makefile | 5 +----
> drivers/power/Makefile | 8 ++++++++
> drivers/power/acpi_pmc/Makefile | 2 +-
> 6 files changed, 25 insertions(+), 12 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index cc51265f1fc..c744ff8ee4e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -815,13 +815,6 @@ libs-y += disk/
> libs-y += drivers/
> libs-y += drivers/net/
> libs-y += drivers/net/phy/
> -libs-y += drivers/power/ \
> - drivers/power/domain/ \
> - drivers/power/fuel_gauge/ \
> - drivers/power/mfd/ \
> - drivers/power/pmic/ \
> - drivers/power/battery/ \
> - drivers/power/regulator/
> libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
> libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
> libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 1ce74d07618..59672d2fdd3 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -1042,6 +1042,7 @@ config SPL_POWER
>
> 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
> @@ -1431,6 +1432,18 @@ config TPL_NEEDS_SEPARATE_STACK
> 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
> diff --git a/configs/chromebook_coral_defconfig b/configs/chromebook_coral_defconfig
> index eb0884f1f5d..321ad7de5b7 100644
> --- a/configs/chromebook_coral_defconfig
> +++ b/configs/chromebook_coral_defconfig
> @@ -44,7 +44,9 @@ CONFIG_SPL_SEPARATE_BSS=y
> CONFIG_SPL_CPU=y
> CONFIG_SPL_DM_SPI_FLASH=y
> CONFIG_SPL_PCI=y
> +CONFIG_SPL_POWER=y
> # CONFIG_SPL_SPI_FLASH_TINY is not set
> +CONFIG_TPL_POWER=y
> CONFIG_HUSH_PARSER=y
> CONFIG_CMD_CPU=y
> CONFIG_CMD_PMC=y
> diff --git a/drivers/Makefile b/drivers/Makefile
> index d63cc48f5f4..c256cd97210 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -22,6 +22,7 @@ obj-$(CONFIG_$(SPL_TPL_)PCH) += pch/
> obj-$(CONFIG_$(SPL_TPL_)PCI) += pci/
> obj-$(CONFIG_$(SPL_TPL_)PHY) += phy/
> obj-$(CONFIG_$(SPL_TPL_)PINCTRL) += pinctrl/
> +obj-$(CONFIG_$(SPL_TPL_)POWER) += power/
> obj-$(CONFIG_$(SPL_TPL_)RAM) += ram/
> obj-$(CONFIG_$(SPL_TPL_)RTC) += rtc/
> obj-$(CONFIG_$(SPL_TPL_)SERIAL) += serial/
> @@ -32,7 +33,6 @@ obj-$(CONFIG_$(SPL_)DM_MAILBOX) += mailbox/
> obj-$(CONFIG_$(SPL_)REMOTEPROC) += remoteproc/
> obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/
> obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
> -obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += power/acpi_pmc/
> obj-$(CONFIG_XEN) += xen/
> obj-$(CONFIG_$(SPL_)FPGA) += fpga/
>
> @@ -46,9 +46,6 @@ obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> obj-$(CONFIG_ARMADA_XP) += ddr/marvell/axp/
> obj-$(CONFIG_$(SPL_)ALTERA_SDRAM) += ddr/altera/
> obj-$(CONFIG_ARCH_IMX8M) += ddr/imx/imx8m/
> -obj-$(CONFIG_SPL_POWER) += power/ power/pmic/
> -obj-$(CONFIG_SPL_POWER) += power/regulator/
> -obj-$(CONFIG_SPL_POWER_DOMAIN) += power/domain/
> obj-$(CONFIG_SPL_DM_RESET) += reset/
> obj-$(CONFIG_SPL_ETH) += net/
> obj-$(CONFIG_SPL_ETH) += net/phy/
> diff --git a/drivers/power/Makefile b/drivers/power/Makefile
> index 09fe2a958d0..5c6d6bc3ec9 100644
> --- a/drivers/power/Makefile
> +++ b/drivers/power/Makefile
> @@ -3,6 +3,14 @@
> # Copyright (c) 2009 Wind River Systems, Inc.
> # Tom Rix <Tom.Rix at windriver.com>
>
> +obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += acpi_pmc/
> +obj-y += battery/
> +obj-$(CONFIG_$(SPL_TPL_)POWER_DOMAIN) += domain/
> +obj-y += fuel_gauge/
> +obj-y += mfd/
> +obj-y += pmic/
> +obj-y += regulator/
> +
> obj-$(CONFIG_AXP152_POWER) += axp152.o
> obj-$(CONFIG_AXP209_POWER) += axp209.o
> obj-$(CONFIG_AXP221_POWER) += axp221.o
> diff --git a/drivers/power/acpi_pmc/Makefile b/drivers/power/acpi_pmc/Makefile
> index 115788f109a..0db52a65824 100644
> --- a/drivers/power/acpi_pmc/Makefile
> +++ b/drivers/power/acpi_pmc/Makefile
> @@ -2,5 +2,5 @@
> #
> # Copyright 2019 Google LLC
>
> -obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += acpi-pmc-uclass.o
> +obj-y += acpi-pmc-uclass.o
> obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC_SANDBOX) += sandbox.o pmc_emul.o
>
More information about the U-Boot
mailing list