summaryrefslogtreecommitdiff
path: root/drivers/edac/pnd2_edac.h
blob: 028ef701701bcdb853cc9e8a83761720a1504c67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Register bitfield descriptions for Pondicherry2 memory controller.
 *
 * Copyright (c) 2016, Intel Corporation.
 */

#ifndef _PND2_REGS_H
#define _PND2_REGS_H

struct b_cr_touud_lo_pci {
	u32	lock : 1;
	u32	reserved_1 : 19;
	u32	touud : 12;
};

#define b_cr_touud_lo_pci_port 0x4c
#define b_cr_touud_lo_pci_offset 0xa8
#define b_cr_touud_lo_pci_r_opcode 0x04

struct b_cr_touud_hi_pci {
	u32	touud : 7;
	u32	reserved_0 : 25;
};

#define b_cr_touud_hi_pci_port 0x4c
#define b_cr_touud_hi_pci_offset 0xac
#define b_cr_touud_hi_pci_r_opcode 0x04

struct b_cr_tolud_pci {
	u32	lock : 1;
	u32	reserved_0 : 19;
	u32	tolud : 12;
};

#define b_cr_tolud_pci_port 0x4c
#define b_cr_tolud_pci_offset 0xbc
#define b_cr_tolud_pci_r_opcode 0x04

struct b_cr_mchbar_lo_pci {
	u32 enable : 1;
	u32 pad_3_1 : 3;
	u32 pad_14_4: 11;
	u32 base: 17;
};

struct b_cr_mchbar_hi_pci {
	u32 base : 7;
	u32 pad_31_7 : 25;
};

/* Symmetric region */
struct b_cr_slice_channel_hash {
	u64	slice_1_disabled : 1;
	u64	hvm_mode : 1;
	u64	interleave_mode : 2;
	u64	slice_0_mem_disabled : 1;
	u64	reserved_0 : 1;
	u64	slice_hash_mask : 14;
	u64	reserved_1 : 11;
	u64	enable_pmi_dual_data_mode : 1;
	u64	ch_1_disabled : 1;
	u64	reserved_2 : 1;
	u64	sym_slice0_channel_enabled : 2;
	u64	sym_slice1_channel_enabled : 2;
	u64	ch_hash_mask : 14;
	u64	reserved_3 : 11;
	u64	lock : 1;
};

#define b_cr_slice_channel_hash_port 0x4c
#define b_cr_slice_channel_hash_offset 0x4c58
#define b_cr_slice_channel_hash_r_opcode 0x06

struct b_cr_mot_out_base_mchbar {
	u32	reserved_0 : 14;
	u32	mot_out_base : 15;
	u32	reserved_1 : 1;
	u32	tr_en : 1;
	u32	imr_en : 1;
};

#define b_cr_mot_out_base_mchbar_port 0x4c
#define b_cr_mot_out_base_mchbar_offset 0x6af0
#define b_cr_mot_out_base_mchbar_r_opcode 0x00

struct b_cr_mot_out_mask_mchbar {
	u32	reserved_0 : 14;
	u32	mot_out_mask : 15;
	u32	reserved_1 : 1;
	u32	ia_iwb_en : 1;
	u32	gt_iwb_en : 1;
};

#define b_cr_mot_out_mask_mchbar_port 0x4c
#define b_cr_mot_out_mask_mchbar_offset 0x6af4
#define b_cr_mot_out_mask_mchbar_r_opcode 0x00

struct b_cr_asym_mem_region0_mchbar {
	u32	pad : 4;
	u32	slice0_asym_base : 11;
	u32	pad_18_15 : 4;
	u32	slice0_asym_limit : 11;
	u32	slice0_asym_channel_select : 1;
	u32	slice0_asym_enable : 1;
};

#define b_cr_asym_mem_region0_mchbar_port 0x4c
#define b_cr_asym_mem_region0_mchbar_offset 0x6e40
#define b_cr_asym_mem_region0_mchbar_r_opcode 0x00

struct b_cr_asym_mem_region1_mchbar {
	u32	pad : 4;
	u32	slice1_asym_base : 11;
	u32	pad_18_15 : 4;
	u32	slice1_asym_limit : 11;
	u32	slice1_asym_channel_select : 1;
	u32	slice1_asym_enable : 1;
};

#define b_cr_asym_mem_region1_mchbar_port 0x4c
#define b_cr_asym_mem_region1_mchbar_offset 0x6e44
#define b_cr_asym_mem_region1_mchbar_r_opcode 0x00

/* Some bit fields moved in above two structs on Denverton */
struct b_cr_asym_mem_region_denverton {
	u32	pad : 4;
	u32	slice_asym_base : 8;
	u32	pad_19_12 : 8;
	u32	slice_asym_limit : 8;
	u32	pad_28_30 : 3;
	u32	slice_asym_enable : 1;
};

