Skip to content

Commit 5d42a68

Browse files
arndbgeertu
authored andcommitted
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>
1 parent fc10edd commit 5d42a68

File tree

5 files changed

+31
-56
lines changed

5 files changed

+31
-56
lines changed

arch/m68k/Kconfig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,23 @@ config MMU
8484
support by paged memory management. If unsure, say 'Y'.
8585

8686
config MMU_MOTOROLA
87-
bool
87+
def_bool MMU && M68KCLASSIC
8888
select HAVE_PAGE_SIZE_4KB
8989

9090
config MMU_COLDFIRE
91+
def_bool MMU && COLDFIRE
9192
select HAVE_PAGE_SIZE_8KB
92-
bool
9393

9494
config MMU_SUN3
95-
bool
95+
def_bool MMU && SUN3
9696
select HAVE_PAGE_SIZE_8KB
97-
depends on MMU && !MMU_MOTOROLA && !MMU_COLDFIRE
9897

9998
config ARCH_SUPPORTS_KEXEC
100-
def_bool M68KCLASSIC && MMU
99+
def_bool (M68KCLASSIC || SUN3) && MMU
101100

102101
config BOOTINFO_PROC
103102
bool "Export bootinfo in procfs"
104-
depends on KEXEC && M68KCLASSIC
103+
depends on KEXEC && (M68KCLASSIC || SUN3)
105104
help
106105
Say Y to export the bootinfo used to boot the kernel in a
107106
"bootinfo" file in procfs. This is useful with kexec.

arch/m68k/Kconfig.cpu

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
comment "Processor Type"
33

44
choice
5-
prompt "CPU family support"
5+
prompt "CPU/machine family support"
66
default M68KCLASSIC if MMU
77
default COLDFIRE if !MMU
88
help
@@ -19,7 +19,7 @@ choice
1919
processor, select COLDFIRE.
2020

2121
config M68KCLASSIC
22-
bool "Classic M68K CPU family support"
22+
bool "Classic M68K CPU/machine family support"
2323
select HAVE_ARCH_PFN_VALID
2424

2525
config COLDFIRE
@@ -32,13 +32,23 @@ config COLDFIRE
3232
select HAVE_LEGACY_CLK
3333
select HAVE_PAGE_SIZE_8KB if !MMU
3434

35-
endchoice
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.
3647

37-
if M68KCLASSIC
48+
endchoice
3849

3950
config M68000
40-
def_bool y
41-
depends on !MMU
51+
def_bool M68KCLASSIC && !MMU
4252
select CPU_HAS_NO_BITFIELDS
4353
select CPU_HAS_NO_CAS
4454
select CPU_HAS_NO_MULDIV64
@@ -56,7 +66,7 @@ config M68000
5666
a paging MMU.
5767

5868
config M68020
59-
bool "68020 support"
69+
bool "68020 support" if M68KCLASSIC
6070
depends on MMU
6171
select FPU
6272
select CPU_HAS_ADDRESS_SPACES
@@ -66,9 +76,10 @@ config M68020
6676
68851 MMU (Memory Management Unit) to run Linux/m68k, except on the
6777
Sun 3, which provides its own version.
6878

79+
if M68KCLASSIC && MMU
80+
6981
config M68030
7082
bool "68030 support"
71-
depends on MMU && !MMU_SUN3
7283
select FPU
7384
select CPU_HAS_ADDRESS_SPACES
7485
help
@@ -78,7 +89,6 @@ config M68030
7889

7990
config M68040
8091
bool "68040 support"
81-
depends on MMU && !MMU_SUN3
8292
select FPU
8393
select CPU_HAS_ADDRESS_SPACES
8494
help
@@ -89,13 +99,14 @@ config M68040
8999

90100
config M68060
91101
bool "68060 support"
92-
depends on MMU && !MMU_SUN3
93102
select FPU
94103
select CPU_HAS_ADDRESS_SPACES
95104
help
96105
If you anticipate running this kernel on a computer with a MC68060
97106
processor, say Y. Otherwise, say N.
98107

108+
endif # M68KCLASSIC
109+
99110
config M68328
100111
bool
101112
depends on !MMU
@@ -117,8 +128,6 @@ config M68VZ328
117128
help
118129
Motorola 68VZ328 processor support.
119130

120-
endif # M68KCLASSIC
121-
122131
if COLDFIRE
123132

124133
choice
@@ -325,7 +334,7 @@ comment "Processor Specific Options"
325334

326335
config M68KFPU_EMU
327336
bool "Math emulation support"
328-
depends on M68KCLASSIC && FPU
337+
depends on (M68KCLASSIC || SUN3) && FPU
329338
help
330339
At some point in the future, this will cause floating-point math
331340
instructions to be emulated by the kernel on machines that lack a

