summaryrefslogtreecommitdiff
path: root/include/soc
diff options
context:
space:
mode:
authorPratik Patel <pratikp@codeaurora.org>2014-09-01 10:04:34 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:12:06 -0700
commitebce13ea36f54efcb366c562deb0c1bd3d81e688 (patch)
tree8e98747fb7e83a7d154d47d531e4b8b7f00dbab0 /include/soc
parent240d67c2b05d5e3e0e358d7c607b531b65eb8b51 (diff)
soc: qcom: hvc: add hypervisor call support
Add API support for calling into the hypervisor. This will allow various drivers to avail hypervisor services. Change-Id: I0a0e8f8fe13a550ad20c5421b712e207933c82f3 Signed-off-by: Pratik Patel <pratikp@codeaurora.org> [pdaly@codeaurora.org Resolve minor conflicts] Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/qcom/hvc.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/soc/qcom/hvc.h b/include/soc/qcom/hvc.h
new file mode 100644
index 000000000000..435729b13490
--- /dev/null
+++ b/include/soc/qcom/hvc.h
@@ -0,0 +1,58 @@
+/* Copyright (c) 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_HVC_H
+#define __MSM_HVC_H
+
+#ifdef CONFIG_ARM64
+#define HVC_FN_ARM_BASE 0xC0000000
+#define HVC_FN_CPU_BASE 0xC1000000
+#define HVC_FN_SIP_BASE 0xC2000000
+#define HVC_FN_OEM_BASE 0xC3000000
+#define HVC_FN_APP_BASE 0xF0000000
+#define HVC_FN_OS_BASE 0xF2000000
+#else
+#define HVC_FN_ARM_BASE 0x80000000
+#define HVC_FN_CPU_BASE 0x81000000
+#define HVC_FN_SIP_BASE 0x82000000
+#define HVC_FN_OEM_BASE 0x83000000
+#define HVC_FN_APP_BASE 0xB0000000
+#define HVC_FN_OS_BASE 0xB2000000
+#endif
+
+#define HVC_FN_ARM(n) (HVC_FN_ARM_BASE + (n))
+#define HVC_FN_CPU(n) (HVC_FN_CPU_BASE + (n))
+#define HVC_FN_SIP(n) (HVC_FN_SIP_BASE + (n))
+#define HVC_FN_OEM(n) (HVC_FN_OEM_BASE + (n))
+#define HVC_FN_APP(n) (HVC_FN_APP_BASE + (n))
+#define HVC_FN_OS(n) (HVC_FN_OS_BASE + (n))
+
+#define HVC_MAX_ARGS 6
+#define HVC_MAX_RETS 3
+#define HVC_MAX_EXTRA_ARGS 4
+
+struct hvc_desc {
+ u64 arg[HVC_MAX_ARGS];
+ u64 ret[HVC_MAX_RETS];
+};
+
+struct hvc_extra_args {
+ u64 arg[HVC_MAX_EXTRA_ARGS];
+};
+
+#ifdef CONFIG_MSM_HVC
+extern int hvc(u64 func_id, struct hvc_desc *desc);
+#else
+static inline int hvc(u64 func_id, struct hvc_desc *desc) { return 0; }
+#endif
+
+#endif