Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux
[pandora-kernel.git] / arch / m68k / mac / debug.c
index 8399032..2165740 100644 (file)
 #include <asm/machw.h>
 #include <asm/macints.h>
 
-extern char m68k_debug_device[];
-
-extern struct compat_bootinfo compat_boot_info;
-
 extern unsigned long mac_videobase;
 extern unsigned long mac_videodepth;
 extern unsigned long mac_rowbytes;
@@ -55,6 +51,8 @@ extern void mac_serial_print(const char *);
 static int peng, line;
 #endif
 
+#if 0
+
 void mac_debugging_short(int pos, short num)
 {
 #ifdef DEBUG_SCREEN
@@ -75,7 +73,7 @@ void mac_debugging_short(int pos, short num)
 
        /* calculate current offset */
        pengoffset = (unsigned char *)mac_videobase +
-               (150+line*2) * mac_rowbytes) + 80 * peng;
+               (150+line*2) * mac_rowbytes + 80 * peng;
 
        pptr = pengoffset;
 
@@ -129,6 +127,8 @@ void mac_debugging_long(int pos, long addr)
 #endif
 }
 
+#endif  /*  0  */
+
 #ifdef DEBUG_SERIAL
 /*
  * TODO: serial debug code
@@ -146,12 +146,6 @@ struct mac_SCC {
 
 # define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase))
 
-/* Flag that serial port is already initialized and used */
-int mac_SCC_init_done;
-/* Can be set somewhere, if a SCC master reset has already be done and should
- * not be repeated; used by kgdb */
-int mac_SCC_reset_done;
-
 static int scc_port = -1;
 
 static struct console mac_console_driver = {
@@ -175,8 +169,8 @@ static struct console mac_console_driver = {
  * this driver if Mac.
  */
 
-void mac_debug_console_write(struct console *co, const char *str,
-                            unsigned int count)
+static void mac_debug_console_write(struct console *co, const char *str,
+                                   unsigned int count)
 {
        mac_serial_print(str);
 }
@@ -213,8 +207,8 @@ static inline void mac_scca_out(char c)
        scc.cha_a_data = c;
 }
 
-void mac_sccb_console_write(struct console *co, const char *str,
-                           unsigned int count)
+static void mac_sccb_console_write(struct console *co, const char *str,
+                                  unsigned int count)
 {
        while (count--) {
                if (*str == '\n')
@@ -223,8 +217,8 @@ void mac_sccb_console_write(struct console *co, const char *str,
        }
 }
 
-void mac_scca_console_write(struct console *co, const char *str,
-                           unsigned int count)
+static void mac_scca_console_write(struct console *co, const char *str,
+                                  unsigned int count)
 {
        while (count--) {
                if (*str == '\n')
@@ -269,14 +263,8 @@ void mac_scca_console_write(struct console *co, const char *str,
                    barrier();                          \
        } while(0)
 
-#ifndef CONFIG_SERIAL_CONSOLE
 static void __init mac_init_scc_port(int cflag, int port)
-#else
-void mac_init_scc_port(int cflag, int port)
-#endif
 {
-       extern int mac_SCC_reset_done;
-
        /*
         * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k
         */
@@ -344,32 +332,21 @@ void mac_init_scc_port(int cflag, int port)
                SCCA_WRITE(3, reg3 | 1);
                SCCA_WRITE(5, reg5 | 8);
        }
-
-       mac_SCC_reset_done = 1;
-       mac_SCC_init_done = 1;
 }
 #endif /* DEBUG_SERIAL */
 
-void mac_init_scca_port(int cflag)
+static int __init mac_debug_setup(char *arg)
 {
-       mac_init_scc_port(cflag, 0);
-}
+       if (!MACH_IS_MAC)
+               return 0;
 
-void mac_init_sccb_port(int cflag)
-{
-       mac_init_scc_port(cflag, 1);
-}
-
-void __init mac_debug_init(void)
-{
 #ifdef DEBUG_SERIAL
-       if (!strcmp(m68k_debug_device, "ser") ||
-            !strcmp(m68k_debug_device, "ser1")) {
+       if (!strcmp(arg, "ser") || !strcmp(arg, "ser1")) {
                /* Mac modem port */
                mac_init_scc_port(B9600|CS8, 0);
                mac_console_driver.write = mac_scca_console_write;
                scc_port = 0;
-       } else if (!strcmp(m68k_debug_device, "ser2")) {
+       } else if (!strcmp(arg, "ser2")) {
                /* Mac printer port */
                mac_init_scc_port(B9600|CS8, 1);
                mac_console_driver.write = mac_sccb_console_write;
@@ -377,12 +354,14 @@ void __init mac_debug_init(void)
        }
 #endif
 #ifdef DEBUG_HEADS
-       if (!strcmp(m68k_debug_device, "scn") ||
-           !strcmp(m68k_debug_device, "con")) {
+       if (!strcmp(arg, "scn") || !strcmp(arg, "con")) {
                /* display, using head.S console routines */
                mac_console_driver.write = mac_debug_console_write;
        }
 #endif
        if (mac_console_driver.write)
                register_console(&mac_console_driver);
+       return 0;
 }
+
+early_param("debug", mac_debug_setup);