Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7876bae5 authored by Matt Wagantall's avatar Matt Wagantall
Browse files

soc: qcom: Add snapshot of scm-xpu driver from msm-3.10



This snapshot is taken as of msm-3.10 commit:
  e3a3f66e47 ("Merge "soc: qcom: pil-q6v5-mss: Do not free memory
  allocated to modem pil")

When compiled, the scm-xpu driver makes a single scm call at boot
to enable treatment of XPU errors as fatal.

Change-Id: Id33c2b73f4ed7ba8a07c5affebbe66eb5eba7951
Signed-off-by: default avatarMatt Wagantall <mattw@codeaurora.org>
parent 7f8441ae
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -273,6 +273,11 @@ config MSM_SCM
       bool "Secure Channel Manager (SCM) support"
       bool "Secure Channel Manager (SCM) support"
       default n
       default n


config MSM_XPU_ERR_FATAL
	bool "Configure XPU violations as fatal errors"
	help
	 Select if XPU violations have to be configured as fatal errors.

config MSM_MPM_OF
config MSM_MPM_OF
       bool "Modem Power Manager"
       bool "Modem Power Manager"
       depends on OF
       depends on OF
+1 −0
Original line number Original line Diff line number Diff line
@@ -81,3 +81,4 @@ obj-$(CONFIG_ICNSS) += icnss.o
obj-$(CONFIG_MSM_BAM_DMUX) += bam_dmux.o
obj-$(CONFIG_MSM_BAM_DMUX) += bam_dmux.o
obj-$(CONFIG_MSM_SERVICE_LOCATOR) += service-locator.o
obj-$(CONFIG_MSM_SERVICE_LOCATOR) += service-locator.o
obj-$(CONFIG_MSM_QBT1000) += qbt1000.o
obj-$(CONFIG_MSM_QBT1000) += qbt1000.o
obj-$(CONFIG_MSM_XPU_ERR_FATAL) += scm-xpu.o
+50 −0
Original line number Original line Diff line number Diff line
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <linux/init.h>
#include <linux/kernel.h>
#include <soc/qcom/scm.h>


#define ERR_FATAL_ENABLE 0x0
#define ERR_FATAL_DISABLE 0x1
#define ERR_FATAL_READ 0x2
#define XPU_ERR_FATAL 0xe

static int __init xpu_err_fatal_init(void)
{
	int ret, response;
	struct {
		unsigned int config;
		unsigned int spare;
	} cmd;
	struct scm_desc desc = {0};

	desc.arginfo = SCM_ARGS(2);
	desc.args[0] = cmd.config = ERR_FATAL_ENABLE;
	desc.args[1] = cmd.spare = 0;

	if (!is_scm_armv8())
		ret = scm_call(SCM_SVC_MP, XPU_ERR_FATAL, &cmd, sizeof(cmd),
				&response, sizeof(response));
	else
		ret = scm_call2(SCM_SIP_FNID(SCM_SVC_MP, XPU_ERR_FATAL), &desc);

	if (ret != 0)
		pr_warn("Failed to set XPU violations as fatal errors: %d\n",
			ret);
	else
		pr_info("Configuring XPU violations to be fatal errors\n");

	return ret;
}
early_initcall(xpu_err_fatal_init);