hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/edac/amd64_edac.h
....@@ -96,6 +96,7 @@
9696 /* Hardware limit on ChipSelect rows per MC and processors per system */
9797 #define NUM_CHIPSELECTS 8
9898 #define DRAM_RANGES 8
99
+#define NUM_CONTROLLERS 8
99100
100101 #define ON true
101102 #define OFF false
....@@ -119,6 +120,12 @@
119120 #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F6 0x15ee
120121 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F0 0x1490
121122 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F6 0x1496
123
+#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F0 0x1448
124
+#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F6 0x144e
125
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F0 0x1440
126
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F6 0x1446
127
+#define PCI_DEVICE_ID_AMD_19H_DF_F0 0x1650
128
+#define PCI_DEVICE_ID_AMD_19H_DF_F6 0x1656
122129
123130 /*
124131 * Function 1 - Address Map
....@@ -168,7 +175,8 @@
168175 #define DCSM0 0x60
169176 #define DCSM1 0x160
170177
171
-#define csrow_enabled(i, dct, pvt) ((pvt)->csels[(dct)].csbases[(i)] & DCSB_CS_ENABLE)
178
+#define csrow_enabled(i, dct, pvt) ((pvt)->csels[(dct)].csbases[(i)] & DCSB_CS_ENABLE)
179
+#define csrow_sec_enabled(i, dct, pvt) ((pvt)->csels[(dct)].csbases_sec[(i)] & DCSB_CS_ENABLE)
172180
173181 #define DRAM_CONTROL 0x78
174182
....@@ -258,7 +266,9 @@
258266
259267 /* UMC CH register offsets */
260268 #define UMCCH_BASE_ADDR 0x0
269
+#define UMCCH_BASE_ADDR_SEC 0x10
261270 #define UMCCH_ADDR_MASK 0x20
271
+#define UMCCH_ADDR_MASK_SEC 0x28
262272 #define UMCCH_ADDR_CFG 0x30
263273 #define UMCCH_DIMM_CFG 0x80
264274 #define UMCCH_UMC_CFG 0x100
....@@ -274,8 +284,6 @@
274284
275285 #define UMC_SDP_INIT BIT(31)
276286
277
-#define NUM_UMCS 2
278
-
279287 enum amd_families {
280288 K8_CPUS = 0,
281289 F10_CPUS,
....@@ -287,6 +295,9 @@
287295 F17_CPUS,
288296 F17_M10H_CPUS,
289297 F17_M30H_CPUS,
298
+ F17_M60H_CPUS,
299
+ F17_M70H_CPUS,
300
+ F19_CPUS,
290301 NUM_FAMILIES,
291302 };
292303
....@@ -313,9 +324,11 @@
313324 /* A DCT chip selects collection */
314325 struct chip_select {
315326 u32 csbases[NUM_CHIPSELECTS];
327
+ u32 csbases_sec[NUM_CHIPSELECTS];
316328 u8 b_cnt;
317329
318330 u32 csmasks[NUM_CHIPSELECTS];
331
+ u32 csmasks_sec[NUM_CHIPSELECTS];
319332 u8 m_cnt;
320333 };
321334
....@@ -353,8 +366,8 @@
353366 u32 dbam0; /* DRAM Base Address Mapping reg for DCT0 */
354367 u32 dbam1; /* DRAM Base Address Mapping reg for DCT1 */
355368
356
- /* one for each DCT */
357
- struct chip_select csels[2];
369
+ /* one for each DCT/UMC */
370
+ struct chip_select csels[NUM_CONTROLLERS];
358371
359372 /* DRAM base and limit pairs F1x[78,70,68,60,58,50,48,40] */
360373 struct dram_range ranges[DRAM_RANGES];
....@@ -366,7 +379,7 @@
366379 u32 dct_sel_hi; /* DRAM Controller Select High */
367380 u32 online_spare; /* On-Line spare Reg */
368381
369
- /* x4 or x8 syndromes in use */
382
+ /* x4, x8, or x16 syndromes in use */
370383 u8 ecc_sym_sz;
371384
372385 /* place to store error injection parameters prior to issue */
....@@ -399,8 +412,8 @@
399412
400413 static inline u32 get_umc_base(u8 channel)
401414 {
402
- /* ch0: 0x50000, ch1: 0x150000 */
403
- return 0x50000 + (!!channel << 20);
415
+ /* chY: 0xY50000 */
416
+ return 0x50000 + (channel << 20);
404417 }
405418
406419 static inline u64 get_dram_base(struct amd64_pvt *pvt, u8 i)
....@@ -472,6 +485,8 @@
472485 struct amd64_family_type {
473486 const char *ctl_name;
474487 u16 f0_id, f1_id, f2_id, f6_id;
488
+ /* Maximum number of memory controllers per die/node. */
489
+ u8 max_mcs;
475490 struct low_ops ops;
476491 };
477492