diff mbox series

[08/13] m68k: m68328: use legacy_timer_tick()

Message ID 20201008154651.1901126-9-arnd@arndb.de (mailing list archive)
State New, archived
Headers show
Series Clean up legacy clock tick users | expand

Commit Message

Arnd Bergmann Oct. 8, 2020, 3:46 p.m. UTC
A couple of machines share the m68328 timer code that
is based on calling timer_interrupt(). Change these
to the new and slightly more generic legacy_timer_tick()
helper.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/m68k/68000/timers.c  | 5 ++---
 arch/m68k/Kconfig.machine | 4 ++++
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Geert Uytterhoeven Oct. 12, 2020, 1:15 p.m. UTC | #1
Hi Arnd,

On Thu, Oct 8, 2020 at 5:48 PM Arnd Bergmann <arnd@arndb.de> wrote:
> A couple of machines share the m68328 timer code that
> is based on calling timer_interrupt(). Change these
> to the new and slightly more generic legacy_timer_tick()
> helper.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for your patch!

> --- a/arch/m68k/Kconfig.machine
> +++ b/arch/m68k/Kconfig.machine
> @@ -146,6 +146,7 @@ config PILOT
>  config PILOT3
>         bool "Pilot 1000/5000, PalmPilot Personal/Pro, or PalmIII support"
>         depends on M68328
> +       select LEGACY_TIMER_TICK
>         select PILOT
>         help
>           Support for the Palm Pilot 1000/5000, Personal/Pro and PalmIII.
> @@ -159,18 +160,21 @@ config XCOPILOT_BUGS
>  config UCSIMM
>         bool "uCsimm module support"
>         depends on M68EZ328
> +       select LEGACY_TIMER_TICK
>         help
>           Support for the Arcturus Networks uCsimm module.
>
>  config UCDIMM
>         bool "uDsimm module support"
>         depends on M68VZ328
> +       select LEGACY_TIMER_TICK
>         help
>           Support for the Arcturus Networks uDsimm module.
>
>  config DRAGEN2
>         bool "DragenEngine II board support"
>         depends on M68VZ328
> +       select LEGACY_TIMER_TICK
>         help
>           Support for the DragenEngine II board.

Given this feature is SoC-specific, not platform-specific, perhaps
it makes sense to move the selects to the M68{,EZ,VZ}328 symbols?

Regardless:
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Arnd Bergmann Oct. 12, 2020, 3:30 p.m. UTC | #2
On Mon, Oct 12, 2020 at 3:15 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Given this feature is SoC-specific, not platform-specific, perhaps
> it makes sense to move the selects to the M68{,EZ,VZ}328 symbols?
>
> Regardless:
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Ok, folded in the change blow, using one less line. I couldn't figure
out whether
it should just be part of the CONFIG_M68000 instead, which doesn't appear
to have any machine support by itself. The dragonball CPU configuration
looks really odd, because you have to build exactly one of M68{,EZ,VZ}328
into the kernel to get a successful compilation, while Kconfig allows
many other combinations.

     Arnd

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 322a35ef14c6..648054d4f860 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -104,6 +104,7 @@ config M68060
 config M68328
        bool "MC68328"
        depends on !MMU
+       select LEGACY_TIMER_TICK
        select M68000
        help
          Motorola 68328 processor support.
@@ -111,6 +112,7 @@ config M68328
 config M68EZ328
        bool "MC68EZ328"
        depends on !MMU
+       select LEGACY_TIMER_TICK
        select M68000
        help
          Motorola 68EX328 processor support.
@@ -118,6 +120,7 @@ config M68EZ328
 config M68VZ328
        bool "MC68VZ328"
        depends on !MMU
+       select LEGACY_TIMER_TICK
        select M68000
        help
          Motorola 68VZ328 processor support.
diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index 0ff9338b958e..e3c835440d9a 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -146,7 +146,6 @@ config PILOT
 config PILOT3
        bool "Pilot 1000/5000, PalmPilot Personal/Pro, or PalmIII support"
        depends on M68328
-       select LEGACY_TIMER_TICK
        select PILOT
        help
          Support for the Palm Pilot 1000/5000, Personal/Pro and PalmIII.
