From nobody Wed May 13 16:49:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D028C433EF for ; Wed, 18 May 2022 06:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231793AbiERG51 (ORCPT ); Wed, 18 May 2022 02:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231754AbiERG4y (ORCPT ); Wed, 18 May 2022 02:56:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F5DE12772; Tue, 17 May 2022 23:56:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BE86EB81E9B; Wed, 18 May 2022 06:56:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13932C385A9; Wed, 18 May 2022 06:56:48 +0000 (UTC) From: Greg Ungerer To: linux-m68k@vger.kernel.org Cc: geert@linux-m68k.org, linux-kernel@vger.kernel.org, arnd@arndb.de, Greg Ungerer , kernel test robot Subject: [PATCH 1/3] m68knommu: fix undefined reference to `mach_get_rtc_pll' Date: Wed, 18 May 2022 16:56:37 +1000 Message-Id: <20220518065639.2432213-2-gerg@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220518065639.2432213-1-gerg@linux-m68k.org> References: <20220518065639.2432213-1-gerg@linux-m68k.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Greg Ungerer Acked-by: Geert Uytterhoeven Reviewed-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven --- 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 =3D NULL; void (*mach_init_IRQ) (void) __initdata =3D 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]; =20 /* machine dependent timer functions */ void (*mach_sched_init)(void) __initdata =3D NULL; -int (*mach_hwclk) (int, struct rtc_time*); =20 /* 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 */ =20 #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 =20 #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); --=20 2.25.1 From nobody Wed May 13 16:49:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83795C433EF for ; Wed, 18 May 2022 06:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231787AbiERG5U (ORCPT ); Wed, 18 May 2022 02:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231737AbiERG5E (ORCPT ); Wed, 18 May 2022 02:57:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B0813E3A; Tue, 17 May 2022 23:56:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3F903B81E98; Wed, 18 May 2022 06:56:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CECD4C34100; Wed, 18 May 2022 06:56:51 +0000 (UTC) From: Greg Ungerer To: linux-m68k@vger.kernel.org Cc: geert@linux-m68k.org, linux-kernel@vger.kernel.org, arnd@arndb.de, Greg Ungerer Subject: [PATCH 2/3] m68k: removed unused "mach_get_ss" Date: Wed, 18 May 2022 16:56:38 +1000 Message-Id: <20220518065639.2432213-3-gerg@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220518065639.2432213-1-gerg@linux-m68k.org> References: <20220518065639.2432213-1-gerg@linux-m68k.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Acked-by: Geert Uytterhoeven Reviewed-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven --- 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; } =20 -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 =3D hp300_init_IRQ; mach_get_model =3D hp300_get_model; mach_hwclk =3D hp300_hwclk; - mach_get_ss =3D hp300_get_ss; mach_reset =3D hp300_reset; #ifdef CONFIG_HEARTBEAT mach_heartbeat =3D hp300_pulse; diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machde= p.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 =3D NULL; void (*mach_init_IRQ) (void) __initdata =3D 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); =20 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); =20 @@ -169,7 +168,6 @@ void __init config_q40(void) =20 mach_init_IRQ =3D q40_init_IRQ; mach_hwclk =3D q40_hwclk; - mach_get_ss =3D q40_get_ss; mach_get_rtc_pll =3D q40_get_rtc_pll; mach_set_rtc_pll =3D q40_set_rtc_pll; =20 @@ -246,11 +244,6 @@ static int q40_hwclk(int op, struct rtc_time *t) return 0; } =20 -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) --=20 2.25.1 From nobody Wed May 13 16:49:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8A43C433F5 for ; Wed, 18 May 2022 06:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231776AbiERG5N (ORCPT ); Wed, 18 May 2022 02:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231756AbiERG5E (ORCPT ); Wed, 18 May 2022 02:57:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED36713E3F; Tue, 17 May 2022 23:56:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A21F2B81E9F; Wed, 18 May 2022 06:56:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D319C385A5; Wed, 18 May 2022 06:56:53 +0000 (UTC) From: Greg Ungerer To: linux-m68k@vger.kernel.org Cc: geert@linux-m68k.org, linux-kernel@vger.kernel.org, arnd@arndb.de, Greg Ungerer Subject: [PATCH 3/3] m68knommu: fix 68000 CPU link with no platform selected Date: Wed, 18 May 2022 16:56:39 +1000 Message-Id: <20220518065639.2432213-4-gerg@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220518065639.2432213-1-gerg@linux-m68k.org> References: <20220518065639.2432213-1-gerg@linux-m68k.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 dire= ctory 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 --- 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 =20 config M68000 - bool + def_bool y depends on !MMU select CPU_HAS_NO_BITFIELDS select CPU_HAS_NO_CAS --=20 2.25.1