]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
firmware: qcom: scm: add video (vidc) scm calls
authorStanimir Varbanov <stanimir.varbanov@linaro.org>
Tue, 28 Apr 2015 14:20:09 +0000 (17:20 +0300)
committerSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 11 Jan 2016 09:55:21 +0000 (09:55 +0000)
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Conflicts:
drivers/firmware/qcom_scm.c

drivers/firmware/qcom_scm-32.c
drivers/firmware/qcom_scm-64.c
drivers/firmware/qcom_scm.c
drivers/firmware/qcom_scm.h
include/linux/qcom_scm.h

index c6ec8954835416e53a9931107c219fba392e9b33..2ac6abc0d6523570dcb62d5a4cd055280adf743e 100644 (file)
@@ -835,3 +835,51 @@ int __qcom_scm_restore_sec_cfg(u32 device_id, u32 spare)
 
        return 0;
 }
+
+#define TZBSP_VIDEO_SET_STATE  0xa
+int __qcom_scm_set_video_state(u32 state, u32 spare)
+{
+       struct {
+               u32 state;
+               u32 spare;
+       } req;
+       int scm_ret = 0;
+       int ret;
+
+       req.state = state;
+       req.spare = spare;
+
+       ret = qcom_scm_call(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE, &req,
+                           sizeof(req), &scm_ret, sizeof(scm_ret));
+       if (ret || scm_ret)
+                       return ret ? ret : -EINVAL;
+
+       return 0;
+}
+
+#define TZBSP_MEM_PROTECT_VIDEO_VAR    0x8
+
+int __qcom_scm_mem_protect_video_var(u32 start, u32 size, u32 nonpixel_start,
+                                    u32 nonpixel_size)
+{
+       struct {
+               u32 cp_start;
+               u32 cp_size;
+               u32 cp_nonpixel_start;
+               u32 cp_nonpixel_size;
+       } req;
+       int ret, scm_ret;
+
+       req.cp_start = start;
+       req.cp_size = size;
+       req.cp_nonpixel_start = nonpixel_start;
+       req.cp_nonpixel_size = nonpixel_size;
+
+       ret = qcom_scm_call(SCM_SVC_MP, TZBSP_MEM_PROTECT_VIDEO_VAR, &req,
+                           sizeof(req), &scm_ret, sizeof(scm_ret));
+
+       if (ret || scm_ret)
+                       return ret ? ret : -EINVAL;
+
+       return 0;
+}
index 2584336105c07a1afcdbb93906bd6a15f07b2a24..030b584dec2a441e903b8db8f97d063f92e77ac7 100644 (file)
@@ -796,6 +796,50 @@ int __qcom_scm_restore_sec_cfg(u32 device_id, u32 spare)
        return 0;
 }
 
+#define TZBSP_VIDEO_SET_STATE  0xa
+int __qcom_scm_set_video_state(u32 state, u32 spare)
+{
+       struct qcom_scm_desc desc = {0};
+       int ret, scm_ret;
+
+       desc.args[0] = state;
+       desc.args[1] = spare;
+       desc.arginfo = QCOM_SCM_ARGS(2);
+
+       ret = qcom_scm_call(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE, &desc);
+
+       scm_ret = desc.ret[0];
+
+       if (ret || scm_ret)
+               return ret ? ret : -EINVAL;
+
+       return 0;
+}
+
+#define TZBSP_MEM_PROTECT_VIDEO_VAR    0x8
+
+int __qcom_scm_mem_protect_video_var(u32 start, u32 size, u32 nonpixel_start,
+                                    u32 nonpixel_size)
+{
+       struct qcom_scm_desc desc = {0};
+       int ret, scm_ret;
+
+       desc.args[0] = start;
+       desc.args[1] = size;
+       desc.args[2] = nonpixel_start;
+       desc.args[3] = nonpixel_size;
+       desc.arginfo = QCOM_SCM_ARGS(4);
+
+       ret = qcom_scm_call(SCM_SVC_MP, TZBSP_MEM_PROTECT_VIDEO_VAR, &desc);
+
+       scm_ret = desc.ret[0];
+
+       if (ret || scm_ret)
+               return ret ? ret : -EINVAL;
+
+       return 0;
+}
+
 #define QCOM_SCM_SVC_INFO              0x6
 static int __init qcom_scm_init(void)
 {
index 34477a827836fafdc128bd905a307c89dfc0bdce..5fff0858f7ba2ce34311f6ad8a00fd3f52af30d0 100644 (file)
@@ -254,3 +254,18 @@ int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare)
        return __qcom_scm_restore_sec_cfg(device_id, spare);
 }
 EXPORT_SYMBOL(qcom_scm_restore_sec_cfg);
+
+int qcom_scm_set_video_state(u32 state, u32 spare)
+{
+       return __qcom_scm_set_video_state(state, spare);
+}
+EXPORT_SYMBOL(qcom_scm_set_video_state);
+
+int qcom_scm_mem_protect_video_var(u32 start, u32 size,
+                                  u32 nonpixel_start,
+                                  u32 nonpixel_size)
+{
+       return __qcom_scm_mem_protect_video_var(start, size, nonpixel_start,
+                                               nonpixel_size);
+}
+EXPORT_SYMBOL(qcom_scm_mem_protect_video_var);
index 3730201661c4346dbcd8ff5fc214f971f5c64431..5d7f0ef6fee787b9d438bc8ec984ef817ade626b 100644 (file)
@@ -86,6 +86,7 @@ enum scm_cmd {
        PAS_SHUTDOWN_CMD,
 };
 
+#define SCM_SVC_BOOT           0x1
 #define SCM_SVC_PIL            0x2
 #define SCM_SVC_INFO           0x6
 
@@ -111,4 +112,8 @@ extern int __qcom_scm_is_call_available(u32 svc_id, u32 cmd_id);
 extern int __qcom_scm_get_feat_version(u32 feat);
 extern int __qcom_scm_restore_sec_cfg(u32 device_id, u32 spare);
 
+extern int __qcom_scm_set_video_state(u32 state, u32 spare);
+extern int __qcom_scm_mem_protect_video_var(u32 start, u32 size,
+                                           u32 nonpixel_start,
+                                           u32 nonpixel_size);
 #endif
index 5b613ac14961995aef7c596bbb92b0435340a026..8e042773dd5859ccf1eba5ec06ff23071f3879de 100644 (file)
@@ -66,4 +66,8 @@ extern int qcom_scm_is_call_available(u32 svc_id, u32 cmd_id);
 extern int qcom_scm_get_feat_version(u32 feat);
 extern int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare);
 
+extern int qcom_scm_set_video_state(u32 state, u32 spare);
+extern int qcom_scm_mem_protect_video_var(u32 start, u32 size,
+                                         u32 nonpixel_start,
+                                         u32 nonpixel_size);
 #endif