linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure
@ 2022-08-26  4:03 Greg Ungerer
  2022-08-26  4:03 ` [PATCH 2/3] m68knommu: fix non-mmu classic 68000 legacy timer tick selection Greg Ungerer
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Greg Ungerer @ 2022-08-26  4:03 UTC (permalink / raw)
  To: linux-m68k; +Cc: Greg Ungerer, kernel test robot

Compiling for a classic m68k non-MMU target with no specific CPU
selected fails with the following error:

   arch/m68k/68000/ints.c: In function 'process_int':
>> arch/m68k/68000/ints.c:82:30: error: 'ISR' undeclared (first use in this function)
      82 |         unsigned long pend = ISR;
         |                              ^~~

This interrupt handling code is specific to the 68328 family of 68000
parts. There is a couple of variants (68EZ328, 68VZ328) and the common
ancestor of them the strait 68328.

The code here includes a specific header for each variant type. But if
none is selected then nothing is included to supply the appropriate
register and bit flags defines.

Rearrange the includes so that at least one type is always included.
At the very least the 68328 base type should be the fallback, so make
that true.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/68000/ints.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/68000/ints.c b/arch/m68k/68000/ints.c
index cda49b12d7be..f9a5ec781408 100644
--- a/arch/m68k/68000/ints.c
+++ b/arch/m68k/68000/ints.c
@@ -18,12 +18,12 @@
 #include <asm/io.h>
 #include <asm/machdep.h>
 
-#if defined(CONFIG_M68328)
-#include <asm/MC68328.h>
-#elif defined(CONFIG_M68EZ328)
+#if defined(CONFIG_M68EZ328)
 #include <asm/MC68EZ328.h>
 #elif defined(CONFIG_M68VZ328)
 #include <asm/MC68VZ328.h>
+#else
+#include <asm/MC68328.h>
 #endif
 
 /* assembler routines */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] m68knommu: fix non-mmu classic 68000 legacy timer tick selection
  2022-08-26  4:03 [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure Greg Ungerer
@ 2022-08-26  4:03 ` Greg Ungerer
  2022-08-26  7:39   ` Geert Uytterhoeven
  2022-08-26  4:03 ` [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs Greg Ungerer
  2022-08-26  7:38 ` [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure Geert Uytterhoeven
  2 siblings, 1 reply; 8+ messages in thread
From: Greg Ungerer @ 2022-08-26  4:03 UTC (permalink / raw)
  To: linux-m68k; +Cc: Greg Ungerer

The family of classic 68000 parts supported when in non-mmu mode all
currently use the legacy timer support. Move the selection of that config
option, LEGACY_TIMER_TICK, into the core CPU configuration.

This fixes compilation if no specific CPU variant is selected, since
the LEGACY_TIMER_TICK option was only selected in the specific CPU
variant configurations.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/Kconfig.cpu | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index e0e9e31339c1..b0504b13b089 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -46,6 +46,7 @@ config M68000
 	select GENERIC_CSUM
 	select CPU_NO_EFFICIENT_FFS
 	select HAVE_ARCH_HASH
+	select LEGACY_TIMER_TICK
 	help
 	  The Freescale (was Motorola) 68000 CPU is the first generation of
 	  the well known M68K family of processors. The CPU core as well as
@@ -97,7 +98,6 @@ config M68060
 config M68328
 	bool
 	depends on !MMU
-	select LEGACY_TIMER_TICK
 	select M68000
 	help
 	  Motorola 68328 processor support.
@@ -105,7 +105,6 @@ config M68328
 config M68EZ328
 	bool
 	depends on !MMU
-	select LEGACY_TIMER_TICK
 	select M68000
 	help
 	  Motorola 68EX328 processor support.
@@ -113,7 +112,6 @@ config M68EZ328
 config M68VZ328
 	bool
 	depends on !MMU
-	select LEGACY_TIMER_TICK
 	select M68000
 	help
 	  Motorola 68VZ328 processor support.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs
  2022-08-26  4:03 [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure Greg Ungerer
  2022-08-26  4:03 ` [PATCH 2/3] m68knommu: fix non-mmu classic 68000 legacy timer tick selection Greg Ungerer
@ 2022-08-26  4:03 ` Greg Ungerer
  2022-08-26  7:44   ` Geert Uytterhoeven
  2022-08-26  7:38 ` [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure Geert Uytterhoeven
  2 siblings, 1 reply; 8+ messages in thread
From: Greg Ungerer @ 2022-08-26  4:03 UTC (permalink / raw)
  To: linux-m68k; +Cc: Greg Ungerer

The configuration setting for 68k kexec support limits it to only
the classic 68k CPU types (so no ColdFire). However the underlying
support can handle any 68k CPU that is MMU enabled - and that includes
ColdFire. (Of course that support is only as good as mentioned in
the current configuration help).

None of the no-MMU CPU types (classic or ColdFire) have support for
kexec yet, so the configuration as it stands is not quite right, and
it will fail to compile on them.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index b06faf6c0b27..fa6e69ec0b38 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -87,7 +87,7 @@ config MMU_SUN3
 
 config KEXEC
 	bool "kexec system call"
-	depends on M68KCLASSIC
+	depends on MMU
 	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure
  2022-08-26  4:03 [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure Greg Ungerer
  2022-08-26  4:03 ` [PATCH 2/3] m68knommu: fix non-mmu classic 68000 legacy timer tick selection Greg Ungerer
  2022-08-26  4:03 ` [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs Greg Ungerer
@ 2022-08-26  7:38 ` Geert Uytterhoeven
  2 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2022-08-26  7:38 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k, kernel test robot

On Fri, Aug 26, 2022 at 6:08 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> Compiling for a classic m68k non-MMU target with no specific CPU
> selected fails with the following error:
>
>    arch/m68k/68000/ints.c: In function 'process_int':
> >> arch/m68k/68000/ints.c:82:30: error: 'ISR' undeclared (first use in this function)
>       82 |         unsigned long pend = ISR;
>          |                              ^~~
>
> This interrupt handling code is specific to the 68328 family of 68000
> parts. There is a couple of variants (68EZ328, 68VZ328) and the common
> ancestor of them the strait 68328.
>
> The code here includes a specific header for each variant type. But if
> none is selected then nothing is included to supply the appropriate
> register and bit flags defines.
>
> Rearrange the includes so that at least one type is always included.
> At the very least the 68328 base type should be the fallback, so make
> that true.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] m68knommu: fix non-mmu classic 68000 legacy timer tick selection
  2022-08-26  4:03 ` [PATCH 2/3] m68knommu: fix non-mmu classic 68000 legacy timer tick selection Greg Ungerer
@ 2022-08-26  7:39   ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2022-08-26  7:39 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k

On Fri, Aug 26, 2022 at 6:08 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> The family of classic 68000 parts supported when in non-mmu mode all
> currently use the legacy timer support. Move the selection of that config
> option, LEGACY_TIMER_TICK, into the core CPU configuration.
>
> This fixes compilation if no specific CPU variant is selected, since
> the LEGACY_TIMER_TICK option was only selected in the specific CPU
> variant configurations.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs
  2022-08-26  4:03 ` [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs Greg Ungerer
@ 2022-08-26  7:44   ` Geert Uytterhoeven
  2022-08-30  7:23     ` Greg Ungerer
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2022-08-26  7:44 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k

Hi Greg,

On Fri, Aug 26, 2022 at 6:08 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> The configuration setting for 68k kexec support limits it to only
> the classic 68k CPU types (so no ColdFire). However the underlying
> support can handle any 68k CPU that is MMU enabled - and that includes
> ColdFire. (Of course that support is only as good as mentioned in
> the current configuration help).
>
> None of the no-MMU CPU types (classic or ColdFire) have support for
> kexec yet, so the configuration as it stands is not quite right, and
> it will fail to compile on them.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Thanks for your patch!

> --- a/arch/m68k/Kconfig
> +++ b/arch/m68k/Kconfig
> @@ -87,7 +87,7 @@ config MMU_SUN3
>
>  config KEXEC
>         bool "kexec system call"
> -       depends on M68KCLASSIC
> +       depends on MMU
>         select KEXEC_CORE
>         help
>           kexec is a system call that implements the ability to shutdown your

Don't you need changes to arch/m68k/kernel/relocate_kernel.S,
which supports 68020+ only?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs
  2022-08-26  7:44   ` Geert Uytterhoeven
@ 2022-08-30  7:23     ` Greg Ungerer
  2022-08-30  7:36       ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Ungerer @ 2022-08-30  7:23 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k

Hi Geert,

On 26/8/22 17:44, Geert Uytterhoeven wrote:
> On Fri, Aug 26, 2022 at 6:08 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>> The configuration setting for 68k kexec support limits it to only
>> the classic 68k CPU types (so no ColdFire). However the underlying
>> support can handle any 68k CPU that is MMU enabled - and that includes
>> ColdFire. (Of course that support is only as good as mentioned in
>> the current configuration help).
>>
>> None of the no-MMU CPU types (classic or ColdFire) have support for
>> kexec yet, so the configuration as it stands is not quite right, and
>> it will fail to compile on them.
>>
>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> 
> Thanks for your patch!
> 
>> --- a/arch/m68k/Kconfig
>> +++ b/arch/m68k/Kconfig
>> @@ -87,7 +87,7 @@ config MMU_SUN3
>>
>>   config KEXEC
>>          bool "kexec system call"
>> -       depends on M68KCLASSIC
>> +       depends on MMU
>>          select KEXEC_CORE
>>          help
>>            kexec is a system call that implements the ability to shutdown your
> 
> Don't you need changes to arch/m68k/kernel/relocate_kernel.S,
> which supports 68020+ only?

I suspect so looking at that now. It compiles ok, but without a
check for MMU type specific to ColdFire it will likely fail.
I didn't dig into it too deeply, my primary goal with to fix compilation
for the non-MMU targets.

I started out testing it with this:

     depends on M68KCLASSIC && MMU

And that works and fixes the problem I was most interested in.
But then I figured that perhaps it is better to allow if for ColdFire with MMU enabled.

I didn't want to go down the rabbit hole of trying to get it working
on non-MMU platforms (and ColdFire with MMU enabled either really).

So I would be just as happy to limit it to M68KCLASSIC and MMU for now?

Regards
Greg



> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs
  2022-08-30  7:23     ` Greg Ungerer
@ 2022-08-30  7:36       ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2022-08-30  7:36 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k

Hi Greg,

On Tue, Aug 30, 2022 at 9:23 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> On 26/8/22 17:44, Geert Uytterhoeven wrote:
> > On Fri, Aug 26, 2022 at 6:08 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> >> The configuration setting for 68k kexec support limits it to only
> >> the classic 68k CPU types (so no ColdFire). However the underlying
> >> support can handle any 68k CPU that is MMU enabled - and that includes
> >> ColdFire. (Of course that support is only as good as mentioned in
> >> the current configuration help).
> >>
> >> None of the no-MMU CPU types (classic or ColdFire) have support for
> >> kexec yet, so the configuration as it stands is not quite right, and
> >> it will fail to compile on them.
> >>
> >> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> >
> >> --- a/arch/m68k/Kconfig
> >> +++ b/arch/m68k/Kconfig
> >> @@ -87,7 +87,7 @@ config MMU_SUN3
> >>
> >>   config KEXEC
> >>          bool "kexec system call"
> >> -       depends on M68KCLASSIC
> >> +       depends on MMU
> >>          select KEXEC_CORE
> >>          help
> >>            kexec is a system call that implements the ability to shutdown your
> >
> > Don't you need changes to arch/m68k/kernel/relocate_kernel.S,
> > which supports 68020+ only?
>
> I suspect so looking at that now. It compiles ok, but without a
> check for MMU type specific to ColdFire it will likely fail.
> I didn't dig into it too deeply, my primary goal with to fix compilation
> for the non-MMU targets.
>
> I started out testing it with this:
>
>      depends on M68KCLASSIC && MMU
>
> And that works and fixes the problem I was most interested in.
> But then I figured that perhaps it is better to allow if for ColdFire with MMU enabled.
>
> I didn't want to go down the rabbit hole of trying to get it working
> on non-MMU platforms (and ColdFire with MMU enabled either really).
>
> So I would be just as happy to limit it to M68KCLASSIC and MMU for now?

That sounds fine to me.
Thanks!

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-30  7:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26  4:03 [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure Greg Ungerer
2022-08-26  4:03 ` [PATCH 2/3] m68knommu: fix non-mmu classic 68000 legacy timer tick selection Greg Ungerer
2022-08-26  7:39   ` Geert Uytterhoeven
2022-08-26  4:03 ` [PATCH 3/3] m68k: allow kexec on all MMU enabled CPUs Greg Ungerer
2022-08-26  7:44   ` Geert Uytterhoeven
2022-08-30  7:23     ` Greg Ungerer
2022-08-30  7:36       ` Geert Uytterhoeven
2022-08-26  7:38 ` [PATCH 1/3] m68knommu: fix non-specific 68328 choice interrupt build failure Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).