soc: qcom: scm-xpu: add support for XPU errors that are fatal by default

The existing scm-xpu implementation makes an unconditional scm
call at boot. The assumption was that such errors would be non-
fatal by default, and so a desired behavior could be achieved
by controlling whether the driver was compiled.

On recent targets like msm8996, XPU errors are treated as
fatal by default. To support cases where it may be desirable
to treat them as non-fatal, the driver must be changed to
make the appropriate scm call based on a new Kconfig choice.

Change-Id: Ibb55c062937f130c13538f049582575d9a6f52ad
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
This commit is contained in:
Matt Wagantall 2015-08-24 20:00:56 -07:00 committed by Rohit Vaswani
parent 1106cef201
commit 99a2064db2
3 changed files with 27 additions and 6 deletions

View file

@ -54,7 +54,26 @@ config QCOM_SCM
bool "Secure Channel Manager (SCM) support"
default n
menuconfig QCOM_SCM_XPU
bool "Qualcomm XPU configuration driver"
depends on QCOM_SCM
if QCOM_SCM_XPU
choice
prompt "XPU Violation Behavior"
default QCOM_XPU_ERR_FATAL
config QCOM_XPU_ERR_FATAL
bool "Configure XPU violations as fatal errors"
help
Select if XPU violations have to be configured as fatal errors.
config QCOM_XPU_ERR_NONFATAL
bool "Configure XPU violations as non-fatal errors"
help
Select if XPU violations have to be configured as non-fatal errors.
endchoice
endif

View file

@ -6,4 +6,4 @@ obj-$(CONFIG_QCOM_SMEM) += smem.o
CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
obj-$(CONFIG_QCOM_SCM) += scm.o scm-boot.o
obj-$(CONFIG_QCOM_XPU_ERR_FATAL) += scm-xpu.o
obj-$(CONFIG_QCOM_SCM_XPU) += scm-xpu.o

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, 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
@ -14,10 +14,12 @@
#include <linux/kernel.h>
#include <soc/qcom/scm.h>
#if defined(CONFIG_QCOM_XPU_ERR_FATAL)
#define ERR_FATAL_VAL 0x0
#elif defined(CONFIG_QCOM_XPU_ERR_NONFATAL)
#define ERR_FATAL_VAL 0x1
#endif
#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)
@ -30,7 +32,7 @@ static int __init xpu_err_fatal_init(void)
struct scm_desc desc = {0};
desc.arginfo = SCM_ARGS(2);
desc.args[0] = cmd.config = ERR_FATAL_ENABLE;
desc.args[0] = cmd.config = ERR_FATAL_VAL;
desc.args[1] = cmd.spare = 0;
if (!is_scm_armv8())