[RFC/PATCH] debug=mem on Amiga

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




`debug=mem' on Amiga has been broken for a while.
early_param() processing is done very/too early, i.e. before
amiga_hw_present.CHIP_RAM has been set in amiga_identify(), causing
amiga_savekmsg_setup() not to find any Chip RAM.

The quick hack below makes it work again by introducing an additional
intermediate flag, but I don't like it.
---
 arch/m68k/amiga/config.c |   30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -97,6 +97,7 @@ static void amiga_mem_console_write(stru
 				    unsigned int count);
 void amiga_serial_console_write(struct console *co, const char *s,
 				unsigned int count);
+static void __init amiga_savekmsg_init(void);
 #ifdef CONFIG_HEARTBEAT
 static void amiga_heartbeat(int on);
 #endif
@@ -107,6 +108,8 @@ static struct console amiga_console_driv
 	.index	= -1,
 };
 
+static int __initdata amiga_enable_debug_mem;
+
 
     /*
      *  Motherboard Resources present in all Amiga models
@@ -453,6 +456,9 @@ void __init config_amiga(void)
 	/* initialize chipram allocator */
 	amiga_chip_init();
 
+	if (amiga_enable_debug_mem && AMIGAHW_PRESENT(CHIP_RAM))
+		amiga_savekmsg_init();
+
 	/* our beloved beeper */
 	if (AMIGAHW_PRESENT(AMI_AUDIO))
 		amiga_init_sound();
@@ -771,18 +777,10 @@ static void amiga_mem_console_write(stru
 	}
 }
 
-static int __init amiga_savekmsg_setup(char *arg)
+static void __init amiga_savekmsg_init(void)
 {
 	static struct resource debug_res = { .name = "Debug" };
 
-	if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
-		goto done;
-
-	if (!AMIGAHW_PRESENT(CHIP_RAM)) {
-		printk("Warning: no chipram present for debugging\n");
-		goto done;
-	}
-
 	savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
 	savekmsg->magic1 = SAVEKMSG_MAGIC1;
 	savekmsg->magic2 = SAVEKMSG_MAGIC2;
@@ -791,6 +789,20 @@ static int __init amiga_savekmsg_setup(c
 
 	amiga_console_driver.write = amiga_mem_console_write;
 	register_console(&amiga_console_driver);
+}
+
+static int __init amiga_savekmsg_setup(char *arg)
+{
+	if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
+		goto done;
+
+	if (!AMIGAHW_PRESENT(CHIP_RAM)) {
+		printk("Warning: no chipram present for debugging\n");
+		amiga_enable_debug_mem = 1;
+		goto done;
+	}
+
+	amiga_savekmsg_init();
 
 done:
 	return 0;

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
-
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux