aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/amiga/config.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2007-05-01 16:32:45 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 20:59:06 -0400
commitd6713b4091a99fa2af2fabdcd2f3fb97f32ecf2e (patch)
tree7cabd0ff35f9ec4413ba936ddb203d13dffb1550 /arch/m68k/amiga/config.c
parentf8744bc95dac461cef40df7143756d1bfa393991 (diff)
m68k: early parameter support
Add early parameter support and convert current users to it. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/amiga/config.c')
-rw-r--r--arch/m68k/amiga/config.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index c3b69b1b0ce..35748531327 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -79,8 +79,6 @@ static char *amiga_models[] __initdata = {
79 79
80static char amiga_model_name[13] = "Amiga "; 80static char amiga_model_name[13] = "Amiga ";
81 81
82extern char m68k_debug_device[];
83
84static void amiga_sched_init(irq_handler_t handler); 82static void amiga_sched_init(irq_handler_t handler);
85/* amiga specific irq functions */ 83/* amiga specific irq functions */
86extern void amiga_init_IRQ(void); 84extern void amiga_init_IRQ(void);
@@ -95,12 +93,10 @@ static unsigned int amiga_get_ss(void);
95extern void amiga_mksound(unsigned int count, unsigned int ticks); 93extern void amiga_mksound(unsigned int count, unsigned int ticks);
96static void amiga_reset(void); 94static void amiga_reset(void);
97extern void amiga_init_sound(void); 95extern void amiga_init_sound(void);
98static void amiga_savekmsg_init(void);
99static void amiga_mem_console_write(struct console *co, const char *b, 96static void amiga_mem_console_write(struct console *co, const char *b,
100 unsigned int count); 97 unsigned int count);
101void amiga_serial_console_write(struct console *co, const char *s, 98void amiga_serial_console_write(struct console *co, const char *s,
102 unsigned int count); 99 unsigned int count);
103static void amiga_debug_init(void);
104#ifdef CONFIG_HEARTBEAT 100#ifdef CONFIG_HEARTBEAT
105static void amiga_heartbeat(int on); 101static void amiga_heartbeat(int on);
106#endif 102#endif
@@ -370,7 +366,6 @@ void __init config_amiga(void)
370{ 366{
371 int i; 367 int i;
372 368
373 amiga_debug_init();
374 amiga_identify(); 369 amiga_identify();
375 370
376 /* Yuk, we don't have PCI memory */ 371 /* Yuk, we don't have PCI memory */
@@ -458,17 +453,6 @@ void __init config_amiga(void)
458 /* initialize chipram allocator */ 453 /* initialize chipram allocator */
459 amiga_chip_init(); 454 amiga_chip_init();
460 455
461 /* debugging using chipram */
462 if (!strcmp(m68k_debug_device, "mem")) {
463 if (!AMIGAHW_PRESENT(CHIP_RAM))
464 printk("Warning: no chipram present for debugging\n");
465 else {
466 amiga_savekmsg_init();
467 amiga_console_driver.write = amiga_mem_console_write;
468 register_console(&amiga_console_driver);
469 }
470 }
471
472 /* our beloved beeper */ 456 /* our beloved beeper */
473 if (AMIGAHW_PRESENT(AMI_AUDIO)) 457 if (AMIGAHW_PRESENT(AMI_AUDIO))
474 amiga_init_sound(); 458 amiga_init_sound();
@@ -787,17 +771,33 @@ static void amiga_mem_console_write(struct console *co, const char *s,
787 } 771 }
788} 772}
789 773
790static void amiga_savekmsg_init(void) 774static int __init amiga_savekmsg_setup(char *arg)
791{ 775{
792 static struct resource debug_res = { .name = "Debug" }; 776 static struct resource debug_res = { .name = "Debug" };
793 777
778 if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
779 goto done;
780
781 if (!AMIGAHW_PRESENT(CHIP_RAM)) {
782 printk("Warning: no chipram present for debugging\n");
783 goto done;
784 }
785
794 savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res); 786 savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
795 savekmsg->magic1 = SAVEKMSG_MAGIC1; 787 savekmsg->magic1 = SAVEKMSG_MAGIC1;
796 savekmsg->magic2 = SAVEKMSG_MAGIC2; 788 savekmsg->magic2 = SAVEKMSG_MAGIC2;
797 savekmsg->magicptr = ZTWO_PADDR(savekmsg); 789 savekmsg->magicptr = ZTWO_PADDR(savekmsg);
798 savekmsg->size = 0; 790 savekmsg->size = 0;
791
792 amiga_console_driver.write = amiga_mem_console_write;
793 register_console(&amiga_console_driver);
794
795done:
796 return 0;
799} 797}
800 798
799early_param("debug", amiga_savekmsg_setup);
800
801static void amiga_serial_putc(char c) 801static void amiga_serial_putc(char c)
802{ 802{
803 amiga_custom.serdat = (unsigned char)c | 0x100; 803 amiga_custom.serdat = (unsigned char)c | 0x100;
@@ -872,15 +872,18 @@ void amiga_serial_gets(struct console *co, char *s, int len)
872} 872}
873#endif 873#endif
874 874
875static void __init amiga_debug_init(void) 875static int __init amiga_debug_setup(char *arg)
876{ 876{
877 if (!strcmp(m68k_debug_device, "ser" )) { 877 if (MACH_IS_AMIGA && !strcmp(arg, "ser")) {
878 /* no initialization required (?) */ 878 /* no initialization required (?) */
879 amiga_console_driver.write = amiga_serial_console_write; 879 amiga_console_driver.write = amiga_serial_console_write;
880 register_console(&amiga_console_driver); 880 register_console(&amiga_console_driver);
881 } 881 }
882 return 0;
882} 883}
883 884
885early_param("debug", amiga_debug_setup);
886
884#ifdef CONFIG_HEARTBEAT 887#ifdef CONFIG_HEARTBEAT
885static void amiga_heartbeat(int on) 888static void amiga_heartbeat(int on)
886{ 889{