blob: 0c38842045fa6191fefc7600735e4a9f0481b531 [file] [log] [blame]
Syed Rameez Mustafa37f93472013-03-18 15:49:48 -07001/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15
16#include <mach/scm.h>
17
18#define ERR_FATAL_ENABLE 0x0
19#define ERR_FATAL_DISABLE 0x1
20#define ERR_FATAL_READ 0x2
21#define XPU_ERR_FATAL 0xe
22
23static int __init xpu_err_fatal_init(void)
24{
25 int ret, response;
26 struct {
27 unsigned int config;
28 unsigned int spare;
29 } cmd;
30 cmd.config = ERR_FATAL_ENABLE;
31 cmd.spare = 0;
32
33 ret = scm_call(SCM_SVC_MP, XPU_ERR_FATAL, &cmd, sizeof(cmd), &response,
34 sizeof(response));
35
36 if (ret != 0)
37 pr_warn("Failed to set XPU violations as fatal errors: %d\n",
38 ret);
39 else
40 pr_info("Configuring XPU violations to be fatal errors\n");
41
42 return ret;
43}
44early_initcall(xpu_err_fatal_init);