Skip to contentSkip to conversation

clk: mmp: allow COMPILE_TEST builds

PATCH Applied Rosen Penev 3 participants 5 messages Jul 19 – Sep 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: mmp: allow COMPILE_TEST builds

The MMP clock directory is only entered for ARCH_MMP, even though the PXA1908 and MMP2 audio clock symbols can already be selected for COMPILE_TEST.

Add a hidden MMP clock family gate, select it from the compile-testable MMP clock symbols, and use that symbol for the parent Makefile descent. Keep ARCH_MMP as the default provider for existing platform builds.

Tested with:
make LLVM=1 ARCH=loongarch drivers/clk/mmp/

Assisted-by Codex:GPT-5.5
---
 drivers/clk/Kconfig     | 2 ++
 drivers/clk/Makefile    | 2 +-
 drivers/clk/mmp/Kconfig | 5 +++++
 3 files changed, 8 insertions(+), 1 deletion(-)
drivers/clk/Kconfig +2 -0
index 16191b297150..cb69872401fd 100644
@@ -457,12 +457,14 @@ config COMMON_CLK_STM32H7
 
 config COMMON_CLK_MMP2
 	def_bool COMMON_CLK && (MACH_MMP2_DT || MACH_MMP3_DT)
+	select COMMON_CLK_MMP
 	help
 	  Support for Marvell MMP2 and MMP3 SoC clocks
 
 config COMMON_CLK_MMP2_AUDIO
         tristate "Clock driver for MMP2 Audio subsystem"
         depends on COMMON_CLK_MMP2 || COMPILE_TEST
+        select COMMON_CLK_MMP
         help
           This driver supports clocks for Audio subsystem on MMP2 SoC.
 
drivers/clk/Makefile +1 -1
index 4b2c089f46a1..8383f9f1da51 100644
@@ -130,7 +130,7 @@ obj-y					+= mediatek/
 obj-$(CONFIG_ARCH_MESON)		+= meson/
 obj-y					+= microchip/
 ifeq ($(CONFIG_COMMON_CLK), y)
-obj-$(CONFIG_ARCH_MMP)			+= mmp/
+obj-$(CONFIG_COMMON_CLK_MMP)		+= mmp/
 endif
 obj-y					+= mstar/
 obj-y					+= mvebu/
drivers/clk/mmp/Kconfig +5 -0
index b0d2fea3cda5..35a069034b28 100644
@@ -1,10 +1,15 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
+config COMMON_CLK_MMP
+	bool
+	default ARCH_MMP
+
 config COMMON_CLK_PXA1908
 	bool "Clock driver for Marvell PXA1908"
 	depends on ARCH_MMP || COMPILE_TEST
 	depends on OF
 	default y if ARCH_MMP && ARM64
+	select COMMON_CLK_MMP
 	select AUXILIARY_BUS
 	help
 	  This driver supports the Marvell PXA1908 SoC clocks.
Signature · 1 line
2.55.0
#1 lore raw

On Sunday, 19 July 2026 23:43:49 Central European Summer Time Rosen Penev wrote:

[...]

drivers/clk/Makefile obj-y +=

Quoted 5 lines
drivers/clk/Makefile +0 -0
index 4b2c089f46a1..8383f9f1da51 100644
@@ -130,7 +130,7 @@ obj-y					+= 

mediatek/

drivers/clk/Makefile obj-y += mediatek/ · line 133

Quoted 5 lines
drivers/clk/Makefile +1 -1
 obj-$(CONFIG_ARCH_MESON)		+= meson/
 obj-y					+= microchip/
 ifeq ($(CONFIG_COMMON_CLK), y)
-obj-$(CONFIG_ARCH_MMP)			+= mmp/
+obj-$(CONFIG_COMMON_CLK_MMP)		+= mmp/

Could it be possible to select mmp unconditionally, like most of the other subtrees are? AFAICT, that would also require creating new Kconfig symbols for the PXA168, PXA910 and PXA1928 clocks, but I suspect it may be the more proper choice in the long term.

Regards,
--
Duje

#2 lore raw

Hi Duje,

Quoted 11 lines · Duje Mihanović

On Sunday, 19 July 2026 23:43:49 Central European Summer Time Rosen Penev wrote:

[...]

drivers/clk/Makefile obj-y +=

