@@ -1737,9 +1737,14 @@ int qcom_scm_qseecom_app_send(u32 app_id, void *req, size_t req_size,
}
EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send);
+static char *qseecom = "auto";
+MODULE_PARM_DESC(qseecom, "Enable QSEECOM interface (force | off | auto)");
+module_param(qseecom, charp, 0);
+
/*
* We do not yet support re-entrant calls via the qseecom interface. To prevent
- + any potential issues with this, only allow validated machines for now.
+ * any potential issues with this, only allow validated machines for now. Users
+ * still can manually enable or disable it via the qcom_scm.qseecom modparam.
*/
static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
{ .compatible = "dell,xps13-9345" },
@@ -1756,11 +1761,21 @@ static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
{ }
};
-static bool qcom_scm_qseecom_machine_is_allowed(void)
+static bool qcom_scm_qseecom_machine_is_allowed(struct device *scm_dev)
{
struct device_node *np;
bool match;
+ if (!strcmp(qseecom, "off")) {
+ dev_info(scm_dev, "qseecom: disabled by modparam\n");
+ return false;
+ } else if (!strcmp(qseecom, "force")) {
+ dev_info(scm_dev, "qseecom: forcebly enabled\n");
+ return true;
+ } else if (strcmp(qseecom, "auto")) {
+ dev_warn(scm_dev, "qseecom: invalid value for the modparam, ignoring\n");
+ }
+
np = of_find_node_by_path("/");
if (!np)
return false;
@@ -1802,7 +1817,7 @@ static int qcom_scm_qseecom_init(struct qcom_scm *scm)
dev_info(scm->dev, "qseecom: found qseecom with version 0x%x\n", version);
- if (!qcom_scm_qseecom_machine_is_allowed()) {
+ if (!qcom_scm_qseecom_machine_is_allowed(scm->dev)) {
dev_info(scm->dev, "qseecom: untested machine, skipping\n");
return 0;
}
In preparation to enabling QSEECOM for the platforms rather than individual machines provide a mechanism for the user to override default selection. Allow users to use qcom_scm.qseecom modparam. Setting it to 'force' will enable QSEECOM even if it disabled or not handled by the allowlist. Setting it to 'off' will forcebly disable the QSEECOM interface, allowing incompatible machines to function. All other values mean 'auto', trusting the allowlist in the module. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/firmware/qcom/qcom_scm.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)