summaryrefslogtreecommitdiff
path: root/arch/m68k/atari
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2007-05-02 00:32:45 +0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-05 04:59:06 +0400
commitd6713b4091a99fa2af2fabdcd2f3fb97f32ecf2e (patch)
tree7cabd0ff35f9ec4413ba936ddb203d13dffb1550 /arch/m68k/atari
parentf8744bc95dac461cef40df7143756d1bfa393991 (diff)
downloadlinux-d6713b4091a99fa2af2fabdcd2f3fb97f32ecf2e.tar.xz
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.c17
-rw-r--r--arch/m68k/atari/debug.c24
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 *);
extern int atari_mste_set_clock_mmss (unsigned long);
extern int atari_tt_set_clock_mmss (unsigned long);
-/* atari specific debug functions (in debug.c) */
-extern void atari_debug_init(void);
-
/* ++roman: This is a more elaborate test for an SCC chip, since the plain
* 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)
/* Parse the Atari-specific switches= option. */
-void __init atari_switches_setup(const char *str, unsigned len)
+static int __init atari_switches_setup(char *str)
{
- char switches[len+1];
+ char switches[strlen(str) + 1];
char *p;
int ovsc_shift;
char *args = switches;
+ if (!MACH_IS_ATARI)
+ return 0;
+
/* copy string to local array, strsep works destructively... */
- strlcpy(switches, str, sizeof(switches));
+ strcpy(switches, str);
atari_switches = 0;
/* parse the options */
@@ -170,8 +170,11 @@ void __init atari_switches_setup(const char *str, unsigned len)
atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
}
}
+ return 0;
}
+early_param("switches", atari_switches_setup);
+
/*
* Setup the Atari configuration info
@@ -183,8 +186,6 @@ void __init config_atari(void)
memset(&atari_hw_present, 0, sizeof(atari_hw_present));
- atari_debug_init();
-
/* Change size of I/O space from 64KB to 4GB. */
ioport_resource.end = 0xFFFFFFFF;
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 @@
#include <asm/atarihw.h>
#include <asm/atariints.h>
-extern char m68k_debug_device[];
-
/* Flag that Modem1 port is already initialized and used */
int atari_MFP_init_done;
/* Flag that Modem1 port is already initialized and used */
@@ -305,26 +303,28 @@ void atari_init_midi_port(int cflag)
ACIA_RHTID : ACIA_RLTID);
}
-void __init atari_debug_init(void)
+static int __init atari_debug_setup(char *arg)
{
- if (!strcmp(m68k_debug_device, "ser")) {
+ if (!MACH_IS_ATARI)
+ return 0;
+
+ if (!strcmp(arg, "ser"))
/* defaults to ser2 for a Falcon and ser1 otherwise */
- strcpy(m68k_debug_device, MACH_IS_FALCON ? "ser2" : "ser1");
- }
+ arg = MACH_IS_FALCON ? "ser2" : "ser1";
- if (!strcmp(m68k_debug_device, "ser1")) {
+ if (!strcmp(arg, "ser1")) {
/* ST-MFP Modem1 serial port */
atari_init_mfp_port(B9600|CS8);
atari_console_driver.write = atari_mfp_console_write;
- } else if (!strcmp(m68k_debug_device, "ser2")) {
+ } else if (!strcmp(arg, "ser2")) {
/* SCC Modem2 serial port */
atari_init_scc_port(B9600|CS8);
atari_console_driver.write = atari_scc_console_write;
- } else if (!strcmp(m68k_debug_device, "midi")) {
+ } else if (!strcmp(arg, "midi")) {
/* MIDI port */
atari_init_midi_port(B9600|CS8);
atari_console_driver.write = atari_midi_console_write;
- } else if (!strcmp(m68k_debug_device, "par")) {
+ } else if (!strcmp(arg, "par")) {
/* parallel printer */
atari_turnoff_irq(IRQ_MFP_BUSY); /* avoid ints */
sound_ym.rd_data_reg_sel = 7; /* select mixer control */
@@ -337,4 +337,8 @@ void __init atari_debug_init(void)
}
if (atari_console_driver.write)
register_console(&atari_console_driver);
+
+ return 0;
}
+
+early_param("debug", atari_debug_setup);