shmbridge: GKI change for shmbridge

make GKI change for shmbridge and temporarily disable
this feature in HYP.

Change-Id: I2e8835d8a68090123ee43247eedc0fbcebd3db21
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
This commit is contained in:
Zhen Kong 2019-10-04 16:57:55 -07:00
commit d574756dfd
2 changed files with 29 additions and 6 deletions

View file

@ -531,7 +531,8 @@ config QCOM_SOC_SLEEP_STATS
interface.
config QTEE_SHM_BRIDGE
bool "QTI TEE shared memory bridge"
tristate "QTI TEE shared memory bridge"
depends on QCOM_SECURE_CHAN_MANAGER
help
QTEE shared memory bridge driver provides kernel APIs to share
memory between trustzone & other VMs through shared memory bridge.

View file

@ -9,7 +9,8 @@
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/genalloc.h>
#include <linux/platform_device.h>
#include <linux/mod_devicetable.h>
#include <soc/qcom/scm.h>
#include <soc/qcom/qseecomi.h>
#include <soc/qcom/qtee_shmbridge.h>
@ -337,7 +338,7 @@ EXPORT_SYMBOL(qtee_shmbridge_free_shm);
* shared memory bridge initialization
*
*/
static int __init qtee_shmbridge_init(void)
static int qtee_shmbridge_init(void)
{
int ret = 0;
uint32_t ns_vm_ids[] = {VMID_HLOS};
@ -378,8 +379,8 @@ static int __init qtee_shmbridge_init(void)
mutex_init(&bridge_list_head.lock);
INIT_LIST_HEAD(&bridge_list_head.head);
/* enable shm bridge mechanism */
ret = qtee_shmbridge_enable(true);
/* temporarily disable shm bridge mechanism */
ret = qtee_shmbridge_enable(false);
if (ret) {
/* keep the mem pool and return if failed to enable bridge */
ret = 0;
@ -410,4 +411,25 @@ exit:
return ret;
}
early_initcall(qtee_shmbridge_init);
static int qtee_shmbridge_probe(struct platform_device *pdev)
{
return qtee_shmbridge_init();
}
static const struct of_device_id qtee_shmbridge_of_match[] = {
{ .compatible = "qcom,tee-shared-memory-bridge"},
{}
};
MODULE_DEVICE_TABLE(of, qtee_shmbridge_of_match);
static struct platform_driver qtee_shmbridge_driver = {
.probe = qtee_shmbridge_probe,
.driver = {
.name = "shared_memory_bridge",
.of_match_table = qtee_shmbridge_of_match,
},
};
module_platform_driver(qtee_shmbridge_driver);
MODULE_LICENSE("GPL v2");