All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] m68k: build fixes and cleanup
@ 2022-05-18  6:56 Greg Ungerer
  2022-05-18  6:56 ` [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Greg Ungerer
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Greg Ungerer @ 2022-05-18  6:56 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, linux-kernel, arnd, Greg Ungerer

This small series is primarily to fix the build problem reported by
the kernel build robot for undefined references to "mach_set_rtc_pll"
and "mach_get_rtc_pll".

I noticed a couple of other problems along the way, so patches 2 and 3
are an additional cleanup and fix. Geert can you shed any light on what
the changes in patch 2?

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

---
 arch/m68k/kernel/setup_mm.c     |    2 --
 arch/m68k/Kconfig.cpu           |    2 +-
 arch/m68k/hp300/config.c        |    7 -------
 arch/m68k/include/asm/machdep.h |    1 -
 arch/m68k/kernel/setup_mm.c     |    7 -------
 arch/m68k/kernel/setup_no.c     |    1 -
 arch/m68k/kernel/time.c         |    9 +++++++++
 arch/m68k/q40/config.c          |    7 -------
 8 files changed, 10 insertions(+), 26 deletions(-)



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

* [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll'
  2022-05-18  6:56 [PATCH 0/3] m68k: build fixes and cleanup Greg Ungerer
@ 2022-05-18  6:56 ` Greg Ungerer
  2022-05-18  8:38   ` Geert Uytterhoeven
                     ` (2 more replies)
  2022-05-18  6:56 ` [PATCH 2/3] m68k: removed unused "mach_get_ss" Greg Ungerer
  2022-05-18  6:56 ` [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected Greg Ungerer
  2 siblings, 3 replies; 13+ messages in thread
From: Greg Ungerer @ 2022-05-18  6:56 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, linux-kernel, arnd, Greg Ungerer, kernel test robot

Configuring for a nommu classic m68k target and enabling the generic rtc
driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
error:

   m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
   time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
   m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
   m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'

There is no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
nommu code paths. Move these definitions and the associated "mach_hwclk",
so that they are around their use case in time.c. This means they will
always be defined on the builds that require them, and not on those that
cannot use them - such as ColdFire (both with and without MMU enabled).

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/kernel/setup_mm.c | 7 -------
 arch/m68k/kernel/setup_no.c | 1 -
 arch/m68k/kernel/time.c     | 9 +++++++++
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 8f94feed969c..07317367ead8 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -87,15 +87,8 @@ void (*mach_sched_init) (void) __initdata = NULL;
 void (*mach_init_IRQ) (void) __initdata = NULL;
 void (*mach_get_model) (char *model);
 void (*mach_get_hardware_list) (struct seq_file *m);
-/* machine dependent timer functions */
-int (*mach_hwclk) (int, struct rtc_time*);
-EXPORT_SYMBOL(mach_hwclk);
 unsigned int (*mach_get_ss)(void);
-int (*mach_get_rtc_pll)(struct rtc_pll_info *);
-int (*mach_set_rtc_pll)(struct rtc_pll_info *);
 EXPORT_SYMBOL(mach_get_ss);
-EXPORT_SYMBOL(mach_get_rtc_pll);
-EXPORT_SYMBOL(mach_set_rtc_pll);
 void (*mach_reset)( void );
 void (*mach_halt)( void );
 void (*mach_power_off)( void );
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index 5e4104f07a44..19eea73d3c17 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -50,7 +50,6 @@ char __initdata command_line[COMMAND_LINE_SIZE];
 
 /* machine dependent timer functions */
 void (*mach_sched_init)(void) __initdata = NULL;
-int (*mach_hwclk) (int, struct rtc_time*);
 
 /* machine dependent reboot functions */
 void (*mach_reset)(void);
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index 340ffeea0a9d..97a5438562cd 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -63,6 +63,10 @@ void timer_heartbeat(void)
 #endif /* CONFIG_HEARTBEAT */
 
 #ifdef CONFIG_M68KCLASSIC
+/* machine dependent timer functions */
+int (*mach_hwclk) (int, struct rtc_time*);
+EXPORT_SYMBOL(mach_hwclk);
+
 #if !IS_BUILTIN(CONFIG_RTC_DRV_GENERIC)
 void read_persistent_clock64(struct timespec64 *ts)
 {
@@ -82,6 +86,11 @@ void read_persistent_clock64(struct timespec64 *ts)
 #endif
 
 #if IS_ENABLED(CONFIG_RTC_DRV_GENERIC)
+int (*mach_get_rtc_pll)(struct rtc_pll_info *);
+int (*mach_set_rtc_pll)(struct rtc_pll_info *);
+EXPORT_SYMBOL(mach_get_rtc_pll);
+EXPORT_SYMBOL(mach_set_rtc_pll);
+
 static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm)
 {
 	mach_hwclk(0, tm);
-- 
2.25.1


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

* [PATCH 2/3] m68k: removed unused "mach_get_ss"
  2022-05-18  6:56 [PATCH 0/3] m68k: build fixes and cleanup Greg Ungerer
  2022-05-18  6:56 ` [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Greg Ungerer
@ 2022-05-18  6:56 ` Greg Ungerer
  2022-05-18  8:39   ` Geert Uytterhoeven
  2022-05-18 12:24   ` Arnd Bergmann
  2022-05-18  6:56 ` [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected Greg Ungerer
  2 siblings, 2 replies; 13+ messages in thread
From: Greg Ungerer @ 2022-05-18  6:56 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, linux-kernel, arnd, Greg Ungerer

The m68k machine helper function "mach_get_ss" function pointer is
set for some machines, but ultimately never used anywhere. Remove it.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/hp300/config.c        | 7 -------
 arch/m68k/include/asm/machdep.h | 1 -
 arch/m68k/kernel/setup_mm.c     | 2 --
 arch/m68k/q40/config.c          | 7 -------
 4 files changed, 17 deletions(-)

diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c
index 2c92843397c3..e4bd6913f50e 100644
--- a/arch/m68k/hp300/config.c
+++ b/arch/m68k/hp300/config.c
@@ -240,12 +240,6 @@ static int hp300_hwclk(int op, struct rtc_time *t)
 	return 0;
 }
 
-static unsigned int hp300_get_ss(void)
-{
-	return hp300_rtc_read(RTC_REG_SEC1) * 10 +
-		hp300_rtc_read(RTC_REG_SEC2);
-}
-
 static void __init hp300_init_IRQ(void)
 {
 }
@@ -256,7 +250,6 @@ void __init config_hp300(void)
 	mach_init_IRQ        = hp300_init_IRQ;
 	mach_get_model       = hp300_get_model;
 	mach_hwclk	     = hp300_hwclk;
-	mach_get_ss	     = hp300_get_ss;
 	mach_reset           = hp300_reset;
 #ifdef CONFIG_HEARTBEAT
 	mach_heartbeat       = hp300_pulse;
diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machdep.h
index 8fd80ef1b77e..841ba6aa3fcb 100644
--- a/arch/m68k/include/asm/machdep.h
+++ b/arch/m68k/include/asm/machdep.h
@@ -19,7 +19,6 @@ extern void (*mach_get_model) (char *model);
 extern void (*mach_get_hardware_list) (struct seq_file *m);
 /* machine dependent timer functions */
 extern int (*mach_hwclk)(int, struct rtc_time*);
-extern unsigned int (*mach_get_ss)(void);
 extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);
 extern int (*mach_set_rtc_pll)(struct rtc_pll_info *);
 extern void (*mach_reset)( void );
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 07317367ead8..0593bf345b34 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -87,8 +87,6 @@ void (*mach_sched_init) (void) __initdata = NULL;
 void (*mach_init_IRQ) (void) __initdata = NULL;
 void (*mach_get_model) (char *model);
 void (*mach_get_hardware_list) (struct seq_file *m);
-unsigned int (*mach_get_ss)(void);
-EXPORT_SYMBOL(mach_get_ss);
 void (*mach_reset)( void );
 void (*mach_halt)( void );
 void (*mach_power_off)( void );
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index 9237243077ce..c78ee709b458 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -41,7 +41,6 @@ static void q40_get_model(char *model);
 extern void q40_sched_init(void);
 
 static int q40_hwclk(int, struct rtc_time *);
-static unsigned int q40_get_ss(void);
 static int q40_get_rtc_pll(struct rtc_pll_info *pll);
 static int q40_set_rtc_pll(struct rtc_pll_info *pll);
 
@@ -169,7 +168,6 @@ void __init config_q40(void)
 
 	mach_init_IRQ = q40_init_IRQ;
 	mach_hwclk = q40_hwclk;
-	mach_get_ss = q40_get_ss;
 	mach_get_rtc_pll = q40_get_rtc_pll;
 	mach_set_rtc_pll = q40_set_rtc_pll;
 
@@ -246,11 +244,6 @@ static int q40_hwclk(int op, struct rtc_time *t)
 	return 0;
 }
 
-static unsigned int q40_get_ss(void)
-{
-	return bcd2bin(Q40_RTC_SECS);
-}
-
 /* get and set PLL calibration of RTC clock */
 #define Q40_RTC_PLL_MASK ((1<<5)-1)
 #define Q40_RTC_PLL_SIGN (1<<5)
-- 
2.25.1


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

* [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected
  2022-05-18  6:56 [PATCH 0/3] m68k: build fixes and cleanup Greg Ungerer
  2022-05-18  6:56 ` [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Greg Ungerer
  2022-05-18  6:56 ` [PATCH 2/3] m68k: removed unused "mach_get_ss" Greg Ungerer
@ 2022-05-18  6:56 ` Greg Ungerer
  2022-05-18  9:20   ` Geert Uytterhoeven
  2 siblings, 1 reply; 13+ messages in thread
From: Greg Ungerer @ 2022-05-18  6:56 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, linux-kernel, arnd, Greg Ungerer

If building for a nommu m68k classic CPU and no platform (board) is
selected then the final link fails with:

     LD      vmlinux.o
   m68k-linux-ld: cannot find arch/m68k/kernel/head.o: No such file or directory
   make: *** [Makefile:1158: vmlinux] Error 1

Not selecting a platform is ok, that is a generic 68000 system build.
All of the platform selections are for 68328 variants.

The underlying problem is that the CPU config option (CONFIG_M68000)
ends up not being set, it is currently only selected by one of the
platform choices.

Change CONFIG_M68000 so that it is always enabled for the nommu m68k
classic configuration.

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

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 16ea9a67723c..ed719a855e6a 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -37,7 +37,7 @@ endchoice
 if M68KCLASSIC
 
 config M68000
-	bool
+	def_bool y
 	depends on !MMU
 	select CPU_HAS_NO_BITFIELDS
 	select CPU_HAS_NO_CAS
-- 
2.25.1


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

* Re: [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll'
  2022-05-18  6:56 ` [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Greg Ungerer
@ 2022-05-18  8:38   ` Geert Uytterhoeven
  2022-05-18 12:26   ` Arnd Bergmann
  2022-05-24  7:46   ` Geert Uytterhoeven
  2 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2022-05-18  8:38 UTC (permalink / raw)
  To: Greg Ungerer
  Cc: Linux/m68k, Linux Kernel Mailing List, Arnd Bergmann, kernel test robot

On Wed, May 18, 2022 at 8:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> Configuring for a nommu classic m68k target and enabling the generic rtc
> driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
> error:
>
>    m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
>    time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
>    m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
>    m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'
>
> There is no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
> nommu code paths. Move these definitions and the associated "mach_hwclk",
> so that they are around their use case in time.c. This means they will
> always be defined on the builds that require them, and not on those that
> cannot use them - such as ColdFire (both with and without MMU enabled).
>
> 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>
Acked-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] 13+ messages in thread

* Re: [PATCH 2/3] m68k: removed unused "mach_get_ss"
  2022-05-18  6:56 ` [PATCH 2/3] m68k: removed unused "mach_get_ss" Greg Ungerer
@ 2022-05-18  8:39   ` Geert Uytterhoeven
  2022-05-18 12:24   ` Arnd Bergmann
  1 sibling, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2022-05-18  8:39 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k, Linux Kernel Mailing List, Arnd Bergmann

On Wed, May 18, 2022 at 8:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> The m68k machine helper function "mach_get_ss" function pointer is
> set for some machines, but ultimately never used anywhere. Remove it.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Yep, this became unused since commit 084b3600e2d98ebb ("char/genrtc:
remove m68k support").

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-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] 13+ messages in thread

* Re: [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected
  2022-05-18  6:56 ` [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected Greg Ungerer
@ 2022-05-18  9:20   ` Geert Uytterhoeven
  2022-05-18 13:18     ` Greg Ungerer
  0 siblings, 1 reply; 13+ messages in thread
From: Geert Uytterhoeven @ 2022-05-18  9:20 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: Linux/m68k, Linux Kernel Mailing List, Arnd Bergmann

Hi Greg.

On Wed, May 18, 2022 at 8:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> If building for a nommu m68k classic CPU and no platform (board) is
> selected then the final link fails with:
>
>      LD      vmlinux.o
>    m68k-linux-ld: cannot find arch/m68k/kernel/head.o: No such file or directory
>    make: *** [Makefile:1158: vmlinux] Error 1
>
> Not selecting a platform is ok, that is a generic 68000 system build.
> All of the platform selections are for 68328 variants.
>
> The underlying problem is that the CPU config option (CONFIG_M68000)
> ends up not being set, it is currently only selected by one of the
> platform choices.
>
> Change CONFIG_M68000 so that it is always enabled for the nommu m68k
> classic configuration.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Thanks for your patch!

> --- a/arch/m68k/Kconfig.cpu
> +++ b/arch/m68k/Kconfig.cpu
> @@ -37,7 +37,7 @@ endchoice
>  if M68KCLASSIC
>
>  config M68000
> -       bool
> +       def_bool y

And then the selects can be removed, too, as the symbol is now always
enabled?

I'm wondering how to handle this when another nommu-m68k-classic
platform shows up (again, cfr. the removed 68360 support) , that
would need a different head.S?  Of course that's something to be
solved later...

>         depends on !MMU
>         select CPU_HAS_NO_BITFIELDS
>         select CPU_HAS_NO_CAS

Note that mmu-m68k-classic (e.g. CONFIG_MMU=y + allnonfig) has the
same problem.  That config does need other fixes too.  E.g. I have
a local patch to make sure NR_IRQS is never zero, but never got to
solve the missing head.o problem in an acceptable way.

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] 13+ messages in thread

* Re: [PATCH 2/3] m68k: removed unused "mach_get_ss"
  2022-05-18  6:56 ` [PATCH 2/3] m68k: removed unused "mach_get_ss" Greg Ungerer
  2022-05-18  8:39   ` Geert Uytterhoeven
@ 2022-05-18 12:24   ` Arnd Bergmann
  1 sibling, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2022-05-18 12:24 UTC (permalink / raw)
  To: Greg Ungerer
  Cc: Linux/m68k, Geert Uytterhoeven, Linux Kernel Mailing List, Arnd Bergmann

On Wed, May 18, 2022 at 7:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>
> The m68k machine helper function "mach_get_ss" function pointer is
> set for some machines, but ultimately never used anywhere. Remove it.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Good catch!

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll'
  2022-05-18  6:56 ` [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Greg Ungerer
  2022-05-18  8:38   ` Geert Uytterhoeven
@ 2022-05-18 12:26   ` Arnd Bergmann
  2022-05-24  7:46   ` Geert Uytterhoeven
  2 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2022-05-18 12:26 UTC (permalink / raw)
  To: Greg Ungerer
  Cc: Linux/m68k, Geert Uytterhoeven, Linux Kernel Mailing List,
	Arnd Bergmann, kernel test robot

On Wed, May 18, 2022 at 7:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>
> Configuring for a nommu classic m68k target and enabling the generic rtc
> driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
> error:
>
>    m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
>    time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
>    m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
>    m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'
>
> There is no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
> nommu code paths. Move these definitions and the associated "mach_hwclk",
> so that they are around their use case in time.c. This means they will
> always be defined on the builds that require them, and not on those that
> cannot use them - such as ColdFire (both with and without MMU enabled).
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Right, this seems to be the best solution

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected
  2022-05-18  9:20   ` Geert Uytterhoeven
@ 2022-05-18 13:18     ` Greg Ungerer
  0 siblings, 0 replies; 13+ messages in thread
From: Greg Ungerer @ 2022-05-18 13:18 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, Linux Kernel Mailing List, Arnd Bergmann

Hi Geert,

On 18/5/22 19:20, Geert Uytterhoeven wrote:
> Hi Greg.
> 
> On Wed, May 18, 2022 at 8:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>> If building for a nommu m68k classic CPU and no platform (board) is
>> selected then the final link fails with:
>>
>>       LD      vmlinux.o
>>     m68k-linux-ld: cannot find arch/m68k/kernel/head.o: No such file or directory
>>     make: *** [Makefile:1158: vmlinux] Error 1
>>
>> Not selecting a platform is ok, that is a generic 68000 system build.
>> All of the platform selections are for 68328 variants.
>>
>> The underlying problem is that the CPU config option (CONFIG_M68000)
>> ends up not being set, it is currently only selected by one of the
>> platform choices.
>>
>> Change CONFIG_M68000 so that it is always enabled for the nommu m68k
>> classic configuration.
>>
>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> 
> Thanks for your patch!
> 
>> --- a/arch/m68k/Kconfig.cpu
>> +++ b/arch/m68k/Kconfig.cpu
>> @@ -37,7 +37,7 @@ endchoice
>>   if M68KCLASSIC
>>
>>   config M68000
>> -       bool
>> +       def_bool y
> 
> And then the selects can be removed, too, as the symbol is now always
> enabled?

Yes, I think that would be the case.


> I'm wondering how to handle this when another nommu-m68k-classic
> platform shows up (again, cfr. the removed 68360 support) , that
> would need a different head.S?  Of course that's something to be
> solved later...

Yes, indeed. I am kinda kicking that can down the road :-)

It probably doesn't make a lot of sense to be able to select
multiple platform types in this specific nommu m68k classic setup.
The startup config code does not support probing of platform type,
it has hard coded #if conditionals that mean it only supports a
single platform selection anyway.

Anyway, a problem to deal with when we have more choices here.


>>          depends on !MMU
>>          select CPU_HAS_NO_BITFIELDS
>>          select CPU_HAS_NO_CAS
> 
> Note that mmu-m68k-classic (e.g. CONFIG_MMU=y + allnonfig) has the
> same problem.  That config does need other fixes too.  E.g. I have
> a local patch to make sure NR_IRQS is never zero, but never got to
> solve the missing head.o problem in an acceptable way.

Yep, ok.

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] 13+ messages in thread

* Re: [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll'
  2022-05-18  6:56 ` [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Greg Ungerer
  2022-05-18  8:38   ` Geert Uytterhoeven
  2022-05-18 12:26   ` Arnd Bergmann
@ 2022-05-24  7:46   ` Geert Uytterhoeven
  2022-05-24  7:49     ` Geert Uytterhoeven
  2 siblings, 1 reply; 13+ messages in thread
From: Geert Uytterhoeven @ 2022-05-24  7:46 UTC (permalink / raw)
  To: Greg Ungerer
  Cc: Linux/m68k, Linux Kernel Mailing List, Arnd Bergmann, kernel test robot

Hi Greg,

On Wed, May 18, 2022 at 8:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> Configuring for a nommu classic m68k target and enabling the generic rtc
> driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
> error:
>
>    m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
>    time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
>    m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
>    m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'
>
> There is no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
> nommu code paths. Move these definitions and the associated "mach_hwclk",
> so that they are around their use case in time.c. This means they will
> always be defined on the builds that require them, and not on those that
> cannot use them - such as ColdFire (both with and without MMU enabled).
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

> --- a/arch/m68k/kernel/time.c
> +++ b/arch/m68k/kernel/time.c
> @@ -82,6 +86,11 @@ void read_persistent_clock64(struct timespec64 *ts)
>  #endif
>
>  #if IS_ENABLED(CONFIG_RTC_DRV_GENERIC)
> +int (*mach_get_rtc_pll)(struct rtc_pll_info *);
> +int (*mach_set_rtc_pll)(struct rtc_pll_info *);
> +EXPORT_SYMBOL(mach_get_rtc_pll);
> +EXPORT_SYMBOL(mach_set_rtc_pll);

Oops, this causes build failures for Q40 with CONFIG_RTC_DRV_GENERIC=n,
as arch/m68k/q40/config.c uses mach_]gs]et_rtc_pll() unconditionally.

> +
>  static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm)
>  {
>         mach_hwclk(0, tm);

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] 13+ messages in thread

* Re: [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll'
  2022-05-24  7:46   ` Geert Uytterhoeven
@ 2022-05-24  7:49     ` Geert Uytterhoeven
  2022-05-24 14:01       ` Greg Ungerer
  0 siblings, 1 reply; 13+ messages in thread
From: Geert Uytterhoeven @ 2022-05-24  7:49 UTC (permalink / raw)
  To: Greg Ungerer
  Cc: Linux/m68k, Linux Kernel Mailing List, Arnd Bergmann, kernel test robot

Hi Greg,

On Tue, May 24, 2022 at 9:46 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Wed, May 18, 2022 at 8:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> > Configuring for a nommu classic m68k target and enabling the generic rtc
> > driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
> > error:
> >
> >    m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
> >    time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
> >    m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
> >    m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'
> >
> > There is no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
> > nommu code paths. Move these definitions and the associated "mach_hwclk",
> > so that they are around their use case in time.c. This means they will
> > always be defined on the builds that require them, and not on those that
> > cannot use them - such as ColdFire (both with and without MMU enabled).
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
>
> > --- a/arch/m68k/kernel/time.c
> > +++ b/arch/m68k/kernel/time.c
> > @@ -82,6 +86,11 @@ void read_persistent_clock64(struct timespec64 *ts)
> >  #endif
> >
> >  #if IS_ENABLED(CONFIG_RTC_DRV_GENERIC)
> > +int (*mach_get_rtc_pll)(struct rtc_pll_info *);
> > +int (*mach_set_rtc_pll)(struct rtc_pll_info *);
> > +EXPORT_SYMBOL(mach_get_rtc_pll);
> > +EXPORT_SYMBOL(mach_set_rtc_pll);
>
> Oops, this causes build failures for Q40 with CONFIG_RTC_DRV_GENERIC=n,
> as arch/m68k/q40/config.c uses mach_]gs]et_rtc_pll() unconditionally.

I think the simplest solution is to move these up, next to mach_hwclk.

>
> > +
> >  static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm)
> >  {
> >         mach_hwclk(0, tm);

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] 13+ messages in thread

* Re: [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll'
  2022-05-24  7:49     ` Geert Uytterhoeven
@ 2022-05-24 14:01       ` Greg Ungerer
  0 siblings, 0 replies; 13+ messages in thread
From: Greg Ungerer @ 2022-05-24 14:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux/m68k, Linux Kernel Mailing List, Arnd Bergmann, kernel test robot

Hi Geert,

On 24/5/22 17:49, Geert Uytterhoeven wrote:
> Hi Greg,
> 
> On Tue, May 24, 2022 at 9:46 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Wed, May 18, 2022 at 8:56 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
>>> Configuring for a nommu classic m68k target and enabling the generic rtc
>>> driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
>>> error:
>>>
>>>     m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
>>>     time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
>>>     m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
>>>     m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'
>>>
>>> There is no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
>>> nommu code paths. Move these definitions and the associated "mach_hwclk",
>>> so that they are around their use case in time.c. This means they will
>>> always be defined on the builds that require them, and not on those that
>>> cannot use them - such as ColdFire (both with and without MMU enabled).
>>>
>>> Reported-by: kernel test robot <lkp@intel.com>
>>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
>>
>>> --- a/arch/m68k/kernel/time.c
>>> +++ b/arch/m68k/kernel/time.c
>>> @@ -82,6 +86,11 @@ void read_persistent_clock64(struct timespec64 *ts)
>>>   #endif
>>>
>>>   #if IS_ENABLED(CONFIG_RTC_DRV_GENERIC)
>>> +int (*mach_get_rtc_pll)(struct rtc_pll_info *);
>>> +int (*mach_set_rtc_pll)(struct rtc_pll_info *);
>>> +EXPORT_SYMBOL(mach_get_rtc_pll);
>>> +EXPORT_SYMBOL(mach_set_rtc_pll);
>>
>> Oops, this causes build failures for Q40 with CONFIG_RTC_DRV_GENERIC=n,
>> as arch/m68k/q40/config.c uses mach_]gs]et_rtc_pll() unconditionally.
> 
> I think the simplest solution is to move these up, next to mach_hwclk.

Yes, that looks to be the easiest solution.
New patch coming up.

Regards
Greg


>>> +
>>>   static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm)
>>>   {
>>>          mach_hwclk(0, tm);
> 
> 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] 13+ messages in thread

end of thread, other threads:[~2022-05-24 14:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18  6:56 [PATCH 0/3] m68k: build fixes and cleanup Greg Ungerer
2022-05-18  6:56 ` [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Greg Ungerer
2022-05-18  8:38   ` Geert Uytterhoeven
2022-05-18 12:26   ` Arnd Bergmann
2022-05-24  7:46   ` Geert Uytterhoeven
2022-05-24  7:49     ` Geert Uytterhoeven
2022-05-24 14:01       ` Greg Ungerer
2022-05-18  6:56 ` [PATCH 2/3] m68k: removed unused "mach_get_ss" Greg Ungerer
2022-05-18  8:39   ` Geert Uytterhoeven
2022-05-18 12:24   ` Arnd Bergmann
2022-05-18  6:56 ` [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected Greg Ungerer
2022-05-18  9:20   ` Geert Uytterhoeven
2022-05-18 13:18     ` Greg Ungerer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.