xref: /linux/drivers/gpu/drm/xe/regs/xe_irq_regs.h (revision 26bb2dc102783fef49336b26a94563318f9790d3)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2024 Intel Corporation
4  */
5 #ifndef _XE_IRQ_REGS_H_
6 #define _XE_IRQ_REGS_H_
7 
8 #include "regs/xe_reg_defs.h"
9 
10 #define PCU_IRQ_OFFSET				0x444e0
11 #define GU_MISC_IRQ_OFFSET			0x444f0
12 #define   GU_MISC_GSE				REG_BIT(27)
13 
14 #define DG1_MSTR_TILE_INTR			XE_REG(0x190008)
15 #define   DG1_MSTR_IRQ				REG_BIT(31)
16 #define   DG1_MSTR_TILE(t)			REG_BIT(t)
17 
18 #define GFX_MSTR_IRQ				XE_REG(0x190010, XE_REG_OPTION_VF)
19 #define   MASTER_IRQ				REG_BIT(31)
20 #define   GU_MISC_IRQ				REG_BIT(29)
21 #define   DISPLAY_IRQ				REG_BIT(16)
22 #define   GT_DW_IRQ(x)				REG_BIT(x)
23 
24 /*
25  * Note: Interrupt registers 1900xx are VF accessible only until version 12.50.
26  *       On newer platforms, VFs are using memory-based interrupts instead.
27  *       However, for simplicity we keep this XE_REG_OPTION_VF tag intact.
28  */
29 
30 #define GT_INTR_DW(x)				XE_REG(0x190018 + ((x) * 4), XE_REG_OPTION_VF)
31 #define   INTR_GSC				REG_BIT(31)
32 #define   INTR_GUC				REG_BIT(25)
33 #define   INTR_MGUC				REG_BIT(24)
34 #define   INTR_BCS8				REG_BIT(23)
35 #define   INTR_BCS(x)				REG_BIT(15 - (x))
36 #define   INTR_CCS(x)				REG_BIT(4 + (x))
37 #define   INTR_RCS0				REG_BIT(0)
38 #define   INTR_VECS(x)				REG_BIT(31 - (x))
39 #define   INTR_VCS(x)				REG_BIT(x)
40 
41 #define RENDER_COPY_INTR_ENABLE			XE_REG(0x190030, XE_REG_OPTION_VF)
42 #define VCS_VECS_INTR_ENABLE			XE_REG(0x190034, XE_REG_OPTION_VF)
43 #define GUC_SG_INTR_ENABLE			XE_REG(0x190038, XE_REG_OPTION_VF)
44 #define   ENGINE1_MASK				REG_GENMASK(31, 16)
45 #define   ENGINE0_MASK				REG_GENMASK(15, 0)
46 #define GPM_WGBOXPERF_INTR_ENABLE		XE_REG(0x19003c, XE_REG_OPTION_VF)
47 #define GUNIT_GSC_INTR_ENABLE			XE_REG(0x190044, XE_REG_OPTION_VF)
48 #define CCS_RSVD_INTR_ENABLE			XE_REG(0x190048, XE_REG_OPTION_VF)
49 
50 #define INTR_IDENTITY_REG(x)			XE_REG(0x190060 + ((x) * 4), XE_REG_OPTION_VF)
51 #define   INTR_DATA_VALID			REG_BIT(31)
52 #define   INTR_ENGINE_INSTANCE(x)		REG_FIELD_GET(GENMASK(25, 20), x)
53 #define   INTR_ENGINE_CLASS(x)			REG_FIELD_GET(GENMASK(18, 16), x)
54 #define   INTR_ENGINE_INTR(x)			REG_FIELD_GET(GENMASK(15, 0), x)
55 #define   OTHER_GUC_INSTANCE			0
56 #define   OTHER_GSC_HECI2_INSTANCE		3
57 #define   OTHER_GSC_INSTANCE			6
58 
59 #define IIR_REG_SELECTOR(x)			XE_REG(0x190070 + ((x) * 4), XE_REG_OPTION_VF)
60 #define RCS0_RSVD_INTR_MASK			XE_REG(0x190090, XE_REG_OPTION_VF)
61 #define BCS_RSVD_INTR_MASK			XE_REG(0x1900a0, XE_REG_OPTION_VF)
62 #define VCS0_VCS1_INTR_MASK			XE_REG(0x1900a8, XE_REG_OPTION_VF)
63 #define VCS2_VCS3_INTR_MASK			XE_REG(0x1900ac, XE_REG_OPTION_VF)
64 #define VECS0_VECS1_INTR_MASK			XE_REG(0x1900d0, XE_REG_OPTION_VF)
65 #define HECI2_RSVD_INTR_MASK			XE_REG(0x1900e4)
66 #define GUC_SG_INTR_MASK			XE_REG(0x1900e8, XE_REG_OPTION_VF)
67 #define GPM_WGBOXPERF_INTR_MASK			XE_REG(0x1900ec, XE_REG_OPTION_VF)
68 #define GUNIT_GSC_INTR_MASK			XE_REG(0x1900f4, XE_REG_OPTION_VF)
69 #define CCS0_CCS1_INTR_MASK			XE_REG(0x190100)
70 #define CCS2_CCS3_INTR_MASK			XE_REG(0x190104)
71 #define XEHPC_BCS1_BCS2_INTR_MASK		XE_REG(0x190110)
72 #define XEHPC_BCS3_BCS4_INTR_MASK		XE_REG(0x190114)
73 #define XEHPC_BCS5_BCS6_INTR_MASK		XE_REG(0x190118)
74 #define XEHPC_BCS7_BCS8_INTR_MASK		XE_REG(0x19011c)
75 #define   GT_WAIT_SEMAPHORE_INTERRUPT		REG_BIT(11)
76 #define   GT_CONTEXT_SWITCH_INTERRUPT		REG_BIT(8)
77 #define   GSC_ER_COMPLETE			REG_BIT(5)
78 #define   GT_RENDER_PIPECTL_NOTIFY_INTERRUPT	REG_BIT(4)
79 #define   GT_CS_MASTER_ERROR_INTERRUPT		REG_BIT(3)
80 #define   GT_RENDER_USER_INTERRUPT		REG_BIT(0)
81 
82 #endif
83