15 #include <linux/types.h>
16 #include <linux/kernel.h>
18 #include <linux/tty.h>
20 #include <linux/linkage.h>
24 #include <linux/rtc.h>
31 #include <asm/bootinfo.h>
32 #include <asm/pgtable.h>
33 #include <asm/setup.h>
35 #include <asm/traps.h>
36 #include <asm/machdep.h>
40 static void q40_get_model(
char *model);
43 static unsigned long q40_gettimeoffset(
void);
44 static int q40_hwclk(
int,
struct rtc_time *);
45 static unsigned int q40_get_ss(
void);
46 static int q40_set_clock_mmss(
unsigned long);
50 extern void q40_mksound(
unsigned int ,
unsigned int );
52 static void q40_mem_console_write(
struct console *co,
const char *
b,
57 static struct console q40_console_driver = {
59 .write = q40_mem_console_write,
69 static void q40_mem_console_write(
struct console *co,
const char *
s,
74 if (count < _cpleft) {
83 static int __init q40_debug_setup(
char *
arg)
88 _cpleft = 2000 - ((
long)q40_mem_cptr-0xff020000) / 4;
97 void printq40(
char *
str)
102 while (l-- > 0 && _cpleft-- > 0) {
112 #ifdef CONFIG_HEARTBEAT
113 static void q40_heartbeat(
int on)
125 static void q40_reset(
void)
128 printk(
"\n\n*******************************************\n"
129 "Called q40_reset : press the RESET button!!\n"
130 "*******************************************\n");
136 static void q40_halt(
void)
139 printk(
"\n\n*******************\n"
141 "*******************\n");
147 static void q40_get_model(
char *model)
152 static unsigned int serports[] =
154 0x3f8,0x2f8,0x3e8,0x2e8,0
157 static void q40_disable_irqs(
void)
162 while ((i = serports[j++]))
183 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
186 #ifdef CONFIG_HEARTBEAT
207 static unsigned long q40_gettimeoffset(
void)
265 static unsigned int q40_get_ss(
void)
275 static int q40_set_clock_mmss(
unsigned long nowtime)
278 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
284 if ((rtc_minutes < real_minutes ?
285 real_minutes - rtc_minutes :
286 rtc_minutes - real_minutes) < 30) {
299 #define Q40_RTC_PLL_MASK ((1<<5)-1)
300 #define Q40_RTC_PLL_SIGN (1<<5)
333 static __init int q40_add_kbd_device(
void)
340 pdev = platform_device_register_simple(
"q40kbd", -1,
NULL, 0);
341 return PTR_RET(pdev);