firmware: qcom_scm: Merge qtee_shmbridge and qcom_scm

Merge qtee_shmbridge and qcom_scm drivers into a single compilation unit.

Change-Id: Icfbf7c335fc8d9468236cdc08dfda52fa563be40
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
This commit is contained in:
Siddharth Gupta 2019-11-13 11:48:46 -08:00 • committed by Elliot Berman
commit 4d0fbd6baf
10 changed files with 50 additions and 16 deletions

View file

@ -29,3 +29,4 @@ CONFIG_ION_POOL_AUTO_REFILL=y
CONFIG_MSM_BT_POWER=m
CONFIG_QCOM_SCM=y
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
CONFIG_QTEE_SHM_BRIDGE=y

View file

@ -9,7 +9,6 @@ CONFIG_ATOMIC64_SELFTEST=m
CONFIG_TEST_USER_COPY=m
CONFIG_PAGE_POISONING_ENABLE_DEFAULT=y
CONFIG_OF_RESERVED_MEM_CHECK=y
CONFIG_QTEE_SHM_BRIDGE=y
CONFIG_SERIAL_MSM_GENI=y
CONFIG_SERIAL_MSM_GENI_CONSOLE=y
CONFIG_MSM_GENI_SE=y

View file

@ -255,6 +255,16 @@ config QCOM_SCM_DOWNLOAD_MODE_DEFAULT
Say Y here to enable "download mode" by default.
config QTEE_SHM_BRIDGE
bool "QTI TEE shared memory bridge"
depends on QCOM_SCM
help
QTEE shared memory bridge driver provides kernel APIs to share
memory between trustzone & other VMs through shared memory bridge.
It allows kernel clients to create bridge, delete bridge, and do
memory sub-allocation and free from the default kernel bridge
created by bridge driver.
config TI_SCI_PROTOCOL
tristate "TI System Control Interface (TISCI) Message Protocol"
depends on TI_MESSAGE_MANAGER

View file

@ -19,6 +19,7 @@ obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o
obj-$(CONFIG_QCOM_SCM) += _qcom_scm.o
_qcom_scm-y += qcom_scm.o qcom_scm-smc.o
_qcom_scm-$(CONFIG_QTEE_SHM_BRIDGE) += qtee_shmbridge.o
obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o
obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
obj-$(CONFIG_TURRIS_MOX_RWTM) += turris-mox-rwtm.o

View file

@ -18,6 +18,7 @@
#include <linux/reset-controller.h>
#include "qcom_scm.h"
#include "qtee_shmbridge_internal.h"
static bool download_mode = IS_ENABLED(CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT);
module_param(download_mode, bool, 0);
@ -632,6 +633,21 @@ static struct platform_driver qcom_scm_driver = {
static int __init qcom_scm_init(void)
{
return platform_driver_register(&qcom_scm_driver);
int ret;
ret = platform_driver_register(&qcom_scm_driver);
if (ret)
return ret;
return qtee_shmbridge_driver_init();
}
subsys_initcall(qcom_scm_init);
#if IS_MODULE(CONFIG_QCOM_SCM)
static void __exit qcom_scm_exit(void)
{
platform_driver_unregister(&qcom_scm_driver);
qtee_shmbridge_driver_exit();
}
module_exit(qcom_scm_exit);
#endif

View file

@ -13,7 +13,9 @@
#include <linux/mod_devicetable.h>
#include <soc/qcom/scm.h>
#include <soc/qcom/qseecomi.h>
#include <soc/qcom/qtee_shmbridge.h>
#include <linux/qtee_shmbridge.h>
#include "qtee_shmbridge_internal.h"
#define DEFAULT_BRIDGE_SIZE SZ_4M /*4M*/
/*
@ -430,6 +432,12 @@ static struct platform_driver qtee_shmbridge_driver = {
},
};
module_platform_driver(qtee_shmbridge_driver);
int __init qtee_shmbridge_driver_init(void)
{
return platform_driver_register(&qtee_shmbridge_driver);
}
MODULE_LICENSE("GPL v2");
void __exit qtee_shmbridge_driver_exit(void)
{
platform_driver_unregister(&qtee_shmbridge_driver);
}

View file

@ -0,0 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2019 The Linux Foundation. All rights reserved.
*/
#ifndef __QCOM_QTEE_SHM_BRIDGE_INT_H_
#define __QCOM_QTEE_SHM_BRIDGE_INT_H_
int __init qtee_shmbridge_driver_init(void);
void __exit qtee_shmbridge_driver_exit(void);
#endif

View file

@ -559,16 +559,6 @@ config QCOM_SOC_SLEEP_STATS
various SoC level low power modes statistics and export to sysfs
interface.
config QTEE_SHM_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.
It allows kernel clients to create bridge, delete bridge, and do
memory sub-allocation and free from the default kernel bridge
created by bridge driver.
config QCOM_WATCHDOG
tristate "Qualcomm Watchdog Support"
depends on ARCH_QCOM

View file

@ -56,6 +56,5 @@ obj-$(CONFIG_QTI_SYSTEM_PM) += system_pm.o
obj-$(CONFIG_MSM_SPSS_UTILS) += spss_utils.o
obj-$(CONFIG_MSM_IDLE_STATS) += lpm-stats.o
obj-$(CONFIG_QTI_RPM_STATS_LOG) += rpmh_master_stat.o
obj-$(CONFIG_QTEE_SHM_BRIDGE) += qtee_shmbridge.o
obj-$(CONFIG_QPNP_PBS) += qpnp-pbs.o
obj-$(CONFIG_QCOM_WATCHDOG) += qcom_watchdog.o