]> git.neil.brown.name Git - history.git/commitdiff
SPARC: More keyboard/mouse/serial layer cleanups and build fixes.
authorDavid S. Miller <davem@nuts.ninka.net>
Thu, 1 Aug 2002 09:52:02 +0000 (02:52 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Thu, 1 Aug 2002 09:52:02 +0000 (02:52 -0700)
arch/sparc64/kernel/irq.c
arch/sparc64/kernel/setup.c
arch/sparc64/kernel/sparc64_ksyms.c
drivers/char/Makefile
drivers/serial/suncore.c
drivers/serial/suncore.h
drivers/serial/sunsab.c
include/asm-sparc64/keyboard.h
include/asm-sparc64/system.h

index 6ab2e997a71e384ece33f6b40186810fe99d23c2..10f4fb5418aa0d9a043e056ab4e18dbd1f2cd556 100644 (file)
@@ -740,10 +740,8 @@ void handler_irq(int irq, struct pt_regs *regs)
        irq_enter();
        kstat.irqs[cpu][irq]++;
 
-#ifdef CONFIG_PCI
        if (irq == 9)
                kbd_pt_regs = regs;
-#endif
 
        /* Sliiiick... */
 #ifndef CONFIG_SMP
index a1f0154b6f30081bb696148f6e29bba068635ccb..1f1d5414e21edd6ce5c5ff9e3efcd9f235c99915 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/inet.h>
 #include <linux/console.h>
 #include <linux/root_dev.h>
+#include <linux/interrupt.h>
 
 #include <asm/segment.h>
 #include <asm/system.h>
@@ -691,6 +692,8 @@ struct seq_operations cpuinfo_op = {
        .show = show_cpuinfo,
 };
 
+extern int stop_a_enabled;
+
 void sun_do_break(void)
 {
        if (!stop_a_enabled)
@@ -701,3 +704,20 @@ void sun_do_break(void)
 
        prom_cmdline();
 }
+
+#ifdef CONFIG_MAGIC_SYSRQ
+/* Because we use the generic input layer keyboard drivers for
+ * everything, this PC sysrq translation table is all we need.
+ */
+unsigned char kbd_sysrq_xlate[128] =
+       "\000\0331234567890-=\177\t"                    /* 0x00 - 0x0f */
+       "qwertyuiop[]\r\000as"                          /* 0x10 - 0x1f */
+       "dfghjkl;'`\000\\zxcv"                          /* 0x20 - 0x2f */
+       "bnm,./\000*\000 \000\201\202\203\204\205"      /* 0x30 - 0x3f */
+       "\206\207\210\211\212\000\000789-456+1"         /* 0x40 - 0x4f */
+       "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
+       "\r\000/";                                      /* 0x60 - 0x6f */
+#endif
+
+int serial_console;
+int stop_a_enabled = 1;
index a8e4794afa20361cbac2bebb1e29e07fcc75e134..eaa75121714c1a8fb7c347323bc0dc5e400ccd6a 100644 (file)
@@ -364,6 +364,9 @@ EXPORT_SYMBOL_NOVERS(VISenter);
 
 /* for input/keybdev */
 EXPORT_SYMBOL(sun_do_break);
+EXPORT_SYMBOL(serial_console);
+EXPORT_SYMBOL(stop_a_enabled);
+EXPORT_SYMBOL(kbd_pt_regs);
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 EXPORT_SYMBOL(do_BUG);
index c87477e365096b869690e633010c8c99c66e0361..43f99c3ad7267d10972c648e78ea948dcc29d619 100644 (file)
@@ -108,14 +108,18 @@ ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)
   KEYMAP   = qtronixmap.o
 endif
 
+ifeq ($(CONFIG_SPARC32),y)
+  KEYBD    =
+endif
+
+ifeq ($(CONFIG_SPARC64),y)
+  KEYBD    =
+endif
+
 obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o
 #obj-$(CONFIG_SERIAL) += $(SERIAL) # Fix for decserial.o
 
