Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k: Move Sun 3 into a top-level platform option

It is possible to select an m68k MMU build but not actually enable any
of the three MMU options, which then results in a build failure:

arch/m68k/include/asm/page.h:10:25: error: 'CONFIG_PAGE_SHIFT' undeclared here (not in a function); did you mean 'CONFIG_LOG_BUF_SHIFT'?

Change the Kconfig selection to ensure that exactly one of the three
options is always enabled whenever an MMU-enabled kernel is built, but
moving CONFIG_SUN3 into a top-level option next to M68KCLASSIC and
COLDFIRE.

All defconfig files should keep working without changes, but
alldefconfig now builds support for the classic MMU.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408032138.P7sBvIns-lkp@intel.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/20241030195638.22542-1-arnd@kernel.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Arnd Bergmann and committed by
Geert Uytterhoeven
5d42a685 fc10edd9

+31 -56
+5 -6
arch/m68k/Kconfig
··· 84 84 support by paged memory management. If unsure, say 'Y'. 85 85 86 86 config MMU_MOTOROLA 87 - bool 87 + def_bool MMU && M68KCLASSIC 88 88 select HAVE_PAGE_SIZE_4KB 89 89 90 90 config MMU_COLDFIRE 91 + def_bool MMU && COLDFIRE 91 92 select HAVE_PAGE_SIZE_8KB 92 - bool 93 93 94 94 config MMU_SUN3 95 - bool 95 + def_bool MMU && SUN3 96 96 select HAVE_PAGE_SIZE_8KB 97 - depends on MMU && !MMU_MOTOROLA && !MMU_COLDFIRE 98 97 99 98 config ARCH_SUPPORTS_KEXEC 100 - def_bool M68KCLASSIC && MMU 99 + def_bool (M68KCLASSIC || SUN3) && MMU 101 100 102 101 config BOOTINFO_PROC 103 102 bool "Export bootinfo in procfs" 104 - depends on KEXEC && M68KCLASSIC 103 + depends on KEXEC && (M68KCLASSIC || SUN3) 105 104 help 106 105 Say Y to export the bootinfo used to boot the kernel in a 107 106 "bootinfo" file in procfs. This is useful with kexec.
+22 -13
arch/m68k/Kconfig.cpu
··· 2 2 comment "Processor Type" 3 3 4 4 choice 5 - prompt "CPU family support" 5 + prompt "CPU/machine family support" 6 6 default M68KCLASSIC if MMU 7 7 default COLDFIRE if !MMU 8 8 help ··· 19 19 processor, select COLDFIRE. 20 20 21 21 config M68KCLASSIC 22 - bool "Classic M68K CPU family support" 22 + bool "Classic M68K CPU/machine family support" 23 23 select HAVE_ARCH_PFN_VALID 24 24 25 25 config COLDFIRE ··· 32 32 select HAVE_LEGACY_CLK 33 33 select HAVE_PAGE_SIZE_8KB if !MMU 34 34 35 + config SUN3 36 + bool "Sun3 machine support" 37 + depends on MMU 38 + select HAVE_ARCH_PFN_VALID 39 + select LEGACY_TIMER_TICK 40 + select NO_DMA 41 + select M68020 42 + help 43 + This option enables support for the Sun 3 series of workstations 44 + (3/50, 3/60, 3/1xx, 3/2xx systems). These use a classic 68020 CPU 45 + but the custom memory management unit makes them incompatible with 46 + all other classic m68k machines, including Sun 3x. 47 + 35 48 endchoice 36 49 37 - if M68KCLASSIC 38 - 39 50 config M68000 40 - def_bool y 41 - depends on !MMU 51 + def_bool M68KCLASSIC && !MMU 42 52 select CPU_HAS_NO_BITFIELDS 43 53 select CPU_HAS_NO_CAS 44 54 select CPU_HAS_NO_MULDIV64 ··· 66 56 a paging MMU. 67 57 68 58 config M68020 69 - bool "68020 support" 59 + bool "68020 support" if M68KCLASSIC 70 60 depends on MMU 71 61 select FPU 72 62 select CPU_HAS_ADDRESS_SPACES ··· 76 66 68851 MMU (Memory Management Unit) to run Linux/m68k, except on the 77 67 Sun 3, which provides its own version. 78 68 69 + if M68KCLASSIC && MMU 70 + 79 71 config M68030 80 72 bool "68030 support" 81 - depends on MMU && !MMU_SUN3 82 73 select FPU 83 74 select CPU_HAS_ADDRESS_SPACES 84 75 help ··· 89 78 90 79 config M68040 91 80 bool "68040 support" 92 - depends on MMU && !MMU_SUN3 93 81 select FPU 94 82 select CPU_HAS_ADDRESS_SPACES 95 83 help ··· 99 89 100 90 config M68060 101 91 bool "68060 support" 102 - depends on MMU && !MMU_SUN3 103 92 select FPU 104 93 select CPU_HAS_ADDRESS_SPACES 105 94 help 106 95 If you anticipate running this kernel on a computer with a MC68060 107 96 processor, say Y. Otherwise, say N. 97 + 98 + endif # M68KCLASSIC 108 99 109 100 config M68328 110 101 bool ··· 127 116 select M68000 128 117 help 129 118 Motorola 68VZ328 processor support. 130 - 131 - endif # M68KCLASSIC 132 119 133 120 if COLDFIRE 134 121 ··· 334 325 335 326 config M68KFPU_EMU 336 327 bool "Math emulation support" 337 - depends on M68KCLASSIC && FPU 328 + depends on (M68KCLASSIC || SUN3) && FPU 338 329 help 339 330 At some point in the future, this will cause floating-point math 340 331 instructions to be emulated by the kernel on machines that lack a
-25
arch/m68k/Kconfig.machine
··· 6 6 config AMIGA 7 7 bool "Amiga support" 8 8 depends on MMU 9 - select MMU_MOTOROLA if MMU 10 9 select LEGACY_TIMER_TICK 11 10 help 12 11 This option enables support for the Amiga series of computers. If ··· 15 16 config ATARI 16 17 bool "Atari support" 17 18 depends on MMU 18 - select MMU_MOTOROLA if MMU 19 19 select HAVE_ARCH_NVRAM_OPS 20 20 select LEGACY_TIMER_TICK 21 21 help ··· 29 31 config MAC 30 32 bool "Macintosh support" 31 33 depends on MMU 32 - select MMU_MOTOROLA if MMU 33 34 select HAVE_ARCH_NVRAM_OPS 34 35 select HAVE_PATA_PLATFORM 35 36 select LEGACY_TIMER_TICK ··· 41 44 config APOLLO 42 45 bool "Apollo support" 43 46 depends on MMU 44 - select MMU_MOTOROLA if MMU 45 47 select LEGACY_TIMER_TICK 46 48 help 47 49 Say Y here if you want to run Linux on an MC680x0-based Apollo ··· 49 53 config VME 50 54 bool "VME (Motorola and BVM) support" 51 55 depends on MMU 52 - select MMU_MOTOROLA if MMU 53 56 help 54 57 Say Y here if you want to build a kernel for a 680x0 based VME 55 58 board. Boards currently supported include Motorola boards MVME147, ··· 92 97 config HP300 93 98 bool "HP9000/300 and HP9000/400 support" 94 99 depends on MMU 95 - select MMU_MOTOROLA if MMU 96 100 select LEGACY_TIMER_TICK 97 101 help 98 102 This option enables support for the HP9000/300 and HP9000/400 series ··· 104 110 bool "Sun3x support" 105 111 depends on MMU 106 112 select LEGACY_TIMER_TICK 107 - select MMU_MOTOROLA if MMU 108 113 select M68030 109 114 help 110 115 This option enables support for the Sun 3x series of workstations. ··· 117 124 config Q40 118 125 bool "Q40/Q60 support" 119 126 depends on MMU 120 - select MMU_MOTOROLA if MMU 121 127 select LEGACY_TIMER_TICK 122 128 help 123 129 The Q40 is a Motorola 68040-based successor to the Sinclair QL ··· 124 132 <http://www.q40.de/>. This option enables support for the Q40 and 125 133 Q60. Select your CPU below. For 68LC060 don't forget to enable FPU 126 134 emulation. 127 - 128 - config SUN3 129 - bool "Sun3 support" 130 - depends on MMU 131 - depends on !MMU_MOTOROLA 132 - select MMU_SUN3 if MMU 133 - select LEGACY_TIMER_TICK 134 - select NO_DMA 135 - select M68020 136 - help 137 - This option enables support for the Sun 3 series of workstations 138 - (3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires 139 - that all other hardware types must be disabled, as Sun 3 kernels 140 - are incompatible with all other m68k targets (including Sun 3x!). 141 - 142 - If you don't want to compile a kernel exclusively for a Sun 3, say N. 143 135 144 136 config VIRT 145 137 bool "Virtual M68k Machine support" ··· 133 157 select GOLDFISH_TIMER 134 158 select GOLDFISH_TTY 135 159 select M68040 136 - select MMU_MOTOROLA if MMU 137 160 select RTC_CLASS 138 161 select RTC_DRV_GOLDFISH 139 162 select TTY
+2 -10
arch/m68k/kernel/Makefile
··· 5 5 6 6 extra-y += vmlinux.lds 7 7 8 - obj-$(CONFIG_AMIGA) := head.o 9 - obj-$(CONFIG_ATARI) := head.o 10 - obj-$(CONFIG_MAC) := head.o 11 - obj-$(CONFIG_APOLLO) := head.o 12 - obj-$(CONFIG_VME) := head.o 13 - obj-$(CONFIG_HP300) := head.o 14 - obj-$(CONFIG_Q40) := head.o 15 - obj-$(CONFIG_SUN3X) := head.o 16 - obj-$(CONFIG_VIRT) := head.o 17 - obj-$(CONFIG_SUN3) := sun3-head.o 8 + obj-$(CONFIG_MMU_MOTOROLA) := head.o 9 + obj-$(CONFIG_SUN3) := sun3-head.o 18 10 19 11 obj-y += entry.o irq.o module.o process.o ptrace.o 20 12 obj-y += setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o
+2 -2
arch/m68k/kernel/time.c
··· 62 62 } 63 63 #endif /* CONFIG_HEARTBEAT */ 64 64 65 - #ifdef CONFIG_M68KCLASSIC 65 + #if defined(CONFIG_M68KCLASSIC) || defined(CONFIG_SUN3) 66 66 /* machine dependent timer functions */ 67 67 int (*mach_hwclk) (int, struct rtc_time*); 68 68 EXPORT_SYMBOL(mach_hwclk); ··· 149 149 150 150 module_init(rtc_init); 151 151 #endif /* CONFIG_RTC_DRV_GENERIC */ 152 - #endif /* CONFIG M68KCLASSIC */ 152 + #endif /* CONFIG_M68KCLASSIC || SUN3 */ 153 153 154 154 void __init time_init(void) 155 155 {