summaryrefslogtreecommitdiff
path: root/include/soc
diff options
context:
space:
mode:
authorAndy Gross <agross@codeaurora.org>2014-07-14 22:27:24 -0500
committerRohit Vaswani <rvaswani@codeaurora.org>2016-03-01 12:22:22 -0800
commit25bfca71adf8c149cee7d76976ad73c9066d72ae (patch)
treeea836ffaaecc3bb59f99a20856aaaef51bdf855c /include/soc
parent051df5bd9bd02b93b6ea47e326ad6c570fa2469a (diff)
soc: qcom: Add snapshot of Qualcomm watchdog_v2 driver
This is a snapshot of the watchdog_v2 driver as of msm-3.10 commit acdce027751d5a7488b283f0ce3111f873a5816d (Merge "defconfig: arm64: Enable ONESHOT_SYNC for msm8994") Change-Id: I8cd7a84e0cbb45c3ac20d4c84f5603ab5df1edae Signed-off-by: Andy Gross <agross@codeaurora.org> [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/qcom/memory_dump.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/include/soc/qcom/memory_dump.h b/include/soc/qcom/memory_dump.h
new file mode 100644
index 000000000000..562d1a241879
--- /dev/null
+++ b/include/soc/qcom/memory_dump.h
@@ -0,0 +1,120 @@
+/* Copyright (c) 2012, 2014, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __MSM_MEMORY_DUMP_H
+#define __MSM_MEMORY_DUMP_H
+
+#include <linux/types.h>
+
+enum dump_client_type {
+ MSM_CPU_CTXT = 0,
+ MSM_L1_CACHE,
+ MSM_L2_CACHE,
+ MSM_OCMEM,
+ MSM_TMC_ETFETB,
+ MSM_ETM0_REG,
+ MSM_ETM1_REG,
+ MSM_ETM2_REG,
+ MSM_ETM3_REG,
+ MSM_TMC0_REG, /* TMC_ETR */
+ MSM_TMC1_REG, /* TMC_ETF */
+ MSM_LOG_BUF,
+ MSM_LOG_BUF_FIRST_IDX,
+ MAX_NUM_CLIENTS,
+};
+
+struct msm_client_dump {
+ enum dump_client_type id;
+ unsigned long start_addr;
+ unsigned long end_addr;
+};
+
+#ifdef CONFIG_MSM_MEMORY_DUMP
+extern int msm_dump_tbl_register(struct msm_client_dump *client_entry);
+#else
+static inline int msm_dump_tbl_register(struct msm_client_dump *entry)
+{
+ return -EIO;
+}
+#endif
+
+
+#if defined(CONFIG_MSM_MEMORY_DUMP) || defined(CONFIG_MSM_MEMORY_DUMP_V2)
+extern uint32_t msm_dump_table_version(void);
+#else
+static inline uint32_t msm_dump_table_version(void)
+{
+ return 0;
+}
+#endif
+
+#define MSM_DUMP_MAKE_VERSION(ma, mi) ((ma << 20) | mi)
+#define MSM_DUMP_MAJOR(val) (val >> 20)
+#define MSM_DUMP_MINOR(val) (val & 0xFFFFF)
+
+
+#define MAX_NUM_ENTRIES 0x120
+
+enum msm_dump_data_ids {
+ MSM_DUMP_DATA_CPU_CTX = 0x00,
+ MSM_DUMP_DATA_L1_INST_CACHE = 0x60,
+ MSM_DUMP_DATA_L1_DATA_CACHE = 0x80,
+ MSM_DUMP_DATA_ETM_REG = 0xA0,
+ MSM_DUMP_DATA_L2_CACHE = 0xC0,
+ MSM_DUMP_DATA_L3_CACHE = 0xD0,
+ MSM_DUMP_DATA_OCMEM = 0xE0,
+ MSM_DUMP_DATA_MISC = 0xE8,
+ MSM_DUMP_DATA_TMC_ETF = 0xF0,
+ MSM_DUMP_DATA_TMC_REG = 0x100,
+ MSM_DUMP_DATA_LOG_BUF = 0x110,
+ MSM_DUMP_DATA_LOG_BUF_FIRST_IDX = 0x111,
+ MSM_DUMP_DATA_MAX = MAX_NUM_ENTRIES,
+};
+
+enum msm_dump_table_ids {
+ MSM_DUMP_TABLE_APPS,
+ MSM_DUMP_TABLE_MAX = MAX_NUM_ENTRIES,
+};
+
+enum msm_dump_type {
+ MSM_DUMP_TYPE_DATA,
+ MSM_DUMP_TYPE_TABLE,
+};
+
+struct msm_dump_data {
+ uint32_t version;
+ uint32_t magic;
+ char name[32];
+ uint64_t addr;
+ uint64_t len;
+ uint32_t reserved;
+};
+
+struct msm_dump_entry {
+ uint32_t id;
+ char name[32];
+ uint32_t type;
+ uint64_t addr;
+};
+
+#ifdef CONFIG_MSM_MEMORY_DUMP_V2
+extern int msm_dump_data_register(enum msm_dump_table_ids id,
+ struct msm_dump_entry *entry);
+#else
+static inline int msm_dump_data_register(enum msm_dump_table_ids id,
+ struct msm_dump_entry *entry)
+{
+ return -ENOSYS;
+}
+#endif
+
+#endif