]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clocksource: move NXP timer selection to drivers/clocksource
authorEnric Balletbo i Serra <eballetb@redhat.com>
Thu, 14 May 2026 11:14:17 +0000 (13:14 +0200)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Wed, 10 Jun 2026 05:26:07 +0000 (07:26 +0200)
The Kconfig logic for selecting the scheduler clocksource on
NXP Vybrid (VF610) uses a `choice` block restricted to 32-bit ARM. This
prevents 64-bit architectures, such as the NXP S32 family, from enabling
the NXP Periodic Interrupt Timer (PIT) driver (CONFIG_NXP_PIT_TIMER).

Relocate the NXP clocksource selection from arch/arm/mach-imx/Kconfig to
drivers/clocksource/Kconfig. This allows the configuration to be shared
across different architectures.

Update the selection to include support for ARCH_S32 and add a "None"
option restricted to ARCH_S32, since Vybrid lacks the ARM Architected
Timer. The Vybrid Global Timer option is restricted to ARCH_MULTI_V7
SOC_VF610 platforms to prevent it from being visible on Cortex-M4 builds,
which lack the ARM Global Timer hardware.

Fixes: bee33f22d7c3 ("clocksource/drivers/nxp-pit: Add NXP Automotive s32g2 / s32g3 support")
Signed-off-by: Enric Balletbo i Serra <eballetb@redhat.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260514-fix-nxp-timer-v3-1-a3e68fdb505e@redhat.com
arch/arm/mach-imx/Kconfig
drivers/clocksource/Kconfig

index 6ea1bd55acf8de30ce300f906924a12c27baa169..a361840d7a047863af85205161aa5bd30f335ab2 100644 (file)
@@ -227,27 +227,6 @@ config SOC_VF610
        help
          This enables support for Freescale Vybrid VF610 processor.
 
-choice
-       prompt "Clocksource for scheduler clock"
-       depends on SOC_VF610
-       default VF_USE_ARM_GLOBAL_TIMER
-
-       config VF_USE_ARM_GLOBAL_TIMER
-               bool "Use ARM Global Timer"
-               depends on ARCH_MULTI_V7
-               select ARM_GLOBAL_TIMER
-               select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
-               help
-                 Use the ARM Global Timer as clocksource
-
-       config VF_USE_PIT_TIMER
-               bool "Use PIT timer"
-               select NXP_PIT_TIMER
-               help
-                 Use SoC Periodic Interrupt Timer (PIT) as clocksource
-
-endchoice
-
 endif
 
 endif
index d1a33a231a44c381c9aef9cd01605c4ed71f6535..d9c76dd443f8ace3a51e4924a43aaad4c3516b8e 100644 (file)
@@ -793,4 +793,35 @@ config RTK_SYSTIMER
          this option only when building for a Realtek platform or for compilation
          testing.
 
+choice
+       prompt "NXP clocksource for scheduler clock"
+       depends on SOC_VF610 || ARCH_S32
+       # Default to Global Timer for Vybrid (32-bit)
+       default VF_USE_ARM_GLOBAL_TIMER if SOC_VF610
+       # Default to None for S32 (64-bit)
+       default VF_TIMER_NONE if ARCH_S32
+
+       config VF_USE_ARM_GLOBAL_TIMER
+               bool "Use NXP Vybrid Global Timer"
+               depends on ARCH_MULTI_V7 && SOC_VF610
+               select ARM_GLOBAL_TIMER
+               select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
+               help
+                 Use the NXP Vybrid Global Timer as clocksource.
+
+       config VF_USE_PIT_TIMER
+               bool "Use NXP PIT timer"
+               select NXP_PIT_TIMER
+               help
+                 Use NXP Periodic Interrupt Timer (PIT) as clocksource.
+
+       config VF_TIMER_NONE
+               bool "None (Use standard Arch Timer)"
+               depends on ARCH_S32
+               help
+                 Do not use any specific NXP timer driver. Use the standard
+                 ARM Architected Timer instead.
+
+endchoice
+
 endmenu