@@ -160,21 +159,18 @@ config XCOPILOT_BUGS
 config UCSIMM
        bool "uCsimm module support"
        depends on M68EZ328
-       select LEGACY_TIMER_TICK
        help
          Support for the Arcturus Networks uCsimm module.

 config UCDIMM
        bool "uDsimm module support"
        depends on M68VZ328
-       select LEGACY_TIMER_TICK
        help
          Support for the Arcturus Networks uDsimm module.

 config DRAGEN2
        bool "DragenEngine II board support"
        depends on M68VZ328
-       select LEGACY_TIMER_TICK
        help
          Support for the DragenEngine II board.
Geert Uytterhoeven Oct. 12, 2020, 8:33 p.m. UTC | #3
Hi Arnd,

On Mon, Oct 12, 2020 at 5:31 PM Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, Oct 12, 2020 at 3:15 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > Given this feature is SoC-specific, not platform-specific, perhaps
> > it makes sense to move the selects to the M68{,EZ,VZ}328 symbols?
> >
> > Regardless:
> > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> Ok, folded in the change blow, using one less line. I couldn't figure

Thanks, looks good.

> out whether
> it should just be part of the CONFIG_M68000 instead, which doesn't appear

It must definitely not be selected by CONFIG_M68000, as the plain MC68000
is a CPU, not an SoC, and does not have the timer.

> to have any machine support by itself. The dragonball CPU configuration
> looks really odd, because you have to build exactly one of M68{,EZ,VZ}328
> into the kernel to get a successful compilation, while Kconfig allows
> many other combinations.

While CONFIG_M68000 could be used for a "pure" MC68000-based machine,
I believe we don't support any yet.
M68{,EZ,VZ}328 select M68000 as they are SoCs containing a 68000
CPU core.
Other m68k SoCs have a CPU32 core, which is a simplified 68020 CPU core
(hmm, what happened to 68360 support? Oh, removed in 2016, so nothing
selects CPU32 anymore).

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/arch/m68k/68000/timers.c b/arch/m68k/68000/timers.c
index e8dfdd2556a5..3aa006f8e7ea 100644
--- a/arch/m68k/68000/timers.c
+++ b/arch/m68k/68000/timers.c
@@ -52,7 +52,6 @@ 
 #endif
 
 static u32 m68328_tick_cnt;
-static irq_handler_t timer_interrupt;
 
 /***************************************************************************/
 
@@ -62,7 +61,8 @@  static irqreturn_t hw_tick(int irq, void *dummy)
 	TSTAT &= 0;
 
 	m68328_tick_cnt += TICKS_PER_JIFFY;
-	return timer_interrupt(irq, dummy);
+	legacy_timer_tick(1);
+	return IRQ_HANDLED;
 }
 
 /***************************************************************************/
@@ -113,7 +113,6 @@  void hw_timer_init(irq_handler_t handler)
 	/* Enable timer 1 */
 	TCTL |= TCTL_TEN;
 	clocksource_register_hz(&m68328_clk, TICKS_PER_JIFFY*HZ);
-	timer_interrupt = handler;
 }
 
 /***************************************************************************/
diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index e3c835440d9a..0ff9338b958e 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -146,6 +146,7 @@  config PILOT
 config PILOT3
 	bool "Pilot 1000/5000, PalmPilot Personal/Pro, or PalmIII support"
 	depends on M68328
+	select LEGACY_TIMER_TICK
 	select PILOT
 	help
 	  Support for the Palm Pilot 1000/5000, Personal/Pro and PalmIII.
@@ -159,18 +160,21 @@  config XCOPILOT_BUGS
 config UCSIMM
 	bool "uCsimm module support"
 	depends on M68EZ328
+	select LEGACY_TIMER_TICK
 	help
 	  Support for the Arcturus Networks uCsimm module.
 
 config UCDIMM
 	bool "uDsimm module support"
 	depends on M68VZ328
+	select LEGACY_TIMER_TICK
 	help
 	  Support for the Arcturus Networks uDsimm module.
 
 config DRAGEN2
 	bool "DragenEngine II board support"
 	depends on M68VZ328
+	select LEGACY_TIMER_TICK
 	help
 	  Support for the DragenEngine II board.