···2525 If you have a supported Chromebook, choose Y or M here.2626 The module will be called chromeos_laptop.27272828+config CHROMEOS_PSTORE2929+ tristate "Chrome OS pstore support"3030+ ---help---3131+ This module instantiates the persistent storage on x86 ChromeOS3232+ devices. It can be used to store away console logs and crash3333+ information across reboots.3434+3535+ The range of memory used is 0xf00000-0x1000000, traditionally3636+ the memory used to back VGA controller memory.3737+3838+ If you have a supported Chromebook, choose Y or M here.3939+ The module will be called chromeos_pstore.4040+4141+2842endif # CHROMEOS_PLATFORMS
···11+/*22+ * chromeos_pstore.c - Driver to instantiate Chromebook ramoops device33+ *44+ * Copyright (C) 2013 Google, Inc.55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License as published by88+ * the Free Software Foundation, version 2 of the License.99+ */1010+1111+#include <linux/dmi.h>1212+#include <linux/module.h>1313+#include <linux/platform_device.h>1414+#include <linux/pstore_ram.h>1515+1616+static struct dmi_system_id chromeos_pstore_dmi_table[] __initdata = {1717+ {1818+ /*1919+ * Today all Chromebooks/boxes ship with GOOGLE as vendor and2020+ * coreboot as bios vendor. No other systems with this2121+ * combination are known to date.2222+ */2323+ .matches = {2424+ DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),2525+ DMI_MATCH(DMI_BIOS_VENDOR, "coreboot"),2626+ },2727+ },2828+ {2929+ /*3030+ * The first Samsung Chromebox and Chromebook Series 5 550 use3131+ * coreboot but with Samsung as the system vendor.3232+ */3333+ .matches = {3434+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG"),3535+ DMI_MATCH(DMI_BIOS_VENDOR, "coreboot"),3636+ },3737+ },3838+ {3939+ /* x86-alex, the first Samsung Chromebook. */4040+ .matches = {4141+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),4242+ DMI_MATCH(DMI_PRODUCT_NAME, "Alex"),4343+ },4444+ },4545+ {4646+ /* x86-mario, the Cr-48 pilot device from Google. */4747+ .matches = {4848+ DMI_MATCH(DMI_SYS_VENDOR, "IEC"),4949+ DMI_MATCH(DMI_PRODUCT_NAME, "Mario"),5050+ },5151+ },5252+ {5353+ /* x86-zgb, the first Acer Chromebook. */5454+ .matches = {5555+ DMI_MATCH(DMI_SYS_VENDOR, "ACER"),5656+ DMI_MATCH(DMI_PRODUCT_NAME, "ZGB"),5757+ },5858+ },5959+ { }6060+};6161+MODULE_DEVICE_TABLE(dmi, chromeos_pstore_dmi_table);6262+6363+/*6464+ * On x86 chromebooks/boxes, the firmware will keep the legacy VGA memory6565+ * range untouched across reboots, so we use that to store our pstore6666+ * contents for panic logs, etc.6767+ */6868+static struct ramoops_platform_data chromeos_ramoops_data = {6969+ .mem_size = 0x100000,7070+ .mem_address = 0xf00000,7171+ .record_size = 0x20000,7272+ .console_size = 0x20000,7373+ .ftrace_size = 0x20000,7474+ .dump_oops = 1,7575+};7676+7777+static struct platform_device chromeos_ramoops = {7878+ .name = "ramoops",7979+ .dev = {8080+ .platform_data = &chromeos_ramoops_data,8181+ },8282+};8383+8484+static int __init chromeos_pstore_init(void)8585+{8686+ if (dmi_check_system(chromeos_pstore_dmi_table))8787+ return platform_device_register(&chromeos_ramoops);8888+8989+ return -ENODEV;9090+}9191+9292+static void __exit chromeos_pstore_exit(void)9393+{9494+ platform_device_unregister(&chromeos_ramoops);9595+}9696+9797+module_init(chromeos_pstore_init);9898+module_exit(chromeos_pstore_exit);9999+100100+MODULE_DESCRIPTION("Chrome OS pstore module");101101+MODULE_LICENSE("GPL");