diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2007-05-01 16:32:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 20:59:06 -0400 |
commit | d6713b4091a99fa2af2fabdcd2f3fb97f32ecf2e (patch) | |
tree | 7cabd0ff35f9ec4413ba936ddb203d13dffb1550 /arch/m68k/atari | |
parent | f8744bc95dac461cef40df7143756d1bfa393991 (diff) |
m68k: early parameter support
Add early parameter support and convert current users to it.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/atari')
-rw-r--r-- | arch/m68k/atari/config.c | 17 | ||||
-rw-r--r-- | arch/m68k/atari/debug.c | 24 |
2 files changed, 23 insertions, 18 deletions
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index b10e7addae5c..e40e5dcaa347 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c | |||
@@ -69,9 +69,6 @@ extern int atari_tt_hwclk (int, struct rtc_time *); | |||
69 | extern int atari_mste_set_clock_mmss (unsigned long); | 69 | extern int atari_mste_set_clock_mmss (unsigned long); |
70 | extern int atari_tt_set_clock_mmss (unsigned long); | 70 | extern int atari_tt_set_clock_mmss (unsigned long); |
71 | 71 | ||
72 | /* atari specific debug functions (in debug.c) */ | ||
73 | extern void atari_debug_init(void); | ||
74 | |||
75 | 72 | ||
76 | /* ++roman: This is a more elaborate test for an SCC chip, since the plain | 73 | /* ++roman: This is a more elaborate test for an SCC chip, since the plain |
77 | * Medusa board generates DTACK at the SCC's standard addresses, but a SCC | 74 | * Medusa board generates DTACK at the SCC's standard addresses, but a SCC |
@@ -137,15 +134,18 @@ int __init atari_parse_bootinfo(const struct bi_record *record) | |||
137 | 134 | ||
138 | 135 | ||
139 | /* Parse the Atari-specific switches= option. */ | 136 | /* Parse the Atari-specific switches= option. */ |
140 | void __init atari_switches_setup(const char *str, unsigned len) | 137 | static int __init atari_switches_setup(char *str) |
141 | { | 138 | { |
142 | char switches[len+1]; | 139 | char switches[strlen(str) + 1]; |
143 | char *p; | 140 | char *p; |
144 | int ovsc_shift; | 141 | int ovsc_shift; |
145 | char *args = switches; | 142 | char *args = switches; |
146 | 143 | ||
144 | if (!MACH_IS_ATARI) | ||
145 | return 0; | ||
146 | |||
147 | /* copy string to local array, strsep works destructively... */ | 147 | /* copy string to local array, strsep works destructively... */ |
148 | strlcpy(switches, str, sizeof(switches)); | 148 | strcpy(switches, str); |
149 | atari_switches = 0; | 149 | atari_switches = 0; |
150 | 150 | ||
151 | /* parse the options */ | 151 | /* parse the options */ |
@@ -170,8 +170,11 @@ void __init atari_switches_setup(const char *str, unsigned len) | |||
170 | atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift; | 170 | atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | return 0; | ||
173 | } | 174 | } |
174 | 175 | ||
176 | early_param("switches", atari_switches_setup); | ||
177 | |||
175 | 178 | ||
176 | /* | 179 | /* |
177 | * Setup the Atari configuration info | 180 | * Setup the Atari configuration info |
@@ -183,8 +186,6 @@ void __init config_atari(void) | |||
183 | 186 | ||
184 | memset(&atari_hw_present, 0, sizeof(atari_hw_present)); | 187 | memset(&atari_hw_present, 0, sizeof(atari_hw_present)); |
185 | 188 | ||
186 | atari_debug_init(); | ||
187 | |||
188 | /* Change size of I/O space from 64KB to 4GB. */ | 189 | /* Change size of I/O space from 64KB to 4GB. */ |
189 | ioport_resource.end = 0xFFFFFFFF; | 190 | ioport_resource.end = 0xFFFFFFFF; |
190 | 191 | ||
diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c index 66983fe87509..fbeed8c8ecbc 100644 --- a/arch/m68k/atari/debug.c +++ b/arch/m68k/atari/debug.c | |||
@@ -19,8 +19,6 @@ | |||
19 | #include <asm/atarihw.h> | 19 | #include <asm/atarihw.h> |
20 | #include <asm/atariints.h> | 20 | #include <asm/atariints.h> |
21 | 21 | ||
22 | extern char m68k_debug_device[]; | ||
23 | |||
24 | /* Flag that Modem1 port is already initialized and used */ | 22 | /* Flag that Modem1 port is already initialized and used */ |
25 | int atari_MFP_init_done; | 23 | int atari_MFP_init_done; |
26 | /* Flag that Modem1 port is already initialized and used */ | 24 | /* Flag that Modem1 port is already initialized and used */ |
@@ -305,26 +303,28 @@ void atari_init_midi_port(int cflag) | |||
305 | ACIA_RHTID : ACIA_RLTID); | 303 | ACIA_RHTID : ACIA_RLTID); |
306 | } | 304 | } |
307 | 305 | ||
308 | void __init atari_debug_init(void) | 306 | static int __init atari_debug_setup(char *arg) |
309 | { | 307 | { |
310 | if (!strcmp(m68k_debug_device, "ser")) { | 308 | if (!MACH_IS_ATARI) |
309 | return 0; | ||
310 | |||
311 | if (!strcmp(arg, "ser")) | ||
311 | /* defaults to ser2 for a Falcon and ser1 otherwise */ | 312 | /* defaults to ser2 for a Falcon and ser1 otherwise */ |
312 | strcpy(m68k_debug_device, MACH_IS_FALCON ? "ser2" : "ser1"); | 313 | arg = MACH_IS_FALCON ? "ser2" : "ser1"; |
313 | } | ||
314 | 314 | ||
315 | if (!strcmp(m68k_debug_device, "ser1")) { | 315 | if (!strcmp(arg, "ser1")) { |
316 | /* ST-MFP Modem1 serial port */ | 316 | /* ST-MFP Modem1 serial port */ |
317 | atari_init_mfp_port(B9600|CS8); | 317 | atari_init_mfp_port(B9600|CS8); |
318 | atari_console_driver.write = atari_mfp_console_write; | 318 | atari_console_driver.write = atari_mfp_console_write; |
319 | } else if (!strcmp(m68k_debug_device, "ser2")) { | 319 | } else if (!strcmp(arg, "ser2")) { |
320 | /* SCC Modem2 serial port */ | 320 | /* SCC Modem2 serial port */ |
321 | atari_init_scc_port(B9600|CS8); | 321 | atari_init_scc_port(B9600|CS8); |
322 | atari_console_driver.write = atari_scc_console_write; | 322 | atari_console_driver.write = atari_scc_console_write; |
323 | } else if (!strcmp(m68k_debug_device, "midi")) { | 323 | } else if (!strcmp(arg, "midi")) { |
324 | /* MIDI port */ | 324 | /* MIDI port */ |
325 | atari_init_midi_port(B9600|CS8); | 325 | atari_init_midi_port(B9600|CS8); |
326 | atari_console_driver.write = atari_midi_console_write; | 326 | atari_console_driver.write = atari_midi_console_write; |
327 | } else if (!strcmp(m68k_debug_device, "par")) { | 327 | } else if (!strcmp(arg, "par")) { |
328 | /* parallel printer */ | 328 | /* parallel printer */ |
329 | atari_turnoff_irq(IRQ_MFP_BUSY); /* avoid ints */ | 329 | atari_turnoff_irq(IRQ_MFP_BUSY); /* avoid ints */ |
330 | sound_ym.rd_data_reg_sel = 7; /* select mixer control */ | 330 | sound_ym.rd_data_reg_sel = 7; /* select mixer control */ |
@@ -337,4 +337,8 @@ void __init atari_debug_init(void) | |||
337 | } | 337 | } |
338 | if (atari_console_driver.write) | 338 | if (atari_console_driver.write) |
339 | register_console(&atari_console_driver); | 339 | register_console(&atari_console_driver); |
340 | |||
341 | return 0; | ||
340 | } | 342 | } |
343 | |||
344 | early_param("debug", atari_debug_setup); | ||