1
2
3
4
5
6
7
8
9#ifndef NHI_REGS_H_
10#define NHI_REGS_H_
11
12#include <linux/types.h>
13
14enum ring_flags {
15 RING_FLAG_ISOCH_ENABLE = 1 << 27,
16 RING_FLAG_E2E_FLOW_CONTROL = 1 << 28,
17 RING_FLAG_PCI_NO_SNOOP = 1 << 29,
18 RING_FLAG_RAW = 1 << 30,
19 RING_FLAG_ENABLE = 1 << 31,
20};
21
22
23
24
25
26
27
28struct ring_desc {
29 u64 phys;
30 u32 length:12;
31 u32 eof:4;
32 u32 sof:4;
33 enum ring_desc_flags flags:12;
34 u32 time;
35} __packed;
36
37
38
39
40
41
42
43
44
45
46#define REG_TX_RING_BASE 0x00000
47
48
49
50
51
52
53
54
55
56#define REG_RX_RING_BASE 0x08000
57
58
59
60
61
62
63
64#define REG_TX_OPTIONS_BASE 0x19800
65
66
67
68
69
70
71
72
73
74#define REG_RX_OPTIONS_BASE 0x29800
75#define REG_RX_OPTIONS_E2E_HOP_MASK GENMASK(22, 12)
76#define REG_RX_OPTIONS_E2E_HOP_SHIFT 12
77
78
79
80
81
82
83
84#define REG_RING_NOTIFY_BASE 0x37800
85#define RING_NOTIFY_REG_COUNT(nhi) ((31 + 3 * nhi->hop_count) / 32)
86
87
88
89
90
91
92#define REG_RING_INTERRUPT_BASE 0x38200
93#define RING_INTERRUPT_REG_COUNT(nhi) ((31 + 2 * nhi->hop_count) / 32)
94
95#define REG_INT_THROTTLING_RATE 0x38c00
96
97
98#define REG_INT_VEC_ALLOC_BASE 0x38c40
99#define REG_INT_VEC_ALLOC_BITS 4
100#define REG_INT_VEC_ALLOC_MASK GENMASK(3, 0)
101#define REG_INT_VEC_ALLOC_REGS (32 / REG_INT_VEC_ALLOC_BITS)
102
103
104#define REG_HOP_COUNT 0x39640
105
106#define REG_DMA_MISC 0x39864
107#define REG_DMA_MISC_INT_AUTO_CLEAR BIT(2)
108
109#define REG_INMAIL_DATA 0x39900
110
111#define REG_INMAIL_CMD 0x39904
112#define REG_INMAIL_CMD_MASK GENMASK(7, 0)
113#define REG_INMAIL_ERROR BIT(30)
114#define REG_INMAIL_OP_REQUEST BIT(31)
115
116#define REG_OUTMAIL_CMD 0x3990c
117#define REG_OUTMAIL_CMD_OPMODE_SHIFT 8
118#define REG_OUTMAIL_CMD_OPMODE_MASK GENMASK(11, 8)
119
120#define REG_FW_STS 0x39944
121#define REG_FW_STS_NVM_AUTH_DONE BIT(31)
122#define REG_FW_STS_CIO_RESET_REQ BIT(30)
123#define REG_FW_STS_ICM_EN_CPU BIT(2)
124#define REG_FW_STS_ICM_EN_INVERT BIT(1)
125#define REG_FW_STS_ICM_EN BIT(0)
126
127
128
129
130#define VS_CAP_9 0xc8
131#define VS_CAP_9_FW_READY BIT(31)
132
133#define VS_CAP_10 0xcc
134#define VS_CAP_11 0xd0
135
136#define VS_CAP_15 0xe0
137#define VS_CAP_16 0xe4
138
139#define VS_CAP_18 0xec
140#define VS_CAP_18_DONE BIT(0)
141
142#define VS_CAP_19 0xf0
143#define VS_CAP_19_VALID BIT(0)
144#define VS_CAP_19_CMD_SHIFT 1
145#define VS_CAP_19_CMD_MASK GENMASK(7, 1)
146
147#define VS_CAP_22 0xfc
148#define VS_CAP_22_FORCE_POWER BIT(1)
149#define VS_CAP_22_DMA_DELAY_MASK GENMASK(31, 24)
150#define VS_CAP_22_DMA_DELAY_SHIFT 24
151
152
153
154
155
156
157
158enum icl_lc_mailbox_cmd {
159 ICL_LC_GO2SX = 0x02,
160 ICL_LC_GO2SX_NO_WAKE = 0x03,
161 ICL_LC_PREPARE_FOR_RESET = 0x21,
162};
163
164#endif
165