PM / sleep: Asynchronous threads for suspend_noirq
[linux/fpc-iii.git] / drivers / platform / chrome / chromeos_pstore.c
blobe0e0e65cf442c1dbd36602b42821b36cbf68731e
1 /*
2 * chromeos_pstore.c - Driver to instantiate Chromebook ramoops device
4 * Copyright (C) 2013 Google, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, version 2 of the License.
9 */
11 #include <linux/dmi.h>
12 #include <linux/module.h>
13 #include <linux/platform_device.h>
14 #include <linux/pstore_ram.h>
16 static struct dmi_system_id chromeos_pstore_dmi_table[] __initdata = {
19 * Today all Chromebooks/boxes ship with GOOGLE as vendor and
20 * coreboot as bios vendor. No other systems with this
21 * combination are known to date.
23 .matches = {
24 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
25 DMI_MATCH(DMI_BIOS_VENDOR, "coreboot"),
30 * The first Samsung Chromebox and Chromebook Series 5 550 use
31 * coreboot but with Samsung as the system vendor.
33 .matches = {
34 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG"),
35 DMI_MATCH(DMI_BIOS_VENDOR, "coreboot"),
39 /* x86-alex, the first Samsung Chromebook. */
40 .matches = {
41 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
42 DMI_MATCH(DMI_PRODUCT_NAME, "Alex"),
46 /* x86-mario, the Cr-48 pilot device from Google. */
47 .matches = {
48 DMI_MATCH(DMI_SYS_VENDOR, "IEC"),
49 DMI_MATCH(DMI_PRODUCT_NAME, "Mario"),
53 /* x86-zgb, the first Acer Chromebook. */
54 .matches = {
55 DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
56 DMI_MATCH(DMI_PRODUCT_NAME, "ZGB"),
59 { }
61 MODULE_DEVICE_TABLE(dmi, chromeos_pstore_dmi_table);
64 * On x86 chromebooks/boxes, the firmware will keep the legacy VGA memory
65 * range untouched across reboots, so we use that to store our pstore
66 * contents for panic logs, etc.
68 static struct ramoops_platform_data chromeos_ramoops_data = {
69 .mem_size = 0x100000,
70 .mem_address = 0xf00000,
71 .record_size = 0x20000,
72 .console_size = 0x20000,
73 .ftrace_size = 0x20000,
74 .dump_oops = 1,
77 static struct platform_device chromeos_ramoops = {
78 .name = "ramoops",
79 .dev = {
80 .platform_data = &chromeos_ramoops_data,
84 static int __init chromeos_pstore_init(void)
86 if (dmi_check_system(chromeos_pstore_dmi_table))
87 return platform_device_register(&chromeos_ramoops);
89 return -ENODEV;
92 static void __exit chromeos_pstore_exit(void)
94 platform_device_unregister(&chromeos_ramoops);
97 module_init(chromeos_pstore_init);
98 module_exit(chromeos_pstore_exit);
100 MODULE_DESCRIPTION("Chrome OS pstore module");
101 MODULE_LICENSE("GPL");