162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright 2010, 2011 Mark Nelson and Tseng-Hui (Frank) Lin, IBM Corporation
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#ifndef _ASM_POWERPC_IO_EVENT_IRQ_H
762306a36Sopenharmony_ci#define _ASM_POWERPC_IO_EVENT_IRQ_H
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include <linux/types.h>
1062306a36Sopenharmony_ci#include <linux/notifier.h>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define PSERIES_IOEI_RPC_MAX_LEN 216
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#define PSERIES_IOEI_TYPE_ERR_DETECTED		0x01
1562306a36Sopenharmony_ci#define PSERIES_IOEI_TYPE_ERR_RECOVERED		0x02
1662306a36Sopenharmony_ci#define PSERIES_IOEI_TYPE_EVENT			0x03
1762306a36Sopenharmony_ci#define PSERIES_IOEI_TYPE_RPC_PASS_THRU		0x04
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_NOT_APP		0x00
2062306a36Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_REBALANCE_REQ	0x01
2162306a36Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_NODE_ONLINE	0x03
2262306a36Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_NODE_OFFLINE	0x04
2362306a36Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_DUMP_SIZE_CHANGE	0x05
2462306a36Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_TORRENT_IRV_UPDATE	0x06
2562306a36Sopenharmony_ci#define PSERIES_IOEI_SUBTYPE_TORRENT_HFI_CFGED	0x07
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_NOT_APP		0x00
2862306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_RIO_HUB		0x36
2962306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_RIO_BRIDGE		0x37
3062306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_PHB			0x38
3162306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_EADS_GLOBAL		0x39
3262306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_EADS_SLOT		0x3A
3362306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_TORRENT_HUB		0x3B
3462306a36Sopenharmony_ci#define PSERIES_IOEI_SCOPE_SERVICE_PROC		0x51
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci/* Platform Event Log Format, Version 6, data portition of IO event section */
3762306a36Sopenharmony_cistruct pseries_io_event {
3862306a36Sopenharmony_ci	uint8_t event_type;		/* 0x00 IO-Event Type		*/
3962306a36Sopenharmony_ci	uint8_t rpc_data_len;		/* 0x01 RPC data length		*/
4062306a36Sopenharmony_ci	uint8_t scope;			/* 0x02 Error/Event Scope	*/
4162306a36Sopenharmony_ci	uint8_t event_subtype;		/* 0x03 I/O-Event Sub-Type	*/
4262306a36Sopenharmony_ci	uint32_t drc_index;		/* 0x04 DRC Index		*/
4362306a36Sopenharmony_ci	uint8_t rpc_data[PSERIES_IOEI_RPC_MAX_LEN];
4462306a36Sopenharmony_ci					/* 0x08 RPC Data (0-216 bytes,	*/
4562306a36Sopenharmony_ci					/* padded to 4 bytes alignment)	*/
4662306a36Sopenharmony_ci};
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciextern struct atomic_notifier_head pseries_ioei_notifier_list;
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci#endif /* _ASM_POWERPC_IO_EVENT_IRQ_H */
51