@@ -86,15 +86,38 @@ static int retry_rd_err_log;
86
86
static int decoding_via_mca ;
87
87
static bool mem_cfg_2lm ;
88
88
89
- static u32 offsets_scrub_icx [] = {0x22c60 , 0x22c54 , 0x22c5c , 0x22c58 , 0x22c28 , 0x20ed8 };
90
- static u32 offsets_scrub_spr [] = {0x22c60 , 0x22c54 , 0x22f08 , 0x22c58 , 0x22c28 , 0x20ed8 };
91
- static u32 offsets_scrub_spr_hbm0 [] = {0x2860 , 0x2854 , 0x2b08 , 0x2858 , 0x2828 , 0x0ed8 };
92
- static u32 offsets_scrub_spr_hbm1 [] = {0x2c60 , 0x2c54 , 0x2f08 , 0x2c58 , 0x2c28 , 0x0fa8 };
93
- static u32 offsets_demand_icx [] = {0x22e54 , 0x22e60 , 0x22e64 , 0x22e58 , 0x22e5c , 0x20ee0 };
94
- static u32 offsets_demand_spr [] = {0x22e54 , 0x22e60 , 0x22f10 , 0x22e58 , 0x22e5c , 0x20ee0 };
95
- static u32 offsets_demand2_spr [] = {0x22c70 , 0x22d80 , 0x22f18 , 0x22d58 , 0x22c64 , 0x20f10 };
96
- static u32 offsets_demand_spr_hbm0 [] = {0x2a54 , 0x2a60 , 0x2b10 , 0x2a58 , 0x2a5c , 0x0ee0 };
97
- static u32 offsets_demand_spr_hbm1 [] = {0x2e54 , 0x2e60 , 0x2f10 , 0x2e58 , 0x2e5c , 0x0fb0 };
89
+ static struct reg_rrl icx_reg_rrl_ddr = {
90
+ .set_num = 2 ,
91
+ .offsets = {
92
+ {0x22c60 , 0x22c54 , 0x22c5c , 0x22c58 , 0x22c28 , 0x20ed8 },
93
+ {0x22e54 , 0x22e60 , 0x22e64 , 0x22e58 , 0x22e5c , 0x20ee0 },
94
+ },
95
+ };
96
+
97
+ static struct reg_rrl spr_reg_rrl_ddr = {
98
+ .set_num = 3 ,
99
+ .offsets = {
100
+ {0x22c60 , 0x22c54 , 0x22f08 , 0x22c58 , 0x22c28 , 0x20ed8 },
101
+ {0x22e54 , 0x22e60 , 0x22f10 , 0x22e58 , 0x22e5c , 0x20ee0 },
102
+ {0x22c70 , 0x22d80 , 0x22f18 , 0x22d58 , 0x22c64 , 0x20f10 },
103
+ },
104
+ };
105
+
106
+ static struct reg_rrl spr_reg_rrl_hbm_pch0 = {
107
+ .set_num = 2 ,
108
+ .offsets = {
109
+ {0x2860 , 0x2854 , 0x2b08 , 0x2858 , 0x2828 , 0x0ed8 },
110
+ {0x2a54 , 0x2a60 , 0x2b10 , 0x2a58 , 0x2a5c , 0x0ee0 },
111
+ },
112
+ };
113
+
114
+ static struct reg_rrl spr_reg_rrl_hbm_pch1 = {
115
+ .set_num = 2 ,
116
+ .offsets = {
117
+ {0x2c60 , 0x2c54 , 0x2f08 , 0x2c58 , 0x2c28 , 0x0fa8 },
118
+ {0x2e54 , 0x2e60 , 0x2f10 , 0x2e58 , 0x2e5c , 0x0fb0 },
119
+ },
120
+ };
98
121
99
122
static void __enable_retry_rd_err_log (struct skx_imc * imc , int chan , bool enable , u32 * rrl_ctl ,
100
123
u32 * offsets_scrub , u32 * offsets_demand ,
@@ -185,9 +208,11 @@ static void enable_retry_rd_err_log(bool enable)
185
208
chan = d -> imc [i ].chan ;
186
209
for (j = 0 ; j < chan_num ; j ++ )
187
210
__enable_retry_rd_err_log (imc , j , enable , chan [j ].rrl_ctl [0 ],
188
- res_cfg -> offsets_scrub ,
189
- res_cfg -> offsets_demand ,
190
- res_cfg -> offsets_demand2 );
211
+ res_cfg -> reg_rrl_ddr -> offsets [0 ],
212
+ res_cfg -> reg_rrl_ddr -> offsets [1 ],
213
+ res_cfg -> reg_rrl_ddr -> set_num > 2 ?
214
+ res_cfg -> reg_rrl_ddr -> offsets [2 ] : NULL );
215
+
191
216
}
192
217
193
218
imc_num += res_cfg -> hbm_imc_num ;
@@ -201,12 +226,12 @@ static void enable_retry_rd_err_log(bool enable)
201
226
chan = d -> imc [i ].chan ;
202
227
for (j = 0 ; j < chan_num ; j ++ ) {
203
228
__enable_retry_rd_err_log (imc , j , enable , chan [j ].rrl_ctl [0 ],
204
- res_cfg -> offsets_scrub_hbm0 ,
205
- res_cfg -> offsets_demand_hbm0 ,
229
+ res_cfg -> reg_rrl_hbm [ 0 ] -> offsets [ 0 ] ,
230
+ res_cfg -> reg_rrl_hbm [ 0 ] -> offsets [ 1 ] ,
206
231
NULL );
207
232
__enable_retry_rd_err_log (imc , j , enable , chan [j ].rrl_ctl [1 ],
208
- res_cfg -> offsets_scrub_hbm1 ,
209
- res_cfg -> offsets_demand_hbm1 ,
233
+ res_cfg -> reg_rrl_hbm [ 1 ] -> offsets [ 0 ] ,
234
+ res_cfg -> reg_rrl_hbm [ 1 ] -> offsets [ 1 ] ,
210
235
NULL );
211
236
}
212
237
}
@@ -233,17 +258,18 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
233
258
pch = res -> cs & 1 ;
234
259
235
260
if (pch )
236
- offsets = scrub_err ? res_cfg -> offsets_scrub_hbm1 :
237
- res_cfg -> offsets_demand_hbm1 ;
261
+ offsets = scrub_err ? res_cfg -> reg_rrl_hbm [ 1 ] -> offsets [ 0 ] :
262
+ res_cfg -> reg_rrl_hbm [ 1 ] -> offsets [ 1 ] ;
238
263
else
239
- offsets = scrub_err ? res_cfg -> offsets_scrub_hbm0 :
240
- res_cfg -> offsets_demand_hbm0 ;
264
+ offsets = scrub_err ? res_cfg -> reg_rrl_hbm [ 0 ] -> offsets [ 0 ] :
265
+ res_cfg -> reg_rrl_hbm [ 0 ] -> offsets [ 1 ] ;
241
266
} else {
242
267
if (scrub_err ) {
243
- offsets = res_cfg -> offsets_scrub ;
268
+ offsets = res_cfg -> reg_rrl_ddr -> offsets [ 0 ] ;
244
269
} else {
245
- offsets = res_cfg -> offsets_demand ;
246
- xffsets = res_cfg -> offsets_demand2 ;
270
+ offsets = res_cfg -> reg_rrl_ddr -> offsets [1 ];
271
+ if (res_cfg -> reg_rrl_ddr -> set_num > 2 )
272
+ xffsets = res_cfg -> reg_rrl_ddr -> offsets [2 ];
247
273
}
248
274
}
249
275
@@ -883,8 +909,7 @@ static struct res_config i10nm_cfg0 = {
883
909
.ddr_mdev_bdf = {0 , 12 , 0 },
884
910
.hbm_mdev_bdf = {0 , 12 , 1 },
885
911
.sad_all_offset = 0x108 ,
886
- .offsets_scrub = offsets_scrub_icx ,
887
- .offsets_demand = offsets_demand_icx ,
912
+ .reg_rrl_ddr = & icx_reg_rrl_ddr ,
888
913
};
889
914
890
915
static struct res_config i10nm_cfg1 = {
@@ -902,8 +927,7 @@ static struct res_config i10nm_cfg1 = {
902
927
.ddr_mdev_bdf = {0 , 12 , 0 },
903
928
.hbm_mdev_bdf = {0 , 12 , 1 },
904
929
.sad_all_offset = 0x108 ,
905
- .offsets_scrub = offsets_scrub_icx ,
906
- .offsets_demand = offsets_demand_icx ,
930
+ .reg_rrl_ddr = & icx_reg_rrl_ddr ,
907
931
};
908
932
909
933
static struct res_config spr_cfg = {
@@ -926,13 +950,9 @@ static struct res_config spr_cfg = {
926
950
.ddr_mdev_bdf = {0 , 12 , 0 },
927
951
.hbm_mdev_bdf = {0 , 12 , 1 },
928
952
.sad_all_offset = 0x300 ,
929
- .offsets_scrub = offsets_scrub_spr ,
930
- .offsets_scrub_hbm0 = offsets_scrub_spr_hbm0 ,
931
- .offsets_scrub_hbm1 = offsets_scrub_spr_hbm1 ,
932
- .offsets_demand = offsets_demand_spr ,
933
- .offsets_demand2 = offsets_demand2_spr ,
934
- .offsets_demand_hbm0 = offsets_demand_spr_hbm0 ,
935
- .offsets_demand_hbm1 = offsets_demand_spr_hbm1 ,
953
+ .reg_rrl_ddr = & spr_reg_rrl_ddr ,
954
+ .reg_rrl_hbm [0 ] = & spr_reg_rrl_hbm_pch0 ,
955
+ .reg_rrl_hbm [1 ] = & spr_reg_rrl_hbm_pch1 ,
936
956
};
937
957
938
958
static struct res_config gnr_cfg = {
@@ -1121,7 +1141,7 @@ static int __init i10nm_init(void)
1121
1141
mce_register_decode_chain (& i10nm_mce_dec );
1122
1142
skx_setup_debug ("i10nm_test" );
1123
1143
1124
- if (retry_rd_err_log && res_cfg -> offsets_scrub && res_cfg -> offsets_demand ) {
1144
+ if (retry_rd_err_log && res_cfg -> reg_rrl_ddr ) {
1125
1145
skx_set_decode (i10nm_mc_decode , show_retry_rd_err_log );
1126
1146
if (retry_rd_err_log == 2 )
1127
1147
enable_retry_rd_err_log (true);
@@ -1141,7 +1161,7 @@ static void __exit i10nm_exit(void)
1141
1161
{
1142
1162
edac_dbg (2 , "\n" );
1143
1163
1144
- if (retry_rd_err_log && res_cfg -> offsets_scrub && res_cfg -> offsets_demand ) {
1164
+ if (retry_rd_err_log && res_cfg -> reg_rrl_ddr ) {
1145
1165
skx_set_decode (NULL , NULL );
1146
1166
if (retry_rd_err_log == 2 )
1147
1167
enable_retry_rd_err_log (false);
0 commit comments