xref: /openbmc/linux/include/uapi/linux/arm_sdei.h (revision ad6eb31e)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* Copyright (C) 2017 Arm Ltd. */
3 #ifndef _UAPI_LINUX_ARM_SDEI_H
4 #define _UAPI_LINUX_ARM_SDEI_H
5 
6 #define SDEI_1_0_FN_BASE			0xC4000020
7 #define SDEI_1_0_MASK				0xFFFFFFE0
8 #define SDEI_1_0_FN(n)				(SDEI_1_0_FN_BASE + (n))
9 
10 #define SDEI_1_0_FN_SDEI_VERSION			SDEI_1_0_FN(0x00)
11 #define SDEI_1_0_FN_SDEI_EVENT_REGISTER			SDEI_1_0_FN(0x01)
12 #define SDEI_1_0_FN_SDEI_EVENT_ENABLE			SDEI_1_0_FN(0x02)
13 #define SDEI_1_0_FN_SDEI_EVENT_DISABLE			SDEI_1_0_FN(0x03)
14 #define SDEI_1_0_FN_SDEI_EVENT_CONTEXT			SDEI_1_0_FN(0x04)
15 #define SDEI_1_0_FN_SDEI_EVENT_COMPLETE			SDEI_1_0_FN(0x05)
16 #define SDEI_1_0_FN_SDEI_EVENT_COMPLETE_AND_RESUME	SDEI_1_0_FN(0x06)
17 #define SDEI_1_0_FN_SDEI_EVENT_UNREGISTER		SDEI_1_0_FN(0x07)
18 #define SDEI_1_0_FN_SDEI_EVENT_STATUS			SDEI_1_0_FN(0x08)
19 #define SDEI_1_0_FN_SDEI_EVENT_GET_INFO			SDEI_1_0_FN(0x09)
20 #define SDEI_1_0_FN_SDEI_EVENT_ROUTING_SET		SDEI_1_0_FN(0x0A)
21 #define SDEI_1_0_FN_SDEI_PE_MASK			SDEI_1_0_FN(0x0B)
22 #define SDEI_1_0_FN_SDEI_PE_UNMASK			SDEI_1_0_FN(0x0C)
23 #define SDEI_1_0_FN_SDEI_INTERRUPT_BIND			SDEI_1_0_FN(0x0D)
24 #define SDEI_1_0_FN_SDEI_INTERRUPT_RELEASE		SDEI_1_0_FN(0x0E)
25 #define SDEI_1_0_FN_SDEI_PRIVATE_RESET			SDEI_1_0_FN(0x11)
26 #define SDEI_1_0_FN_SDEI_SHARED_RESET			SDEI_1_0_FN(0x12)
27 
28 #define SDEI_VERSION_MAJOR_SHIFT			48
29 #define SDEI_VERSION_MAJOR_MASK				0x7fff
30 #define SDEI_VERSION_MINOR_SHIFT			32
31 #define SDEI_VERSION_MINOR_MASK				0xffff
32 #define SDEI_VERSION_VENDOR_SHIFT			0
33 #define SDEI_VERSION_VENDOR_MASK			0xffffffff
34 
35 #define SDEI_VERSION_MAJOR(x)	(x>>SDEI_VERSION_MAJOR_SHIFT & SDEI_VERSION_MAJOR_MASK)
36 #define SDEI_VERSION_MINOR(x)	(x>>SDEI_VERSION_MINOR_SHIFT & SDEI_VERSION_MINOR_MASK)
37 #define SDEI_VERSION_VENDOR(x)	(x>>SDEI_VERSION_VENDOR_SHIFT & SDEI_VERSION_VENDOR_MASK)
38 
39 /* SDEI return values */
40 #define SDEI_SUCCESS		0
41 #define SDEI_NOT_SUPPORTED	-1
42 #define SDEI_INVALID_PARAMETERS	-2
43 #define SDEI_DENIED		-3
44 #define SDEI_PENDING		-5
45 #define SDEI_OUT_OF_RESOURCE	-10
46 
47 /* EVENT_REGISTER flags */
48 #define SDEI_EVENT_REGISTER_RM_ANY	0
49 #define SDEI_EVENT_REGISTER_RM_PE	1
50 
51 /* EVENT_STATUS return value bits */
52 #define SDEI_EVENT_STATUS_RUNNING	2
53 #define SDEI_EVENT_STATUS_ENABLED	1
54 #define SDEI_EVENT_STATUS_REGISTERED	0
55 
56 /* EVENT_COMPLETE status values */
57 #define SDEI_EV_HANDLED	0
58 #define SDEI_EV_FAILED	1
59 
60 /* GET_INFO values */
61 #define SDEI_EVENT_INFO_EV_TYPE			0
62 #define SDEI_EVENT_INFO_EV_SIGNALED		1
63 #define SDEI_EVENT_INFO_EV_PRIORITY		2
64 #define SDEI_EVENT_INFO_EV_ROUTING_MODE		3
65 #define SDEI_EVENT_INFO_EV_ROUTING_AFF		4
66 
67 /* and their results */
68 #define SDEI_EVENT_TYPE_PRIVATE			0
69 #define SDEI_EVENT_TYPE_SHARED			1
70 #define SDEI_EVENT_PRIORITY_NORMAL		0
71 #define SDEI_EVENT_PRIORITY_CRITICAL		1
72 
73 #endif /* _UAPI_LINUX_ARM_SDEI_H */
74