18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2014 Intel Corporation
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Authors:
68c2ecf20Sopenharmony_ci *	Chen, Gong <gong.chen@linux.intel.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/init.h>
108c2ecf20Sopenharmony_ci#include <linux/ras.h>
118c2ecf20Sopenharmony_ci#include <linux/uuid.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define CREATE_TRACE_POINTS
148c2ecf20Sopenharmony_ci#define TRACE_INCLUDE_PATH ../../include/ras
158c2ecf20Sopenharmony_ci#include <ras/ras_event.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_civoid log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id,
188c2ecf20Sopenharmony_ci			    const char *fru_text, const u8 sev, const u8 *err,
198c2ecf20Sopenharmony_ci			    const u32 len)
208c2ecf20Sopenharmony_ci{
218c2ecf20Sopenharmony_ci	trace_non_standard_event(sec_type, fru_id, fru_text, sev, err, len);
228c2ecf20Sopenharmony_ci}
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_civoid log_arm_hw_error(struct cper_sec_proc_arm *err)
258c2ecf20Sopenharmony_ci{
268c2ecf20Sopenharmony_ci	trace_arm_event(err);
278c2ecf20Sopenharmony_ci}
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_cistatic int __init ras_init(void)
308c2ecf20Sopenharmony_ci{
318c2ecf20Sopenharmony_ci	int rc = 0;
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci	ras_debugfs_init();
348c2ecf20Sopenharmony_ci	rc = ras_add_daemon_trace();
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci	return rc;
378c2ecf20Sopenharmony_ci}
388c2ecf20Sopenharmony_cisubsys_initcall(ras_init);
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#if defined(CONFIG_ACPI_EXTLOG) || defined(CONFIG_ACPI_EXTLOG_MODULE)
418c2ecf20Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(extlog_mem_event);
428c2ecf20Sopenharmony_ci#endif
438c2ecf20Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(mc_event);
448c2ecf20Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(non_standard_event);
458c2ecf20Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(arm_event);
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_cistatic int __init parse_ras_param(char *str)
488c2ecf20Sopenharmony_ci{
498c2ecf20Sopenharmony_ci#ifdef CONFIG_RAS_CEC
508c2ecf20Sopenharmony_ci	parse_cec_param(str);
518c2ecf20Sopenharmony_ci#endif
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci	return 1;
548c2ecf20Sopenharmony_ci}
558c2ecf20Sopenharmony_ci__setup("ras", parse_ras_param);
56