15 #include <linux/types.h>
16 #include <linux/kernel.h>
19 #include <linux/tty.h>
21 #include <linux/rtc.h>
27 #include <linux/module.h>
28 #include <linux/keyboard.h>
30 #include <asm/bootinfo.h>
31 #include <asm/setup.h>
32 #include <asm/pgtable.h>
37 #include <asm/machdep.h>
40 static unsigned long amiga_model;
54 static unsigned char amiga_psfreq;
92 static char amiga_model_name[13] =
"Amiga ";
95 static void amiga_get_model(
char *model);
96 static void amiga_get_hardware_list(
struct seq_file *
m);
98 static unsigned long amiga_gettimeoffset(
void);
100 static void amiga_reset(
void);
102 static void amiga_mem_console_write(
struct console *co,
const char *
b,
104 #ifdef CONFIG_HEARTBEAT
105 static void amiga_heartbeat(
int on);
108 static struct console amiga_console_driver = {
123 .name =
"CIA B", .start = 0x00bfd000, .end = 0x00bfdfff
126 .name =
"CIA A", .start = 0x00bfe000, .end = 0x00bfefff
129 .name =
"Custom I/O", .start = 0x00dff000, .end = 0x00dfffff
132 .name =
"Kickstart ROM", .start = 0x00f80000, .end = 0x00ffffff
146 const unsigned long *
data = record->
data;
148 switch (record->
tag) {
170 amiga_psfreq = *(
const unsigned char *)data;
182 dev->resource.end = dev->resource.start + cd->
cd_BoardSize - 1;
184 printk(
"amiga_parse_bootinfo: too many AutoConfig devices\n");
202 static void __init amiga_identify(
void)
210 printk(
"Amiga hardware found: ");
216 switch (amiga_model) {
315 panic(
"No support for Draco yet");
318 panic(
"Unknown Amiga Model");
321 #define AMIGAHW_ANNOUNCE(name, str) \
322 if (AMIGAHW_PRESENT(name)) \
358 #undef AMIGAHW_ANNOUNCE
373 for (i = 0; i < 4; i++)
390 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
394 #ifdef CONFIG_HEARTBEAT
409 u32 disabled_z2mem = 0;
415 printk(
"Warning: kernel runs in Zorro II memory\n");
426 printk(
"%dK of Zorro II memory will not be used as system memory\n",
432 ram_resource[
i].name =
433 (
m68k_memory[
i].addr >= 0x01000000) ?
"32-bit Fast RAM" :
453 *(
unsigned char *)
ZTWO_VADDR(0xde0002) |= 0x80;
456 static unsigned short jiffy_ticks;
460 static struct resource sched_res = {
461 .
name =
"timer", .start = 0x00bfd400, .end = 0x00bfd5ff,
466 printk(
"Cannot allocate ciab.ta{lo,hi}\n");
468 ciab.talo = jiffy_ticks % 256;
469 ciab.tahi = jiffy_ticks / 256;
477 pr_err(
"Couldn't register timer interrupt\n");
482 #define TICK_SIZE 10000
485 static unsigned long amiga_gettimeoffset(
void)
487 unsigned short hi,
lo, hi2;
500 ticks = hi << 8 | lo;
502 if (ticks > jiffy_ticks / 2)
507 ticks = jiffy_ticks -
ticks;
508 ticks = (10000 *
ticks) / jiffy_ticks;
515 static
void amiga_reset(
void)
517 unsigned long jmp_addr040 =
virt_to_phys(&&jmp_addr_label040);
518 unsigned long jmp_addr =
virt_to_phys(&&jmp_addr_label);
527 " and.l #0xff000000,%%d0\n"
528 " or.w #0xe020,%%d0\n"
530 " movec %%d0,%%itt0\n"
531 " movec %%d0,%%dtt0\n"
564 " move.w #0x2700,%sr\n"
565 " lea 0x01000000,%a0\n"
566 " sub.l %a0@(-0x14),%a0\n"
567 " move.l %a0@(4),%a0\n"
585 #define SAVEKMSG_MAXMEM 128*1024
587 #define SAVEKMSG_MAGIC1 0x53415645
588 #define SAVEKMSG_MAGIC2 0x4B4D5347
600 static void amiga_mem_console_write(
struct console *co,
const char *
s,
609 static int __init amiga_savekmsg_setup(
char *
arg)
615 pr_err(
"Not enough chipram for debugging\n");
627 amiga_console_driver.
write = amiga_mem_console_write;
634 static void amiga_serial_putc(
char c)
641 static void amiga_serial_console_write(
struct console *co,
const char *
s,
646 amiga_serial_putc(
'\r');
647 amiga_serial_putc(*s++);
652 void amiga_serial_puts(
const char *s)
654 amiga_serial_console_write(
NULL, s,
strlen(s));
657 int amiga_serial_console_wait_key(
struct console *co)
669 void amiga_serial_gets(
struct console *co,
char *s,
int len)
674 ch = amiga_serial_console_wait_key(co);
677 if (ch == 8 || ch == 127) {
679 amiga_serial_putc(
'\007');
683 amiga_serial_puts(
"\010 \010");
688 if (ch == 10 || ch == 13)
692 if (cnt >= len + 1) {
693 amiga_serial_putc(7);
700 amiga_serial_putc(ch);
703 amiga_serial_puts(
"\r\n");
708 static int __init amiga_debug_setup(
char *arg)
712 amiga_console_driver.
write = amiga_serial_console_write;
720 #ifdef CONFIG_HEARTBEAT
721 static void amiga_heartbeat(
int on)
734 static void amiga_get_model(
char *model)
736 strcpy(model, amiga_model_name);
740 static void amiga_get_hardware_list(
struct seq_file *
m)
744 seq_printf(m,
"PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n",
759 type =
"Old or Unknown";
765 #define AMIGAHW_ANNOUNCE(name, str) \
766 if (AMIGAHW_PRESENT(name)) \
767 seq_printf (m, "\t%s\n", str)
802 seq_printf(m,
"\tZorro II%s AutoConfig: %d Expansion "
808 #undef AMIGAHW_ANNOUNCE
815 #ifdef CONFIG_HW_CONSOLE