xref: /openbmc/linux/drivers/ras/ras.c (revision 842ed298)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (C) 2014 Intel Corporation
4  *
5  * Authors:
6  *	Chen, Gong <gong.chen@linux.intel.com>
7  */
8 
9 #include <linux/init.h>
10 #include <linux/ras.h>
11 #include <linux/uuid.h>
12 
13 #define CREATE_TRACE_POINTS
14 #define TRACE_INCLUDE_PATH ../../include/ras
15 #include <ras/ras_event.h>
16 
17 void log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id,
18 			    const char *fru_text, const u8 sev, const u8 *err,
19 			    const u32 len)
20 {
21 	trace_non_standard_event(sec_type, fru_id, fru_text, sev, err, len);
22 }
23 
24 void log_arm_hw_error(struct cper_sec_proc_arm *err)
25 {
26 	trace_arm_event(err);
27 }
28 
29 static int __init ras_init(void)
30 {
31 	int rc = 0;
32 
33 	ras_debugfs_init();
34 	rc = ras_add_daemon_trace();
35 
36 	return rc;
37 }
38 subsys_initcall(ras_init);
39 
40 #if defined(CONFIG_ACPI_EXTLOG) || defined(CONFIG_ACPI_EXTLOG_MODULE)
41 EXPORT_TRACEPOINT_SYMBOL_GPL(extlog_mem_event);
42 #endif
43 EXPORT_TRACEPOINT_SYMBOL_GPL(mc_event);
44 EXPORT_TRACEPOINT_SYMBOL_GPL(non_standard_event);
45 EXPORT_TRACEPOINT_SYMBOL_GPL(arm_event);
46 
47 static int __init parse_ras_param(char *str)
48 {
49 #ifdef CONFIG_RAS_CEC
50 	parse_cec_param(str);
51 #endif
52 
53 	return 1;
54 }
55 __setup("ras", parse_ras_param);
56