18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright 2010, 2011 Mark Nelson and Tseng-Hui (Frank) Lin, IBM Corporation
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef _ASM_POWERPC_IO_EVENT_IRQ_H
78c2ecf20Sopenharmony_ci#define _ASM_POWERPC_IO_EVENT_IRQ_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/types.h>
108c2ecf20Sopenharmony_ci#include <linux/notifier.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define PSERIES_IOEI_RPC_MAX_LEN 216
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define PSERIES_IOEI_TYPE_ERR_DETECTED		0x01
158c2ecf20Sopenharmony_ci#define PSERIES_IOEI_TYPE_ERR_RECOVERED		0x02
168c2ecf20Sopenharmony_ci#define PSERIES_IOEI_TYPE_EVENT			0x03
178c2ecf20Sopenharmony_ci#define PSERIES_IOEI_TYPE_RPC_PASS_THRU		0x04
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_NOT_APP		0x00
208c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_REBALANCE_REQ	0x01
218c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_NODE_ONLINE	0x03
228c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_NODE_OFFLINE	0x04
238c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_DUMP_SIZE_CHANGE	0x05
248c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_TORRENT_IRV_UPDATE	0x06
258c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_TORRENT_HFI_CFGED	0x07
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_NOT_APP		0x00
288c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_RIO_HUB		0x36
298c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_RIO_BRIDGE		0x37
308c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_PHB			0x38
318c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_EADS_GLOBAL		0x39
328c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_EADS_SLOT		0x3A
338c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_TORRENT_HUB		0x3B
348c2ecf20Sopenharmony_ci#define PSERIES_IOEI_SCOPE_SERVICE_PROC		0x51
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/* Platform Event Log Format, Version 6, data portition of IO event section */
378c2ecf20Sopenharmony_cistruct pseries_io_event {
388c2ecf20Sopenharmony_ci	uint8_t event_type;		/* 0x00 IO-Event Type		*/
398c2ecf20Sopenharmony_ci	uint8_t rpc_data_len;		/* 0x01 RPC data length		*/
408c2ecf20Sopenharmony_ci	uint8_t scope;			/* 0x02 Error/Event Scope	*/
418c2ecf20Sopenharmony_ci	uint8_t event_subtype;		/* 0x03 I/O-Event Sub-Type	*/
428c2ecf20Sopenharmony_ci	uint32_t drc_index;		/* 0x04 DRC Index		*/
438c2ecf20Sopenharmony_ci	uint8_t rpc_data[PSERIES_IOEI_RPC_MAX_LEN];
448c2ecf20Sopenharmony_ci					/* 0x08 RPC Data (0-216 bytes,	*/
458c2ecf20Sopenharmony_ci					/* padded to 4 bytes alignment)	*/
468c2ecf20Sopenharmony_ci};
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciextern struct atomic_notifier_head pseries_ioei_notifier_list;
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#endif /* _ASM_POWERPC_IO_EVENT_IRQ_H */
51