Skip to contentSkip to conversation

mrst_earlyprintk: add a kmsg_dumper to dump the printk buffer when panic

PATCH New Alan Cox 1 participant 1 message Sep 6, 2010

Subsystems (2)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/5 mrst_earlyprintk: add a kmsg_dumper to dump the printk buffer when panic

From: Feng Tang <[email protected]>

As normal max3110 console can't work during panic case, add a helper function which make debug easier

---

 arch/x86/Kconfig                   |   18 ++
 arch/x86/Kconfig.debug             |    4 +
 arch/x86/include/asm/mrst.h        |    5 +
 arch/x86/kernel/Makefile           |    1 
 arch/x86/kernel/early_printk.c     |    5 +
 arch/x86/kernel/mrst_earlyprintk.c |  283 ++++++++++++++++++++++++++++++++++++
 6 files changed, 311 insertions(+), 5 deletions(-)
 create mode 100644 arch/x86/kernel/mrst_earlyprintk.c
arch/x86/Kconfig +13 -5
index 162d1aa..97d3016 100644
@@ -420,6 +420,14 @@ config X86_MRST
 	  nor standard legacy replacement devices/features. e.g. Moorestown does
 	  not contain i8259, i8254, HPET, legacy BIOS, most of the io ports.
 
+config MRST_SPI_UART_BOOT_MSG
+	def_bool y
+	prompt "Moorestown SPI UART boot message"
+	depends on (X86_MRST && X86_32)
+	help
+	  Enable this to see boot message during protected mode boot phase, such as
+	  kernel decompression, BAUD rate is set at 115200 8n1
+
 config X86_RDC321X
 	bool "RDC R-321x SoC"
 	depends on X86_32
@@ -630,11 +638,11 @@ config APB_TIMER
        def_bool y if MRST
        prompt "Langwell APB Timer Support" if X86_MRST
        help
-         APB timer is the replacement for 8254, HPET on X86 MID platforms.
-         The APBT provides a stable time base on SMP
-         systems, unlike the TSC, but it is more expensive to access,
-         as it is off-chip. APB timers are always running regardless of CPU
-         C states, they are used as per CPU clockevent device when possible.
+		APB timer is the replacement for 8254, HPET on X86 MID platforms.
+		The APBT provides a stable time base on SMP
+		systems, unlike the TSC, but it is more expensive to access,
+		as it is off-chip. APB timers are always running regardless of CPU
+		C states, they are used as per CPU clockevent device when possible.
 
 # Mark as embedded because too many people got it wrong.
 # The code disables itself when not needed.
arch/x86/Kconfig.debug +4 -0
index 7f15308..3e104d1 100644
@@ -43,6 +43,10 @@ config EARLY_PRINTK
 	  with klogd/syslogd or the X server. You should normally N here,
 	  unless you want to debug such a crash.
 
+config X86_MRST_EARLY_PRINTK
+	bool "Early printk for MRST platform support"
+	depends on EARLY_PRINTK && X86_MRST
+
 config EARLY_PRINTK_DBGP
 	bool "Early printk via EHCI debug port"
 	depends on EARLY_PRINTK && PCI
arch/x86/include/asm/mrst.h +5 -0
index 1635074..704d2fd 100644
@@ -10,6 +10,9 @@
  */
 #ifndef _ASM_X86_MRST_H
 #define _ASM_X86_MRST_H
+
+#include <linux/sfi.h>
+
 extern int pci_mrst_init(void);
 int __init sfi_parse_mrtc(struct sfi_table_header *table);
 
@@ -42,4 +45,6 @@ extern enum mrst_timer_options mrst_timer_options;
 #define SFI_MTMR_MAX_NUM 8
 #define SFI_MRTC_MAX	8
 
+extern struct console early_mrst_console;
+extern void mrst_early_printk(const char *fmt, ...);
 #endif /* _ASM_X86_MRST_H */
arch/x86/kernel/Makefile +1 -0
index 11a9925..e0a8357 100644
@@ -84,6 +84,7 @@ obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault_32.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_VM86)		+= vm86_32.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
+obj-$(CONFIG_X86_MRST_EARLY_PRINTK)	+= mrst_earlyprintk.o
 
 obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
 obj-$(CONFIG_APB_TIMER)		+= apb_timer.o
arch/x86/kernel/early_printk.c +5 -0
index fa99bae..435a070 100644
@@ -14,6 +14,7 @@
 #include <xen/hvc-console.h>
 #include <asm/pci-direct.h>
 #include <asm/fixmap.h>
+#include <asm/mrst.h>
 #include <asm/pgtable.h>
 #include <linux/usb/ehci_def.h>
 
@@ -239,6 +240,10 @@ static int __init setup_early_printk(char *buf)
 		if (!strncmp(buf, "xen", 3))
 			early_console_register(&xenboot_console, keep);
 #endif
+#ifdef CONFIG_X86_MRST_EARLY_PRINTK
+		if (!strncmp(buf, "mrst", 4))
+			early_console_register(&early_mrst_console, keep);
+#endif
 		buf++;
 	}
 	return 0;
arch/x86/kernel/mrst_earlyprintk.c new file +283 -0

283 lines not on this page · raw message