Quoted 5 lines
drivers/clk/Makefile +0 -0
index 4b2c089f46a1..8383f9f1da51 100644
@@ -130,7 +130,7 @@ obj-y					+= 

mediatek/

Quoted 10 lines

drivers/clk/Makefile obj-y += mediatek/ · line 133

Quoted 5 lines
drivers/clk/Makefile +1 -1
 obj-$(CONFIG_ARCH_MESON)		+= meson/
 obj-y					+= microchip/
 ifeq ($(CONFIG_COMMON_CLK), y)
-obj-$(CONFIG_ARCH_MMP)			+= mmp/
+obj-$(CONFIG_COMMON_CLK_MMP)		+= mmp/

Could it be possible to select mmp unconditionally, like most of the other subtrees are? AFAICT, that would also require creating new Kconfig symbols for the PXA168, PXA910 and PXA1928 clocks, but I suspect it may be the more proper choice in the long term.

Just by sheer numbers, the CONFIG_COMMON_CLK_XXX approach is the most common use case right now.

    x1:~/src/linux/linux-next ((next-20260720) %)$ grep "CONFIG_COMMON_CLK" drivers/clk/Makefile | grep "+=" | wc -l
    68
    x1:~/src/linux/linux-next ((next-20260720) %)$ grep "obj-y" drivers/clk/Makefile | wc -l
    25

I have no strong opinions about this either way other than to drive consistency across various drivers as much as possible.

Currently the mmp directory currently only has COMMON_CLK_PXA1908 defined. When the other PXA* drivers are introduced, will there be a CONFIG_COMMON_CLK_MMA_COMMON that all of the drivers will use?

If so, we could put that MMA_COMMON in the toplevel clk Makefile.

If not, then yes I agree that obj-y will be fine.

Brian

#3 lore raw
Quoted 26 lines · Brian Masney

Hi Duje,

Quoted 11 lines · Duje Mihanović

On Sunday, 19 July 2026 23:43:49 Central European Summer Time Rosen Penev wrote:

[...]

drivers/clk/Makefile obj-y +=

Quoted 5 lines
drivers/clk/Makefile +0 -0
index 4b2c089f46a1..8383f9f1da51 100644
@@ -130,7 +130,7 @@ obj-y                                   +=

mediatek/

Quoted 10 lines

drivers/clk/Makefile obj-y += mediatek/ · line 133

Quoted 5 lines
drivers/clk/Makefile +1 -1
 obj-$(CONFIG_ARCH_MESON)           += meson/
 obj-y                                      += microchip/
 ifeq ($(CONFIG_COMMON_CLK), y)
-obj-$(CONFIG_ARCH_MMP)                     += mmp/
+obj-$(CONFIG_COMMON_CLK_MMP)               += mmp/

Could it be possible to select mmp unconditionally, like most of the other subtrees are? AFAICT, that would also require creating new Kconfig symbols for the PXA168, PXA910 and PXA1928 clocks, but I suspect it may be the more proper choice in the long term.

Quoted 2 lines

Just by sheer numbers, the CONFIG_COMMON_CLK_XXX approach is the most common use case right now.

It's much simpler this way.

Quoted 19 lines
    x1:~/src/linux/linux-next ((next-20260720) %)$ grep "CONFIG_COMMON_CLK" drivers/clk/Makefile | grep "+=" | wc -l
    68
    x1:~/src/linux/linux-next ((next-20260720) %)$ grep "obj-y" drivers/clk/Makefile | wc -l
    25

I have no strong opinions about this either way other than to drive consistency across various drivers as much as possible.

Currently the mmp directory currently only has COMMON_CLK_PXA1908 defined. When the other PXA* drivers are introduced, will there be a CONFIG_COMMON_CLK_MMA_COMMON that all of the drivers will use?

If so, we could put that MMA_COMMON in the toplevel clk Makefile.

If not, then yes I agree that obj-y will be fine.

Brian

Applied
#4 lore raw
In reply to Rosen Penev
Quoted 1 line · Rosen Penev

clk: mmp: allow COMPILE_TEST builds

Applied, thanks!

[1/1] clk: mmp: allow COMPILE_TEST builds

      commit: d0b72c88671b3c46342bbebc9b90280890436c98

Best regards,

Signature · 1 line
Brian Masney <[email protected]>