diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2010-10-27 18:32:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-27 21:03:05 -0400 |
commit | 8881cdceb25b4fcebfb17a9548ed80c22cf8b066 (patch) | |
tree | 939be53dc8eb5fe280347811f1d202efad98ed75 /drivers/firmware | |
parent | d31eb5194bbdcc7db9fd6956c293e45093bfb394 (diff) |
dmi: log board, system, and BIOS information
Put basic system information in the dmesg log. There are lots of dmesg
logs on the web, and it would be useful if they contained this information
for debugging platform problems. "BOARD/PRODUCT" format copied from
show_regs_common(), which is used in the oops path.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/dmi_scan.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index b3d22d659990..e28e41668177 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/string.h> | 2 | #include <linux/string.h> |
3 | #include <linux/init.h> | 3 | #include <linux/init.h> |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/ctype.h> | ||
5 | #include <linux/dmi.h> | 6 | #include <linux/dmi.h> |
6 | #include <linux/efi.h> | 7 | #include <linux/efi.h> |
7 | #include <linux/bootmem.h> | 8 | #include <linux/bootmem.h> |
@@ -361,6 +362,33 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) | |||
361 | } | 362 | } |
362 | } | 363 | } |
363 | 364 | ||
365 | static void __init print_filtered(const char *info) | ||
366 | { | ||
367 | const char *p; | ||
368 | |||
369 | if (!info) | ||
370 | return; | ||
371 | |||
372 | for (p = info; *p; p++) | ||
373 | if (isprint(*p)) | ||
374 | printk(KERN_CONT "%c", *p); | ||
375 | else | ||
376 | printk(KERN_CONT "\\x%02x", *p & 0xff); | ||
377 | } | ||
378 | |||
379 | static void __init dmi_dump_ids(void) | ||
380 | { | ||
381 | printk(KERN_DEBUG "DMI: "); | ||
382 | print_filtered(dmi_get_system_info(DMI_BOARD_NAME)); | ||
383 | printk(KERN_CONT "/"); | ||
384 | print_filtered(dmi_get_system_info(DMI_PRODUCT_NAME)); | ||
385 | printk(KERN_CONT ", BIOS "); | ||
386 | print_filtered(dmi_get_system_info(DMI_BIOS_VERSION)); | ||
387 | printk(KERN_CONT " "); | ||
388 | print_filtered(dmi_get_system_info(DMI_BIOS_DATE)); | ||
389 | printk(KERN_CONT "\n"); | ||
390 | } | ||
391 | |||
364 | static int __init dmi_present(const char __iomem *p) | 392 | static int __init dmi_present(const char __iomem *p) |
365 | { | 393 | { |
366 | u8 buf[15]; | 394 | u8 buf[15]; |
@@ -381,8 +409,10 @@ static int __init dmi_present(const char __iomem *p) | |||
381 | buf[14] >> 4, buf[14] & 0xF); | 409 | buf[14] >> 4, buf[14] & 0xF); |
382 | else | 410 | else |
383 | printk(KERN_INFO "DMI present.\n"); | 411 | printk(KERN_INFO "DMI present.\n"); |
384 | if (dmi_walk_early(dmi_decode) == 0) | 412 | if (dmi_walk_early(dmi_decode) == 0) { |
413 | dmi_dump_ids(); | ||
385 | return 0; | 414 | return 0; |
415 | } | ||
386 | } | 416 | } |
387 | return 1; | 417 | return 1; |
388 | } | 418 | } |