diff options
author | James Zhao <jamesz@nvidia.com> | 2013-10-16 15:05:53 -0700 |
---|---|---|
committer | Krishna Reddy <vdumpa@nvidia.com> | 2013-11-06 11:26:36 -0800 |
commit | 631cbfa9651b79090720695c2b1cfc664f64ea3f (patch) | |
tree | c808b54923e23e91ac1c8e53b6a5688ba78bf9bc /security | |
parent | 50983f8889d8e903cfb52ea20132a4189a97d461 (diff) |
security: tlk_driver: interface to program VPR base/len
Add interface for the kernel to program vpr base
address through TLK.
Expect phys addr of vpr base, and vpr size.
bug 1279160
Change-Id: I0ff6ef9783ac2bb6438afa0552f57a84e84bf567
Signed-off-by: James Zhao <jamesz@nvidia.com>
Reviewed-on: http://git-master/r/302404
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/tlk_driver/ote_comms.c | 22 | ||||
-rw-r--r-- | security/tlk_driver/ote_device.c | 2 | ||||
-rw-r--r-- | security/tlk_driver/ote_protocol.h | 3 |
3 files changed, 26 insertions, 1 deletions
diff --git a/security/tlk_driver/ote_comms.c b/security/tlk_driver/ote_comms.c index 1e800492ee01..f79753aaa85a 100644 --- a/security/tlk_driver/ote_comms.c +++ b/security/tlk_driver/ote_comms.c @@ -297,6 +297,28 @@ static void do_smc(struct te_request *request, struct tlk_device *dev) } /* + * VPR programming SMC + */ +int te_set_vpr_params(void *vpr_base, size_t vpr_size) +{ + uint32_t retval; + + /* Share the same lock used when request is send from user side */ + mutex_lock(&smc_lock); + + retval = TLK_GENERIC_SMC(TE_SMC_PROGRAM_VPR, vpr_base, vpr_size); + + mutex_unlock(&smc_lock); + + if (retval != OTE_SUCCESS) { + pr_err("te_set_vpr_params failed err (0x%x)\n", retval); + return -EINVAL; + } + return 0; +} +EXPORT_SYMBOL(te_set_vpr_params); + +/* * Open session SMC (supporting client-based te_open_session() calls) */ void te_open_session(struct te_opensession *cmd, diff --git a/security/tlk_driver/ote_device.c b/security/tlk_driver/ote_device.c index 21def6c135bb..29b860a7068c 100644 --- a/security/tlk_driver/ote_device.c +++ b/security/tlk_driver/ote_device.c @@ -35,7 +35,7 @@ #define SET_ANSWER(a, r, ro) { a.result = r; a.result_origin = ro; } struct tlk_device tlk_dev; -static DEFINE_MUTEX(smc_lock); +DEFINE_MUTEX(smc_lock); static int te_create_free_cmd_list(struct tlk_device *dev) { diff --git a/security/tlk_driver/ote_protocol.h b/security/tlk_driver/ote_protocol.h index 3da034918d3f..f5d9639c3262 100644 --- a/security/tlk_driver/ote_protocol.h +++ b/security/tlk_driver/ote_protocol.h @@ -44,6 +44,8 @@ #define MAX_EXT_SMC_ARGS 12 +extern struct mutex smc_lock; + uint32_t tlk_generic_smc(uint32_t arg0, uint32_t arg1, uint32_t arg2); uint32_t tlk_extended_smc(uint32_t *args); void tlk_irq_handler(void); @@ -121,6 +123,7 @@ enum { TE_SMC_NS_IRQ_DONE = 0xFFFF1FF1, TE_SMC_REGISTER_FS_HANDLERS = 0xFFFF1FF2, TE_SMC_REGISTER_REQ_BUF = 0xFFFF1FF3, + TE_SMC_PROGRAM_VPR = 0xFFFF1FF5, TE_SMC_FS_OP_DONE = 0xFFFF1FFF, TE_SMC_INIT_LOGGER = 0xFFFF1FF4, |