Commit 1225fb90 authored by David S. Miller's avatar David S. Miller

SPARC: More keyboard/mouse/serial layer cleanups and build fixes.

parent db7bfefd
...@@ -740,10 +740,8 @@ void handler_irq(int irq, struct pt_regs *regs) ...@@ -740,10 +740,8 @@ void handler_irq(int irq, struct pt_regs *regs)
irq_enter(); irq_enter();
kstat.irqs[cpu][irq]++; kstat.irqs[cpu][irq]++;
#ifdef CONFIG_PCI
if (irq == 9) if (irq == 9)
kbd_pt_regs = regs; kbd_pt_regs = regs;
#endif
/* Sliiiick... */ /* Sliiiick... */
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/inet.h> #include <linux/inet.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/root_dev.h> #include <linux/root_dev.h>
#include <linux/interrupt.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -691,6 +692,8 @@ struct seq_operations cpuinfo_op = { ...@@ -691,6 +692,8 @@ struct seq_operations cpuinfo_op = {
.show = show_cpuinfo, .show = show_cpuinfo,
}; };
extern int stop_a_enabled;
void sun_do_break(void) void sun_do_break(void)
{ {
if (!stop_a_enabled) if (!stop_a_enabled)
...@@ -701,3 +704,20 @@ void sun_do_break(void) ...@@ -701,3 +704,20 @@ void sun_do_break(void)
prom_cmdline(); 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;
...@@ -364,6 +364,9 @@ EXPORT_SYMBOL_NOVERS(VISenter); ...@@ -364,6 +364,9 @@ EXPORT_SYMBOL_NOVERS(VISenter);
/* for input/keybdev */ /* for input/keybdev */
EXPORT_SYMBOL(sun_do_break); EXPORT_SYMBOL(sun_do_break);
EXPORT_SYMBOL(serial_console);
EXPORT_SYMBOL(stop_a_enabled);
EXPORT_SYMBOL(kbd_pt_regs);
#ifdef CONFIG_DEBUG_BUGVERBOSE #ifdef CONFIG_DEBUG_BUGVERBOSE
EXPORT_SYMBOL(do_BUG); EXPORT_SYMBOL(do_BUG);
......
...@@ -108,14 +108,18 @@ ifeq ($(CONFIG_QTRONIX_KEYBOARD),y) ...@@ -108,14 +108,18 @@ ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)
KEYMAP = qtronixmap.o KEYMAP = qtronixmap.o
endif 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_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o
#obj-$(CONFIG_SERIAL) += $(SERIAL) # Fix for decserial.o #obj-$(CONFIG_SERIAL) += $(SERIAL) # Fix for decserial.o
ifndef CONFIG_SUN_KEYBOARD obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
else
obj-$(CONFIG_PCI) += keyboard.o $(KEYMAP)
endif
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
......
...@@ -23,12 +23,8 @@ ...@@ -23,12 +23,8 @@
#include "suncore.h" #include "suncore.h"
int serial_console;
int stop_a_enabled = 1;
int sunserial_current_minor = 64; int sunserial_current_minor = 64;
EXPORT_SYMBOL(serial_console);
EXPORT_SYMBOL(stop_a_enabled);
EXPORT_SYMBOL(sunserial_current_minor); EXPORT_SYMBOL(sunserial_current_minor);
void void
......
...@@ -22,17 +22,8 @@ ...@@ -22,17 +22,8 @@
extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *); extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *);
extern int suncore_mouse_baud_detection(unsigned char, 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; extern int sunserial_current_minor;
static __inline__ int con_is_present(void)
{
return serial_console ? 0 : 1;
}
extern void sunserial_console_termios(struct console *); extern void sunserial_console_termios(struct console *);
#endif /* !(_SERIAL_SUN_H) */ #endif /* !(_SERIAL_SUN_H) */
...@@ -86,10 +86,6 @@ static struct tty_struct *sab82532_table[NR_PORTS]; ...@@ -86,10 +86,6 @@ static struct tty_struct *sab82532_table[NR_PORTS];
static struct termios *sab82532_termios[NR_PORTS]; static struct termios *sab82532_termios[NR_PORTS];
static struct termios *sab82532_termios_locked[NR_PORTS]; static struct termios *sab82532_termios_locked[NR_PORTS];
#ifdef MODULE
#undef CONFIG_SERIAL_CONSOLE
#endif
#ifdef CONFIG_SERIAL_CONSOLE #ifdef CONFIG_SERIAL_CONSOLE
extern int serial_console; extern int serial_console;
static struct console sab82532_console; static struct console sab82532_console;
...@@ -465,7 +461,7 @@ static void check_status(struct sab82532 *info, ...@@ -465,7 +461,7 @@ static void check_status(struct sab82532 *info,
if (stat->sreg.isr1 & SAB82532_ISR1_BRK) { if (stat->sreg.isr1 & SAB82532_ISR1_BRK) {
#ifdef CONFIG_SERIAL_CONSOLE #ifdef CONFIG_SERIAL_CONSOLE
if (info->is_console) { if (info->is_console) {
batten_down_hatches(info); sun_do_break(info);
return; return;
} }
#endif #endif
...@@ -874,7 +870,6 @@ static void shutdown(struct sab82532 *info) ...@@ -874,7 +870,6 @@ static void shutdown(struct sab82532 *info)
info->xmit.buf = 0; info->xmit.buf = 0;
} }
#ifdef CONFIG_SERIAL_CONSOLE
if (info->is_console) { if (info->is_console) {
info->interrupt_mask0 = SAB82532_IMR0_PERR | SAB82532_IMR0_FERR | info->interrupt_mask0 = SAB82532_IMR0_PERR | SAB82532_IMR0_FERR |
SAB82532_IMR0_PLLA | SAB82532_IMR0_CDSC; SAB82532_IMR0_PLLA | SAB82532_IMR0_CDSC;
...@@ -890,7 +885,6 @@ static void shutdown(struct sab82532 *info) ...@@ -890,7 +885,6 @@ static void shutdown(struct sab82532 *info)
restore_flags(flags); restore_flags(flags);
return; return;
} }
#endif
/* Disable Interrupts */ /* Disable Interrupts */
info->interrupt_mask0 = 0xff; info->interrupt_mask0 = 0xff;
...@@ -2460,48 +2454,6 @@ void cleanup_module(void) ...@@ -2460,48 +2454,6 @@ void cleanup_module(void)
#endif /* MODULE */ #endif /* MODULE */
#ifdef CONFIG_SERIAL_CONSOLE #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 static __inline__ void
sab82532_console_putchar(struct sab82532 *info, char c) sab82532_console_putchar(struct sab82532 *info, char c)
{ {
......
...@@ -13,38 +13,21 @@ ...@@ -13,38 +13,21 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/kernel.h> /* We use the generic input layer for keyboard handling, thus
#include <linux/kd.h> * some of this stuff should never be invoked.
*/
#define KEYBOARD_IRQ 1 #define kbd_setkeycode(scancode, keycode) (BUG(), 0)
#define DISABLE_KBD_DURING_INTERRUPTS 0 #define kbd_getkeycode(scancode) (BUG(), 0)
extern int pcikbd_setkeycode(unsigned int scancode, unsigned int keycode); #define kbd_translate(keycode, keycodep, raw_mode) \
extern int pcikbd_getkeycode(unsigned int scancode); ({ *(keycodep) = scancode; 1; })
extern int pcikbd_translate(unsigned char scancode, unsigned char *keycode, #define kbd_unexpected_up(keycode) (0200)
char raw_mode);
extern char pcikbd_unexpected_up(unsigned char keycode); #define kbd_leds(leds) do { } while (0)
extern void pcikbd_leds(unsigned char leds); #define kbd_init_hw() do { } while (0)
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
#define SYSRQ_KEY 0x54 #define SYSRQ_KEY 0x54
extern unsigned char kbd_sysrq_xlate[128];
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -121,6 +121,15 @@ enum sparc_cpu { ...@@ -121,6 +121,15 @@ enum sparc_cpu {
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void sun_do_break(void); 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); extern void synchronize_user_stack(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment