Skip to contentSkip to conversation

MVME16x: add support for EARLY_PRINTK

PATCH In review Kars de Jong 3 participants 6 messages Nov 20, 2008 – Nov 25, 2008 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MVME16x: add support for EARLY_PRINTK

From: Kars de Jong <[email protected]>
Date: Thu, 20 Nov 2008 13:47:18 +0100
Subject: [PATCH] MVME16x: add support for EARLY_PRINTK

Added support for EARLY_PRINTK when running on an MVME16x board.

---
 arch/m68k/Kconfig.debug    |   11 +++
 arch/m68k/mvme16x/config.c |  160 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 171 insertions(+), 0 deletions(-)
arch/m68k/Kconfig.debug +11 -0
index f53b6d5..e0283a0 100644
@@ -2,4 +2,15 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config EARLY_PRINTK
+	bool "Early printk" if EMBEDDED
+	depends on MVME16x
+	default y
+	help
+          Write kernel log output directly to a serial port.
+
+          This is useful for kernel debugging when your machine crashes very
+          early before the console code is initialized.
+          You should normally say N here, unless you want to debug such a crash.
+
 endmenu
arch/m68k/mvme16x/config.c +160 -0

172 lines not on this page · raw message

Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 1 line · Kars de Jong

+void __init mvme16x_early_console(void)

static?

Quoted 10 lines
arch/m68k/mvme16x/config.c +6 -0
+{
+	register_console(&cons_info);
+
+	printk(KERN_INFO "MVME16x: early console registered\n");
+}
+#endif
 
 void __init config_mvme16x(void)
 {

arch/m68k/mvme16x/config.c void __init config_mvme16x(void) · line 346

Quoted 6 lines
arch/m68k/mvme16x/config.c +3 -0
@@ -184,6 +341,9 @@ void __init config_mvme16x(void)
 	pcc2chip[PccSCCMICR] = 0x10;
 	pcc2chip[PccSCCTICR] = 0x10;
 	pcc2chip[PccSCCRICR] = 0x10;
+#ifdef CONFIG_EARLY_PRINTK
+	mvme16x_early_console();
+#endif

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#2 lore raw
Quoted 4 lines · Geert Uytterhoeven
Quoted 1 line · Kars de Jong

+void __init mvme16x_early_console(void)

static?

Yes, you're right.
Here is an updated version:

From: Kars de Jong <[email protected]>
Date: Fri, 21 Nov 2008 13:15:56 +0100
Subject: [PATCH] MVME16x: add support for EARLY_PRINTK

Added support for EARLY_PRINTK when running on an MVME16x board.

---
 arch/m68k/Kconfig.debug    |   11 +++
 arch/m68k/mvme16x/config.c |  160 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 171 insertions(+), 0 deletions(-)
arch/m68k/Kconfig.debug +11 -0
index f53b6d5..e0283a0 100644
@@ -2,4 +2,15 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config EARLY_PRINTK
+	bool "Early printk" if EMBEDDED
+	depends on MVME16x
+	default y
+	help
+          Write kernel log output directly to a serial port.
+
+          This is useful for kernel debugging when your machine crashes very
+          early before the console code is initialized.
+          You should normally say N here, unless you want to debug such a crash.
+
 endmenu
arch/m68k/mvme16x/config.c +160 -0

172 lines not on this page · raw message

Signature · 1 line
1.5.6.5
#3 lore raw
In reply to Kars de Jong

Hi,

arch/m68k/Kconfig.debug menu "Kernel hacking" · line 9

Quoted 13 lines · Kars de Jong
arch/m68k/Kconfig.debug +5 -0
index f53b6d5..e0283a0 100644
@@ -2,4 +2,15 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config EARLY_PRINTK
+	bool "Early printk" if EMBEDDED
+	depends on MVME16x
+	default y
+	help

This is really misnamed, the option is mvme specific but the name is rather generic. Depending on the code size you could include the code unconditionally (like we do on other ports).

bye, Roman

#4 lore raw
Quoted 9 lines · Roman Zippel
Quoted 8 lines · Kars de Jong
arch/m68k/Kconfig.debug +0 -0
index f53b6d5..e0283a0 100644
@@ -2,4 +2,15 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
Quoted 9 lines

arch/m68k/Kconfig.debug menu "Kernel hacking" · line 9

Quoted 5 lines
arch/m68k/Kconfig.debug +5 -0
+config EARLY_PRINTK
+	bool "Early printk" if EMBEDDED
+	depends on MVME16x
+	default y
+	help

This is really misnamed, the option is mvme specific but the name is rather generic. Depending on the code size you could include the code unconditionally (like we do on other ports).

Defining CONFIG_EARLY_PRINTK used to pull in some generic code, that's why I named it like that.

I grepped the source for CONFIG_EARLY_PRINTK, it seems the generic code is gone.

So I think I'll just define it unconditionally, and only on MVME16x it will actually include some extra code. Is that OK with you?

Kind regards, Kars.

#5 lore raw

Hi,

Quoted 2 lines · Kars de Jong

Defining CONFIG_EARLY_PRINTK used to pull in some generic code, that's why I named it like that.

x86 is using it include some early print code, but the generic parts are all already available unconditionally (and early on) and IIRC always were.

Quoted 2 lines

So I think I'll just define it unconditionally, and only on MVME16x it will actually include some extra code. Is that OK with you?

That's fine, it's up to you whether you want to activate it via config option or command line. In the other ports it's activated via the early_param debug option.

bye, Roman