Skip to content

Commit 8b22820

Browse files
arndbGreg Ungerer
authored andcommitted
m68k: m68328: remove duplicate code
Building a kernel with multiple dragonball based boards enabled needlessly causes a link failure because of duplicate config_BSP() functions between the CPU versions. Avoid that merging the three almost identical files into one, and hiding the CPU configuration behind the board config. The pr_info() lines are consolidated in one place. It is still not possible to run a kernel configured for more than one board, but at least configurations that can be selected can also be built now. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
1 parent a734bbf commit 8b22820

File tree

7 files changed

+43
-151
lines changed

7 files changed

+43
-151
lines changed

arch/m68k/68000/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010

1111
# 68328, 68EZ328, 68VZ328
1212

13-
obj-y += entry.o ints.o timers.o
14-
obj-$(CONFIG_M68328) += m68328.o
15-
obj-$(CONFIG_M68EZ328) += m68EZ328.o
16-
obj-$(CONFIG_M68VZ328) += m68VZ328.o
13+
obj-y += entry.o ints.o timers.o m68328.o
1714
obj-$(CONFIG_ROM) += romvec.o
1815

1916
obj-$(CONFIG_DRAGEN2) += dragen2.o

arch/m68k/68000/m68328.c

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/***************************************************************************/
22

33
/*
4-
* m68328.c - 68328 specific config
4+
* m68328.c - 68328/68EZ328/68VZ328 specific config
55
*
66
* Copyright (C) 1993 Hamish Macdonald
77
* Copyright (C) 1999 D. Jeff Dionne
8+
* Copyright (C) 2001 Georges Menie, Ken Desmet
89
*
910
* This file is subject to the terms and conditions of the GNU General Public
1011
* License. See the file COPYING in the main directory of this archive
@@ -20,19 +21,18 @@
2021
#include <linux/kernel.h>
2122
#include <linux/rtc.h>
2223
#include <asm/machdep.h>
23-
#include <asm/MC68328.h>
24-
#if defined(CONFIG_PILOT) || defined(CONFIG_INIT_LCD)
24+
25+
#if defined(CONFIG_INIT_LCD) && defined(CONFIG_M68VZ328)
26+
#include "bootlogo-vz.h"
27+
#elif defined(CONFIG_PILOT) || defined(CONFIG_INIT_LCD)
2528
#include "bootlogo.h"
2629
#endif
2730

2831
#include "m68328.h"
2932

3033
/***************************************************************************/
3134

