@@ -81,26 +81,38 @@ static u32 offsets_scrub_spr_hbm0[] = {0x2860, 0x2854, 0x2b08, 0x2858, 0x2828,
8181static u32 offsets_scrub_spr_hbm1 [] = {0x2c60 , 0x2c54 , 0x2f08 , 0x2c58 , 0x2c28 , 0x0fa8 };
8282static u32 offsets_demand_icx [] = {0x22e54 , 0x22e60 , 0x22e64 , 0x22e58 , 0x22e5c , 0x20ee0 };
8383static u32 offsets_demand_spr [] = {0x22e54 , 0x22e60 , 0x22f10 , 0x22e58 , 0x22e5c , 0x20ee0 };
84+ static u32 offsets_demand2_spr [] = {0x22c70 , 0x22d80 , 0x22f18 , 0x22d58 , 0x22c64 , 0x20f10 };
8485static u32 offsets_demand_spr_hbm0 [] = {0x2a54 , 0x2a60 , 0x2b10 , 0x2a58 , 0x2a5c , 0x0ee0 };
8586static u32 offsets_demand_spr_hbm1 [] = {0x2e54 , 0x2e60 , 0x2f10 , 0x2e58 , 0x2e5c , 0x0fb0 };
8687
8788static void __enable_retry_rd_err_log (struct skx_imc * imc , int chan , bool enable ,
88- u32 * offsets_scrub , u32 * offsets_demand )
89+ u32 * offsets_scrub , u32 * offsets_demand ,
90+ u32 * offsets_demand2 )
8991{
90- u32 s , d ;
92+ u32 s , d , d2 ;
9193
9294 s = I10NM_GET_REG32 (imc , chan , offsets_scrub [0 ]);
9395 d = I10NM_GET_REG32 (imc , chan , offsets_demand [0 ]);
96+ if (offsets_demand2 )
97+ d2 = I10NM_GET_REG32 (imc , chan , offsets_demand2 [0 ]);
9498
9599 if (enable ) {
96100 /* Save default configurations */
97101 imc -> chan [chan ].retry_rd_err_log_s = s ;
98102 imc -> chan [chan ].retry_rd_err_log_d = d ;
103+ if (offsets_demand2 )
104+ imc -> chan [chan ].retry_rd_err_log_d2 = d2 ;
99105
100106 s &= ~RETRY_RD_ERR_LOG_NOOVER_UC ;
101107 s |= RETRY_RD_ERR_LOG_EN ;
102108 d &= ~RETRY_RD_ERR_LOG_NOOVER_UC ;
103109 d |= RETRY_RD_ERR_LOG_EN ;
110+
111+ if (offsets_demand2 ) {
112+ d2 &= ~RETRY_RD_ERR_LOG_UC ;
113+ d2 |= RETRY_RD_ERR_LOG_NOOVER ;
114+ d2 |= RETRY_RD_ERR_LOG_EN ;
115+ }
104116 } else {
105117 /* Restore default configurations */
106118 if (imc -> chan [chan ].retry_rd_err_log_s & RETRY_RD_ERR_LOG_UC )
@@ -115,10 +127,21 @@ static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enable
115127 d |= RETRY_RD_ERR_LOG_NOOVER ;
116128 if (!(imc -> chan [chan ].retry_rd_err_log_d & RETRY_RD_ERR_LOG_EN ))
117129 d &= ~RETRY_RD_ERR_LOG_EN ;
130+
131+ if (offsets_demand2 ) {
132+ if (imc -> chan [chan ].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_UC )
133+ d2 |= RETRY_RD_ERR_LOG_UC ;
134+ if (!(imc -> chan [chan ].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_NOOVER ))
135+ d2 &= ~RETRY_RD_ERR_LOG_NOOVER ;
136+ if (!(imc -> chan [chan ].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_EN ))
137+ d2 &= ~RETRY_RD_ERR_LOG_EN ;
138+ }
118139 }
119140
120141 I10NM_SET_REG32 (imc , chan , offsets_scrub [0 ], s );
121142 I10NM_SET_REG32 (imc , chan , offsets_demand [0 ], d );
143+ if (offsets_demand2 )
144+ I10NM_SET_REG32 (imc , chan , offsets_demand2 [0 ], d2 );
122145}
123146
124147static void enable_retry_rd_err_log (bool enable )
@@ -139,14 +162,17 @@ static void enable_retry_rd_err_log(bool enable)
139162 if (imc -> hbm_mc ) {
140163 __enable_retry_rd_err_log (imc , j , enable ,
141164 res_cfg -> offsets_scrub_hbm0 ,
142- res_cfg -> offsets_demand_hbm0 );
165+ res_cfg -> offsets_demand_hbm0 ,
166+ NULL );
143167 __enable_retry_rd_err_log (imc , j , enable ,
144168 res_cfg -> offsets_scrub_hbm1 ,
145- res_cfg -> offsets_demand_hbm1 );
169+ res_cfg -> offsets_demand_hbm1 ,
170+ NULL );
146171 } else {
147172 __enable_retry_rd_err_log (imc , j , enable ,
148173 res_cfg -> offsets_scrub ,
149- res_cfg -> offsets_demand );
174+ res_cfg -> offsets_demand ,
175+ res_cfg -> offsets_demand2 );
150176 }
151177 }
152178 }
@@ -158,7 +184,10 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
158184 struct skx_imc * imc = & res -> dev -> imc [res -> imc ];
159185 u32 log0 , log1 , log2 , log3 , log4 ;
160186 u32 corr0 , corr1 , corr2 , corr3 ;
187+ u32 lxg0 , lxg1 , lxg3 , lxg4 ;
188+ u32 * xffsets = NULL ;
161189 u64 log2a , log5 ;
190+ u64 lxg2a , lxg5 ;
162191 u32 * offsets ;
163192 int n , pch ;
164193
@@ -175,8 +204,12 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
175204 offsets = scrub_err ? res_cfg -> offsets_scrub_hbm0 :
176205 res_cfg -> offsets_demand_hbm0 ;
177206 } else {
178- offsets = scrub_err ? res_cfg -> offsets_scrub :
179- res_cfg -> offsets_demand ;
207+ if (scrub_err ) {
208+ offsets = res_cfg -> offsets_scrub ;
209+ } else {
210+ offsets = res_cfg -> offsets_demand ;
211+ xffsets = res_cfg -> offsets_demand2 ;
212+ }
180213 }
181214
182215 log0 = I10NM_GET_REG32 (imc , res -> channel , offsets [0 ]);
@@ -185,10 +218,28 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
185218 log4 = I10NM_GET_REG32 (imc , res -> channel , offsets [4 ]);
186219 log5 = I10NM_GET_REG64 (imc , res -> channel , offsets [5 ]);
187220
221+ if (xffsets ) {
222+ lxg0 = I10NM_GET_REG32 (imc , res -> channel , xffsets [0 ]);
223+ lxg1 = I10NM_GET_REG32 (imc , res -> channel , xffsets [1 ]);
224+ lxg3 = I10NM_GET_REG32 (imc , res -> channel , xffsets [3 ]);
225+ lxg4 = I10NM_GET_REG32 (imc , res -> channel , xffsets [4 ]);
226+ lxg5 = I10NM_GET_REG64 (imc , res -> channel , xffsets [5 ]);
227+ }
228+
188229 if (res_cfg -> type == SPR ) {
189230 log2a = I10NM_GET_REG64 (imc , res -> channel , offsets [2 ]);
190- n = snprintf (msg , len , " retry_rd_err_log[%.8x %.8x %.16llx %.8x %.8x %.16llx] " ,
231+ n = snprintf (msg , len , " retry_rd_err_log[%.8x %.8x %.16llx %.8x %.8x %.16llx" ,
191232 log0 , log1 , log2a , log3 , log4 , log5 );
233+
234+ if (len - n > 0 ) {
235+ if (xffsets ) {
236+ lxg2a = I10NM_GET_REG64 (imc , res -> channel , xffsets [2 ]);
237+ n += snprintf (msg + n , len - n , " %.8x %.8x %.16llx %.8x %.8x %.16llx]" ,
238+ lxg0 , lxg1 , lxg2a , lxg3 , lxg4 , lxg5 );
239+ } else {
240+ n += snprintf (msg + n , len - n , "]" );
241+ }
242+ }
192243 } else {
193244 log2 = I10NM_GET_REG32 (imc , res -> channel , offsets [2 ]);
194245 n = snprintf (msg , len , " retry_rd_err_log[%.8x %.8x %.8x %.8x %.8x %.16llx]" ,
@@ -223,9 +274,16 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
223274 corr3 & 0xffff , corr3 >> 16 );
224275
225276 /* Clear status bits */
226- if (retry_rd_err_log == 2 && (log0 & RETRY_RD_ERR_LOG_OVER_UC_V )) {
227- log0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V ;
228- I10NM_SET_REG32 (imc , res -> channel , offsets [0 ], log0 );
277+ if (retry_rd_err_log == 2 ) {
278+ if (log0 & RETRY_RD_ERR_LOG_OVER_UC_V ) {
279+ log0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V ;
280+ I10NM_SET_REG32 (imc , res -> channel , offsets [0 ], log0 );
281+ }
282+
283+ if (xffsets && (lxg0 & RETRY_RD_ERR_LOG_OVER_UC_V )) {
284+ lxg0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V ;
285+ I10NM_SET_REG32 (imc , res -> channel , xffsets [0 ], lxg0 );
286+ }
229287 }
230288}
231289
@@ -460,6 +518,7 @@ static struct res_config spr_cfg = {
460518 .offsets_scrub_hbm0 = offsets_scrub_spr_hbm0 ,
461519 .offsets_scrub_hbm1 = offsets_scrub_spr_hbm1 ,
462520 .offsets_demand = offsets_demand_spr ,
521+ .offsets_demand2 = offsets_demand2_spr ,
463522 .offsets_demand_hbm0 = offsets_demand_spr_hbm0 ,
464523 .offsets_demand_hbm1 = offsets_demand_spr_hbm1 ,
465524};
0 commit comments