arch/m68k/Kconfig.machine

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ if M68KCLASSIC
66
config AMIGA
77
bool "Amiga support"
88
depends on MMU
9-
select MMU_MOTOROLA if MMU
109
select LEGACY_TIMER_TICK
1110
help
1211
This option enables support for the Amiga series of computers. If
@@ -16,7 +15,6 @@ config AMIGA
1615
config ATARI
1716
bool "Atari support"
1817
depends on MMU
19-
select MMU_MOTOROLA if MMU
2018
select HAVE_ARCH_NVRAM_OPS
2119
select LEGACY_TIMER_TICK
2220
help
@@ -31,7 +29,6 @@ config ATARI_KBD_CORE
3129
config MAC
3230
bool "Macintosh support"
3331
depends on MMU
34-
select MMU_MOTOROLA if MMU
3532
select HAVE_ARCH_NVRAM_OPS
3633
select HAVE_PATA_PLATFORM
3734
select LEGACY_TIMER_TICK
@@ -44,7 +41,6 @@ config MAC
4441
config APOLLO
4542
bool "Apollo support"
4643
depends on MMU
47-
select MMU_MOTOROLA if MMU
4844
select LEGACY_TIMER_TICK
4945
help
5046
Say Y here if you want to run Linux on an MC680x0-based Apollo
@@ -53,7 +49,6 @@ config APOLLO
5349
config VME
5450
bool "VME (Motorola and BVM) support"
5551
depends on MMU
56-
select MMU_MOTOROLA if MMU
5752
help
5853
Say Y here if you want to build a kernel for a 680x0 based VME
5954
board. Boards currently supported include Motorola boards MVME147,
@@ -97,7 +92,6 @@ config BVME6000
9792
config HP300
9893
bool "HP9000/300 and HP9000/400 support"
9994
depends on MMU
100-
select MMU_MOTOROLA if MMU
10195
select LEGACY_TIMER_TICK
10296
help
10397
This option enables support for the HP9000/300 and HP9000/400 series
@@ -110,7 +104,6 @@ config SUN3X
110104
bool "Sun3x support"
111105
depends on MMU
112106
select LEGACY_TIMER_TICK
113-
select MMU_MOTOROLA if MMU
114107
select M68030
115108
help
116109
This option enables support for the Sun 3x series of workstations.
@@ -124,7 +117,6 @@ config SUN3X
124117
config Q40
125118
bool "Q40/Q60 support"
126119
depends on MMU
127-
select MMU_MOTOROLA if MMU
128120
select LEGACY_TIMER_TICK
129121
help
130122
The Q40 is a Motorola 68040-based successor to the Sinclair QL
@@ -133,22 +125,6 @@ config Q40
133125
Q60. Select your CPU below. For 68LC060 don't forget to enable FPU
134126
emulation.
135127

136-
config SUN3
137-
bool "Sun3 support"
138-
depends on MMU
139-
depends on !MMU_MOTOROLA
140-
select MMU_SUN3 if MMU
141-
select LEGACY_TIMER_TICK
142-
select NO_DMA
143-
select M68020
144-
help
145-
This option enables support for the Sun 3 series of workstations
146-
(3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
147-
that all other hardware types must be disabled, as Sun 3 kernels
148-
are incompatible with all other m68k targets (including Sun 3x!).
149-
150-
If you don't want to compile a kernel exclusively for a Sun 3, say N.
151-
152128
config VIRT
153129
bool "Virtual M68k Machine support"
154130
depends on MMU
@@ -157,7 +133,6 @@ config VIRT
157133
select GOLDFISH_TIMER
158134
select GOLDFISH_TTY
159135
select M68040
160-
select MMU_MOTOROLA if MMU
161136
select RTC_CLASS
162137
select RTC_DRV_GOLDFISH
163138
select TTY

arch/m68k/kernel/Makefile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,8 @@
55

66
extra-y += vmlinux.lds
77

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
1810

1911
obj-y += entry.o irq.o module.o process.o ptrace.o
2012
obj-y += setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o

arch/m68k/kernel/time.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void timer_heartbeat(void)
6262
}
6363
#endif /* CONFIG_HEARTBEAT */
6464

65-
#ifdef CONFIG_M68KCLASSIC
65+
#if defined(CONFIG_M68KCLASSIC) || defined(CONFIG_SUN3)
6666
/* machine dependent timer functions */
6767
int (*mach_hwclk) (int, struct rtc_time*);
6868
EXPORT_SYMBOL(mach_hwclk);
@@ -149,7 +149,7 @@ static int __init rtc_init(void)
149149

150150
module_init(rtc_init);
151151
#endif /* CONFIG_RTC_DRV_GENERIC */
152-
#endif /* CONFIG M68KCLASSIC */
152+
#endif /* CONFIG_M68KCLASSIC || SUN3 */
153153

154154
void __init time_init(void)
155155
{

0 commit comments

Comments
 (0)