32-
33-
/***************************************************************************/
34-
35-
void m68328_reset (void)
35+
static void m68328_reset(void)
3636
{
3737
local_irq_disable();
3838
asm volatile ("moveal #0x10c00000, %a0;\n\t"
@@ -46,12 +46,19 @@ void m68328_reset (void)
4646

4747
void __init config_BSP(char *command, int len)
4848
{
49-
pr_info("68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
50-
pr_info("68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
51-
pr_info("68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
49+
mach_sched_init = hw_timer_init;
50+
mach_hwclk = m68328_hwclk;
51+
mach_reset = m68328_reset;
5252

53-
mach_hwclk = m68328_hwclk;
54-
mach_reset = m68328_reset;
53+
#if defined(CONFIG_PILOT) && defined(CONFIG_M68328)
54+
mach_sched_init = NULL;
55+
#elif defined(CONFIG_UCSIMM)
56+
init_ucsimm(command, len);
57+
#elif defined(CONFIG_UCDIMM)
58+
init_ucsimm(command, len);
59+
#elif defined(CONFIG_DRAGEN2)
60+
init_dragen2(command, len);
61+
#endif
5562
}
5663

5764
/***************************************************************************/

arch/m68k/68000/m68EZ328.c

Lines changed: 0 additions & 58 deletions
This file was deleted.

arch/m68k/68000/m68VZ328.c

Lines changed: 0 additions & 67 deletions
This file was deleted.

arch/m68k/Kconfig.cpu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ endchoice
3535
if M68KCLASSIC
3636

3737
config M68000
38-
bool "MC68000"
38+
bool
3939
depends on !MMU
4040
select CPU_HAS_NO_BITFIELDS
4141
select CPU_HAS_NO_MULDIV64
@@ -102,21 +102,21 @@ config M68060
102102
processor, say Y. Otherwise, say N.
103103

104104
config M68328
105-
bool "MC68328"
105+
bool
106106
depends on !MMU
107107
select M68000
108108
help
109109
Motorola 68328 processor support.
110110

111111
config M68EZ328
112-
bool "MC68EZ328"
112+
bool
113113
depends on !MMU
114114
select M68000
115115
help
116116
Motorola 68EX328 processor support.
117117

118118
config M68VZ328
119-
bool "MC68VZ328"
119+
bool
120120
depends on !MMU
121121
select M68000
122122
help

arch/m68k/Kconfig.machine

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,13 @@ config SUN3
136136

137137
If you don't want to compile a kernel exclusively for a Sun 3, say N.
138138

139-
endif # M68KCLASSIC
140-
141139
config PILOT
142140
bool
143141

144142
config PILOT3
145143
bool "Pilot 1000/5000, PalmPilot Personal/Pro, or PalmIII support"
146-
depends on M68328
144+
depends on !MMU
145+
select M68328
147146
select PILOT
148147
help
149148
Support for the Palm Pilot 1000/5000, Personal/Pro and PalmIII.
@@ -156,19 +155,22 @@ config XCOPILOT_BUGS
156155

157156
config UCSIMM
158157
bool "uCsimm module support"
159-
depends on M68EZ328
158+
depends on !MMU
159+
select M68EZ328
160160
help
161161
Support for the Arcturus Networks uCsimm module.
162162

163163
config UCDIMM
164164
bool "uDsimm module support"
165-
depends on M68VZ328
165+
depends on !MMU
166+
select M68VZ328
166167
help
167168
Support for the Arcturus Networks uDsimm module.
168169

169170
config DRAGEN2
170171
bool "DragenEngine II board support"
171-
depends on M68VZ328
172+
depends on !MMU
173+
select M68VZ328
172174
help
173175
Support for the DragenEngine II board.
174176

@@ -191,6 +193,8 @@ config MEMORY_RESERVE
191193
help
192194
Reserve certain memory regions on 68x328 based boards.
193195

196+
endif # M68KCLASSIC
197+
194198
config ARN5206
195199
bool "Arnewsh 5206 board support"
196200
depends on M5206

arch/m68k/kernel/setup_no.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,16 @@ void __init setup_arch(char **cmdline_p)
106106
#ifdef CONFIG_UCDIMM
107107
pr_info("uCdimm by Lineo, Inc. <www.lineo.com>\n");
108108
#endif
109+
#ifdef CONFIG_M68328
110+
pr_info("68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
111+
pr_info("68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
112+
#endif
113+
#ifdef CONFIG_M68EZ328
114+
pr_info("68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n");
115+
#endif
109116
#ifdef CONFIG_M68VZ328
110117
pr_info("M68VZ328 support by Evan Stawnyczy <e@lineo.ca>\n");
118+
pr_info("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
111119
#endif
112120
#ifdef CONFIG_COLDFIRE
113121
pr_info("COLDFIRE port done by Greg Ungerer, gerg@snapgear.com\n");
@@ -121,6 +129,7 @@ void __init setup_arch(char **cmdline_p)
121129
pr_info("Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n");
122130

123131
#if defined( CONFIG_PILOT ) && defined( CONFIG_M68328 )
132+
pr_info("68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
124133
pr_info("TRG SuperPilot FLASH card support <info@trgnet.com>\n");
125134
#endif
126135
#if defined( CONFIG_PILOT ) && defined( CONFIG_M68EZ328 )

0 commit comments

Comments
 (0)