summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-01-18 10:07:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-01-19 07:47:50 +0100
commit98a65c0d6af8d410c2af35f5923c62c2ffa20a81 (patch)
treeffae954facf90cfb9f8a683bb67a441a158d8c5f
parent2a248e60d261fd7c98beb33e1d0f26c33b1753b2 (diff)
downloadbarebox-98a65c0d6af8.tar.gz
barebox-98a65c0d6af8.tar.xz
clk: make COMMON_CLK a visible symbol
So far, we expected platforms to select COMMON_CLK if they have a clock controller that's covered by the common clk framework and HAVE_CLK if they have a legacy clock driver. With the addition of SCMI clocks, platforms, especially virtualized ones, that previously didn't need clock support may now want access to them. Instead of having to select COMMON_CLK from such platforms on the off-chance that SCMI clocks may need to be used, just make COMMON_CLK user visible, so it can be selected as needed. As COMMON_CLK needs to conflict with legacy clock support, we also add a symbol for that and start selecting it where appropriate, Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240118090718.1314156-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/Kconfig5
-rw-r--r--arch/arm/mach-at91/Kconfig4
-rw-r--r--arch/arm/mach-at91/Makefile4
-rw-r--r--drivers/clk/Kconfig21
4 files changed, 26 insertions, 8 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ee3914620e..5d58dfc86e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -133,7 +133,7 @@ config ARCH_NOMADIK
depends on 32BIT
select CPU_ARM926T
select CLOCKSOURCE_NOMADIK
- select HAVE_CLK
+ select HAVE_LEGACY_CLK
help
Support for the Nomadik platform by ST-Ericsson
@@ -242,7 +242,6 @@ config ARCH_K3
select CLKDEV_LOOKUP
select HAVE_PBL_MULTI_IMAGES
select HAS_DEBUG_LL
- select HAVE_CLK
select COMMON_CLK_OF_PROVIDER
select PM_GENERIC_DOMAINS
@@ -279,7 +278,6 @@ config ARCH_STM32MP
select COMMON_CLK
select COMMON_CLK_OF_PROVIDER
select HAS_DEBUG_LL
- select HAVE_CLK
select GPIOLIB
select ARCH_HAS_RESET_CONTROLLER
select ARM_AMBA
@@ -292,7 +290,6 @@ config ARCH_VERSATILE
select GPIOLIB
select ARM_AMBA
select AMBA_SP804
- select HAVE_CLK
select HAS_DEBUG_LL
select COMMON_CLK
select COMMON_CLK_OF_PROVIDER
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 94e8e525a2..1049eb6957 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -20,6 +20,10 @@ config MACH_AT91SAM9263EK_DT
Enabled for at91sam9263ek - evaluation kit.
But only if we need the device tree (bootstrap do not use DT)
+config HAVE_AT91_LEGACY_CLK
+ def_bool !COMMON_CLK_OF_PROVIDER
+ select HAVE_LEGACY_CLK
+
config HAVE_AT91_SMD
bool
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index c453295955..7d7f27749f 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -4,9 +4,7 @@ obj-y += setup.o aic.o
lwl-y += at91_pmc_ll.o ddramc_ll.o at91sam9_sdramc_ll.o matrix.o
lwl-$(CONFIG_CLOCKSOURCE_ATMEL_PIT) += early_udelay.o
-ifeq ($(CONFIG_COMMON_CLK_OF_PROVIDER),)
-obj-y += clock.o
-endif
+obj-$(CONFIG_HAVE_AT91_LEGACY_CLK) += clock.o
obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 3e032469d0..685b34565d 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -1,13 +1,32 @@
# SPDX-License-Identifier: GPL-2.0-only
config HAVE_CLK
bool
+ help
+ The <linux/clk.h> calls support software clock gating and
+ thus are a key power management tool on many systems.
+
+config HAVE_LEGACY_CLK
+ select HAVE_CLK
+ bool
+ help
+ Select this option when the clock API in <linux/clk.h> is implemented
+ by platform/architecture code. This method is deprecated. Modern
+ code should select COMMON_CLK instead and not define a custom
+ 'struct clk'.
config CLKDEV_LOOKUP
bool
config COMMON_CLK
+ bool "Common Clock Framework"
+ depends on !HAVE_LEGACY_CLK
select HAVE_CLK
- bool
+ help
+ The common clock framework is a single definition of struct
+ clk, useful across many platforms, as well as an
+ implementation of the clock API in include/linux/clk.h.
+ Architectures utilizing the common struct clk should select
+ this option.
config COMMON_CLK_OF_PROVIDER
bool