-ifndef CONFIG_SUN_KEYBOARD
-  obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
-else
-  obj-$(CONFIG_PCI) += keyboard.o $(KEYMAP)
-endif
+obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
 
 obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
 obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
index b0ff8451c307704f79129c3db391655206fa8e9f..93909ed99fd8882909987ce78f26493604184632 100644 (file)
 
 #include "suncore.h"
 
-int serial_console;
-int stop_a_enabled = 1;
 int sunserial_current_minor = 64;
 
-EXPORT_SYMBOL(serial_console);
-EXPORT_SYMBOL(stop_a_enabled);
 EXPORT_SYMBOL(sunserial_current_minor);
 
 void
index cb5325f6de4fc96961a53bcb0d52d789010a0e3f..513916a8ce376f4f25796be7ac8bd942f38ef4ef 100644 (file)
 extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *);
 extern int suncore_mouse_baud_detection(unsigned char, int);
 
-extern struct pt_regs *kbd_pt_regs;
-
-extern int serial_console;
-extern int stop_a_enabled;
 extern int sunserial_current_minor;
 
-static __inline__ int con_is_present(void)
-{
-       return serial_console ? 0 : 1;
-}
-
 extern void sunserial_console_termios(struct console *);
 
 #endif /* !(_SERIAL_SUN_H) */
index 4c30f0f24f4c4a51f108a6bdcf60519a048b4516..0bb00e0b2e7afe3af94001cd0ae4fe910a32947f 100644 (file)
@@ -86,10 +86,6 @@ static struct tty_struct *sab82532_table[NR_PORTS];
 static struct termios *sab82532_termios[NR_PORTS];
 static struct termios *sab82532_termios_locked[NR_PORTS];
 
-#ifdef MODULE
-#undef CONFIG_SERIAL_CONSOLE
-#endif
-
 #ifdef CONFIG_SERIAL_CONSOLE
 extern int serial_console;
 static struct console sab82532_console;
