mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
modules: mmi_info: write to mmi_annotate
Write info to the mmi_annotate driver to save information to be printed in the case of a watchdog or panic. Change-Id: I5681a1a2da18419e46d03b0dfe33b51a7f336019 Signed-off-by: Ryan Lattrel <ryanl@motorola.com> Reviewed-on: https://gerrit.mot.com/1144994 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Ling Jin <lingjin@motorola.com> Reviewed-by: Kenneth Kessler <kennykessler@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
f99876f575
commit
dbbb62ecaa
4 changed files with 53 additions and 0 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include <asm/setup.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <soc/qcom/mmi_boot_info.h>
|
||||
#include <linux/mmi_annotate.h>
|
||||
#include "mmi_info.h"
|
||||
|
||||
/*
|
||||
|
|
@ -283,6 +284,8 @@ static const struct file_operations bootinfo_proc_fops = {
|
|||
|
||||
int mmi_boot_info_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
of_blsig();
|
||||
mmi_bootarg_setup();
|
||||
|
||||
|
|
@ -290,6 +293,22 @@ int mmi_boot_info_init(void)
|
|||
proc_bootinfo = proc_create("bootinfo",
|
||||
0444, NULL, &bootinfo_proc_fops);
|
||||
|
||||
/* Add to dont panic dump */
|
||||
for (i = 0; i < bl_build_sig_count; i++) {
|
||||
bl_build_sigs[i].item[MAX_BLD_SIG_ITEM - 1] = 0;
|
||||
bl_build_sigs[i].value[MAX_BLD_SIG_VALUE - 1] = 0;
|
||||
mmi_annotate_persist(bl_build_sigs[i].item);
|
||||
mmi_annotate_persist("=");
|
||||
mmi_annotate_persist(bl_build_sigs[i].value);
|
||||
mmi_annotate_persist("\n");
|
||||
}
|
||||
mmi_annotate_persist("MBM_VERSION: 0x%08x\n", bi_mbm_version());
|
||||
mmi_annotate_persist("SERIAL: 0x%llx\n", bi_serial());
|
||||
mmi_annotate_persist("HW_REV: 0x%04x\n", bi_hwrev());
|
||||
mmi_annotate_persist("BOOT_SEQ: 0x%08x\n", bi_boot_seq());
|
||||
mmi_annotate("POWERUPREASON: 0x%08x\n", bi_powerup_reason());
|
||||
mmi_annotate("Last boot reason: %s\n\n", bi_bootreason());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
#include <soc/qcom/smsm.h>
|
||||
#include <linux/mmi_annotate.h>
|
||||
#include "mmi_info.h"
|
||||
|
||||
#define SMEM_SDRAM_INFO SMEM_ID_VENDOR1
|
||||
|
|
@ -158,6 +159,14 @@ int mmi_ram_info_init(void)
|
|||
|
||||
/* extract size */
|
||||
sysfsram_ramsize = smem_ddr_info->ramsize;
|
||||
|
||||
mmi_annotate_persist(
|
||||
"RAM: %s, %s, %u MB, MR5:0x%02X, MR6:0x%02X, "
|
||||
"MR7:0x%02X, MR8:0x%02X\n",
|
||||
vname, tname, smem_ddr_info->ramsize,
|
||||
smem_ddr_info->mr5, smem_ddr_info->mr6,
|
||||
smem_ddr_info->mr7, smem_ddr_info->mr8);
|
||||
|
||||
} else {
|
||||
/* complain, but do not fail if SMEM was not allocated */
|
||||
/* defaults will be reported */
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
#include <soc/qcom/socinfo.h>
|
||||
#include <linux/mmi_annotate.h>
|
||||
#include "mmi_info.h"
|
||||
|
||||
static ssize_t version_show(struct kobject *kobj,
|
||||
|
|
@ -56,11 +57,26 @@ static struct attribute_group soc_info_properties_attr_group = {
|
|||
|
||||
static struct kobject *soc_info_properties_kobj;
|
||||
|
||||
static void annotate_soc_info(void)
|
||||
{
|
||||
mmi_annotate_persist("socinfo: id=%u, ", socinfo_get_id());
|
||||
mmi_annotate_persist("ver=%u.%u, ",
|
||||
SOCINFO_VERSION_MAJOR(socinfo_get_version()),
|
||||
SOCINFO_VERSION_MINOR(socinfo_get_version()));
|
||||
mmi_annotate_persist("raw_id=%u, ", socinfo_get_raw_id());
|
||||
mmi_annotate_persist("raw_ver=%u, ", socinfo_get_raw_version());
|
||||
mmi_annotate_persist("hw_plat=%u, ", socinfo_get_platform_type());
|
||||
mmi_annotate_persist("hw_plat_ver=%u, ", socinfo_get_platform_version());
|
||||
mmi_annotate_persist("hw_plat_subtype=%u\n", socinfo_get_platform_subtype());
|
||||
}
|
||||
|
||||
int mmi_soc_info_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
int status = 0;
|
||||
|
||||
annotate_soc_info();
|
||||
|
||||
soc_info_properties_kobj = kobject_create_and_add("soc", NULL);
|
||||
if (soc_info_properties_kobj)
|
||||
status = sysfs_create_group(soc_info_properties_kobj,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/of.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/mmi_annotate.h>
|
||||
#include "mmi_info.h"
|
||||
|
||||
struct mmi_storage_info *info;
|
||||
|
|
@ -95,6 +96,14 @@ int mmi_storage_info_init(void)
|
|||
info->product_name,
|
||||
info->firmware_version);
|
||||
|
||||
mmi_annotate_persist(
|
||||
"%s: %s %s %s FV=%s\n",
|
||||
info->type,
|
||||
info->size,
|
||||
info->card_manufacturer,
|
||||
info->product_name,
|
||||
info->firmware_version);
|
||||
|
||||
/* Export to sysfs*/
|
||||
st_info_properties_kobj = kobject_create_and_add("storage", NULL);
|
||||
if (st_info_properties_kobj)
|
||||
|
|
|
|||
Loading…
Reference in a new issue