struct b_cr_asym_2way_mem_region_mchbar {
	u32	pad : 2;
	u32	asym_2way_intlv_mode : 2;
	u32	asym_2way_base : 11;
	u32	pad_16_15 : 2;
	u32	asym_2way_limit : 11;
	u32	pad_30_28 : 3;
	u32	asym_2way_interleave_enable : 1;
};

#define b_cr_asym_2way_mem_region_mchbar_port 0x4c
#define b_cr_asym_2way_mem_region_mchbar_offset 0x6e50
#define b_cr_asym_2way_mem_region_mchbar_r_opcode 0x00

/* Apollo Lake d-unit */

struct d_cr_drp0 {
	u32	rken0 : 1;
	u32	rken1 : 1;
	u32	ddmen : 1;
	u32	rsvd3 : 1;
	u32	dwid : 2;
	u32	dden : 3;
	u32	rsvd13_9 : 5;
	u32	rsien : 1;
	u32	bahen : 1;
	u32	rsvd18_16 : 3;
	u32	caswizzle : 2;
	u32	eccen : 1;
	u32	dramtype : 3;
	u32	blmode : 3;
	u32	addrdec : 2;
	u32	dramdevice_pr : 2;
};

#define d_cr_drp0_offset 0x1400
#define d_cr_drp0_r_opcode 0x00

/* Denverton d-unit */

struct d_cr_dsch {
	u32	ch0en : 1;
	u32	ch1en : 1;
	u32	ddr4en : 1;
	u32	coldwake : 1;
	u32	newbypdis : 1;
	u32	chan_width : 1;
	u32	rsvd6_6 : 1;
	u32	ooodis : 1;
	u32	rsvd18_8 : 11;
	u32	ic : 1;
	u32	rsvd31_20 : 12;
};

#define d_cr_dsch_port 0x16
#define d_cr_dsch_offset 0x0
#define d_cr_dsch_r_opcode 0x0

struct d_cr_ecc_ctrl {
	u32	eccen : 1;
	u32	rsvd31_1 : 31;
};

#define d_cr_ecc_ctrl_offset 0x180
#define d_cr_ecc_ctrl_r_opcode 0x0

struct d_cr_drp {
	u32	rken0 : 1;
	u32	rken1 : 1;
	u32	rken2 : 1;
	u32	rken3 : 1;
	u32	dimmdwid0 : 2;
	u32	dimmdden0 : 2;
	u32	dimmdwid1 : 2;
	u32	dimmdden1 : 2;
	u32	rsvd15_12 : 4;
	u32	dimmflip : 1;
	u32	rsvd31_17 : 15;
};

#define d_cr_drp_offset 0x158
#define d_cr_drp_r_opcode 0x0

struct d_cr_dmap {
	u32	ba0 : 5;
	u32	ba1 : 5;
	u32	bg0 : 5; /* if ddr3, ba2 = bg0 */
	u32	bg1 : 5; /* if ddr3, ba3 = bg1 */
	u32	rs0 : 5;
	u32	rs1 : 5;
	u32	rsvd : 2;
};

#define d_cr_dmap_offset 0x174
#define d_cr_dmap_r_opcode 0x0

struct d_cr_dmap1 {
	u32	ca11 : 6;
	u32	bxor : 1;
	u32	rsvd : 25;
};

#define d_cr_dmap1_offset 0xb4
#define d_cr_dmap1_r_opcode 0x0

struct d_cr_dmap2 {
	u32	row0 : 5;
	u32	row1 : 5;
	u32	row2 : 5;
	u32	row3 : 5;
	u32	row4 : 5;
	u32	row5 : 5;
	u32	rsvd : 2;
};

#define d_cr_dmap2_offset 0x148
#define d_cr_dmap2_r_opcode 0x0

struct d_cr_dmap3 {
	u32	row6 : 5;
	u32	row7 : 5;
	u32	row8 : 5;
	u32	row9 : 5;
	u32	row10 : 5;
	u32	row11 : 5;
	u32	rsvd : 2;
};

#define d_cr_dmap3_offset 0x14c
#define d_cr_dmap3_r_opcode 0x0

struct d_cr_dmap4 {
	u32	row12 : 5;
	u32	row13 : 5;
	u32	row14 : 5;
	u32	row15 : 5;
	u32	row16 : 5;
	u32	row17 : 5;
	u32	rsvd : 2;
};

#define d_cr_dmap4_offset 0x150
#define d_cr_dmap4_r_opcode 0x0

struct d_cr_dmap5 {
	u32	ca3 : 4;
	u32	ca4 : 4;
	u32	ca5 : 4;
	u32	ca6 : 4;
	u32	ca7 : 4;
	u32	ca8 : 4;
	u32	ca9 : 4;
	u32	rsvd : 4;
};

#define d_cr_dmap5_offset 0x154
#define d_cr_dmap5_r_opcode 0x0

#endif /* _PND2_REGS_H */