@@ -465,7 +461,7 @@ static void check_status(struct sab82532 *info,
        if (stat->sreg.isr1 & SAB82532_ISR1_BRK) {
 #ifdef CONFIG_SERIAL_CONSOLE
                if (info->is_console) {
-                       batten_down_hatches(info);
+                       sun_do_break(info);
                        return;
                }
 #endif
@@ -874,7 +870,6 @@ static void shutdown(struct sab82532 *info)
                info->xmit.buf = 0;
        }
 
-#ifdef CONFIG_SERIAL_CONSOLE
        if (info->is_console) {
                info->interrupt_mask0 = SAB82532_IMR0_PERR | SAB82532_IMR0_FERR |
                                        SAB82532_IMR0_PLLA | SAB82532_IMR0_CDSC;
@@ -890,7 +885,6 @@ static void shutdown(struct sab82532 *info)
                restore_flags(flags);
                return;
        }
-#endif
 
        /* Disable Interrupts */
        info->interrupt_mask0 = 0xff;
@@ -2460,48 +2454,6 @@ void cleanup_module(void)
 #endif /* MODULE */
 
 #ifdef CONFIG_SERIAL_CONSOLE
-static void
-batten_down_hatches(struct sab82532 *info)
-{
-       unsigned char saved_rfc, tmp;
-
-       if (!stop_a_enabled)
-               return;
-
-       /* If we are doing kadb, we call the debugger
-        * else we just drop into the boot monitor.
-        * Note that we must flush the user windows
-        * first before giving up control.
-        */
-       printk("\n");
-       flush_user_windows();
-
-       /*
-        * Set FIFO to single character mode.
-        */
-       saved_rfc = readb(&info->regs->r.rfc);
-       tmp = readb(&info->regs->rw.rfc);
-       tmp &= ~(SAB82532_RFC_RFDF);
-       writeb(tmp, &info->regs->rw.rfc);
-       sab82532_cec_wait(info);
-       writeb(SAB82532_CMDR_RRES, &info->regs->w.cmdr);
-
-#ifndef __sparc_v9__
-       if ((((unsigned long)linux_dbvec) >= DEBUG_FIRSTVADDR) &&
-           (((unsigned long)linux_dbvec) <= DEBUG_LASTVADDR))
-               sp_enter_debugger();
-       else
-#endif
-               prom_cmdline();
-
-       /*
-        * Reset FIFO to character + status mode.
-        */
-       writeb(saved_rfc, &info->regs->w.rfc);
-       sab82532_cec_wait(info);
-       writeb(SAB82532_CMDR_RRES, &info->regs->w.cmdr);
-}
-
 static __inline__ void
 sab82532_console_putchar(struct sab82532 *info, char c)
 {
index fc81294da408ce47caeed3a6f17767483bd31e84..a6276750584377b8f6e11d6a219dc469a64243a7 100644 (file)
 
 #ifdef __KERNEL__
 
-#include <linux/kernel.h>
-#include <linux/kd.h>
-
-#define KEYBOARD_IRQ                   1
-#define DISABLE_KBD_DURING_INTERRUPTS  0
-
-extern int pcikbd_setkeycode(unsigned int scancode, unsigned int keycode);
-extern int pcikbd_getkeycode(unsigned int scancode);
-extern int pcikbd_translate(unsigned char scancode, unsigned char *keycode,
-                           char raw_mode);
-extern char pcikbd_unexpected_up(unsigned char keycode);
-extern void pcikbd_leds(unsigned char leds);
-extern void pcikbd_init_hw(void);
-extern unsigned char pcikbd_sysrq_xlate[128];
-
-#define kbd_setkeycode                 pcikbd_setkeycode
-#define kbd_getkeycode                 pcikbd_getkeycode
-#define kbd_translate                  pcikbd_translate
-#define kbd_unexpected_up              pcikbd_unexpected_up
-#define kbd_leds                       pcikbd_leds
-#define kbd_init_hw                    pcikbd_init_hw
-#define kbd_sysrq_xlate                        pcikbd_sysrq_xlate
-#define kbd_init                       pcikbd_init
-
-#define compute_shiftstate             pci_compute_shiftstate
-#define getkeycode                     pci_getkeycode
-#define setkeycode                     pci_setkeycode
-#define getledstate                    pci_getledstate
-#define setledstate                    pci_setledstate
-#define register_leds                  pci_register_leds
+/* We use the generic input layer for keyboard handling, thus
+ * some of this stuff should never be invoked.
+ */
+#define kbd_setkeycode(scancode, keycode)      (BUG(), 0)
+#define kbd_getkeycode(scancode)               (BUG(), 0)
+
+#define kbd_translate(keycode, keycodep, raw_mode) \
+       ({ *(keycodep) = scancode; 1; })
+#define kbd_unexpected_up(keycode)             (0200)
+
+#define kbd_leds(leds)                         do { } while (0)
+#define kbd_init_hw()                          do { } while (0)
 
 #define SYSRQ_KEY 0x54
+extern unsigned char kbd_sysrq_xlate[128];
 
 #endif /* __KERNEL__ */
 
index 0b8b221f473ec9ef920c2a596ba39a964ba86377..d45bd823c1cb05319808f84293c1c095ff7d64b3 100644 (file)
@@ -121,6 +121,15 @@ enum sparc_cpu {
 #ifndef __ASSEMBLY__
 
 extern void sun_do_break(void);
+extern int serial_console;
+extern int stop_a_enabled;
+
+static __inline__ int con_is_present(void)
+{
+       return serial_console ? 0 : 1;
+}
+
+extern struct pt_regs *kbd_pt_regs;
 
 extern void synchronize_user_stack(void);