Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Enric Balletbo i Serra <eballetb@redhat.com>,
	Thomas Gleixner <tglx@kernel.org>
Cc: Enric Balletbo i Serra <eballetbo@kernel.org>,
	Russell King <linux@armlinux.org.uk>, Frank Li <Frank.Li@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] clocksource: move NXP timer selection to drivers/clocksource
Date: Tue, 9 Jun 2026 09:45:50 -0500	[thread overview]
Message-ID: <aignHiLu4wbh86Ut@SMW015318> (raw)
In-Reply-To: <CALE0LRtJemHQj7o8iV1GaWJLVfTse6fp-TFvodC=AeWov6s39w@mail.gmail.com>

On Tue, Jun 09, 2026 at 08:57:59AM +0200, Enric Balletbo i Serra wrote:
> Hi all,
>
> On Thu, May 14, 2026 at 1:14 PM Enric Balletbo i Serra
> <eballetbo@kernel.org> wrote:
> >
> > From: Enric Balletbo i Serra <eballetb@redhat.com>
> >
> > 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")
> > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > Signed-off-by: Enric Balletbo i Serra <eballetb@redhat.com>
>
> Now that Frank [1] has created a merge request for Linux 7.1-rc1 and
> the request includes

Thomas:
	It touch drivers/clocksource, Is it okay go through Soc tree Or you
can help take care this one?

Frank


>
>       arm64: dts: s32g: add PIT support for s32g2 and s32g3
>
> If this patch is ok, would it make sense to pick that patch?
> Otherwise, we won't be able to select the PIT timer for aarch64 only
> builds.
>
> Thanks.,
>   Enric
>
> [1] From: Frank.Li@nxp.com
>
> The following changes since commit 254f49634ee16a731174d2ae34bc50bd5f45e731:
>
>   Linux 7.1-rc1 (2026-04-26 14:19:00 -0700)
>
> are available in the Git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/frank.li/linux.git
> tags/imx-dt64-7.2
>
> for you to fetch changes up to c10cfc952215644956284a42fa7b7860dfbcb5f5:
>
>
>
> > ---
> > Changes in v3:
> > - Restrict VF_TIMER_NONE to ARCH_S32 to prevent selecting it on Vybrid
> >   platforms which lack the ARM Architected Timer
> > - Link to v2: https://lore.kernel.org/r/20260513-fix-nxp-timer-v2-1-533b99c57b67@redhat.com
> >
> > Changes in v2:
> > - Fix VF_USE_ARM_GLOBAL_TIMER dependency: use ARCH_MULTI_V7 instead of
> >   ARM to prevent the option from being visible on Cortex-M4 builds
> >   (Sashiko AI review)
> > - Link to v1: https://lore.kernel.org/r/20260302-fix-nxp-timer-v1-1-af4bc62d4ffa@redhat.com
> > ---
> >  arch/arm/mach-imx/Kconfig   | 21 ---------------------
> >  drivers/clocksource/Kconfig | 31 +++++++++++++++++++++++++++++++
> >  2 files changed, 31 insertions(+), 21 deletions(-)
> >
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index 6ea1bd55acf8..a361840d7a04 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -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
> > diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> > index d1a33a231a44..d9c76dd443f8 100644
> > --- a/drivers/clocksource/Kconfig
> > +++ b/drivers/clocksource/Kconfig
> > @@ -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
> >
> > ---
> > base-commit: 7fd2df204f342fc17d1a0bfcd474b24232fb0f32
> > change-id: 20260302-fix-nxp-timer-9cb1fbd7afcd
> >
> > Best regards,
> > --
> > Enric Balletbo i Serra <eballetb@redhat.com>
> >
>
>


      reply	other threads:[~2026-06-09 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 11:14 [PATCH v3] clocksource: move NXP timer selection to drivers/clocksource Enric Balletbo i Serra
2026-06-09  6:57 ` Enric Balletbo i Serra
2026-06-09 14:45   ` Frank Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aignHiLu4wbh86Ut@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=eballetb@redhat.com \
    --cc=eballetbo@kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=s.hauer@pengutronix.de \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox