@@ -217,6 +217,11 @@ static u32 notrace fsl_a008585_read_cntv_tval_el0(void)
217
217
return __fsl_a008585_read_reg (cntv_tval_el0 );
218
218
}
219
219
220
+ static u64 notrace fsl_a008585_read_cntpct_el0 (void )
221
+ {
222
+ return __fsl_a008585_read_reg (cntpct_el0 );
223
+ }
224
+
220
225
static u64 notrace fsl_a008585_read_cntvct_el0 (void )
221
226
{
222
227
return __fsl_a008585_read_reg (cntvct_el0 );
@@ -258,6 +263,11 @@ static u32 notrace hisi_161010101_read_cntv_tval_el0(void)
258
263
return __hisi_161010101_read_reg (cntv_tval_el0 );
259
264
}
260
265
266
+ static u64 notrace hisi_161010101_read_cntpct_el0 (void )
267
+ {
268
+ return __hisi_161010101_read_reg (cntpct_el0 );
269
+ }
270
+
261
271
static u64 notrace hisi_161010101_read_cntvct_el0 (void )
262
272
{
263
273
return __hisi_161010101_read_reg (cntvct_el0 );
@@ -288,6 +298,15 @@ static struct ate_acpi_oem_info hisi_161010101_oem_info[] = {
288
298
#endif
289
299
290
300
#ifdef CONFIG_ARM64_ERRATUM_858921
301
+ static u64 notrace arm64_858921_read_cntpct_el0 (void )
302
+ {
303
+ u64 old , new ;
304
+
305
+ old = read_sysreg (cntpct_el0 );
306
+ new = read_sysreg (cntpct_el0 );
307
+ return (((old ^ new ) >> 32 ) & 1 ) ? old : new ;
308
+ }
309
+
291
310
static u64 notrace arm64_858921_read_cntvct_el0 (void )
292
311
{
293
312
u64 old , new ;
@@ -346,6 +365,7 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
346
365
.desc = "Freescale erratum a005858" ,
347
366
.read_cntp_tval_el0 = fsl_a008585_read_cntp_tval_el0 ,
348
367
.read_cntv_tval_el0 = fsl_a008585_read_cntv_tval_el0 ,
368
+ .read_cntpct_el0 = fsl_a008585_read_cntpct_el0 ,
349
369
.read_cntvct_el0 = fsl_a008585_read_cntvct_el0 ,
350
370
.set_next_event_phys = erratum_set_next_event_tval_phys ,
351
371
.set_next_event_virt = erratum_set_next_event_tval_virt ,
@@ -358,6 +378,7 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
358
378
.desc = "HiSilicon erratum 161010101" ,
359
379
.read_cntp_tval_el0 = hisi_161010101_read_cntp_tval_el0 ,
360
380
.read_cntv_tval_el0 = hisi_161010101_read_cntv_tval_el0 ,
381
+ .read_cntpct_el0 = hisi_161010101_read_cntpct_el0 ,
361
382
.read_cntvct_el0 = hisi_161010101_read_cntvct_el0 ,
362
383
.set_next_event_phys = erratum_set_next_event_tval_phys ,
363
384
.set_next_event_virt = erratum_set_next_event_tval_virt ,
@@ -368,6 +389,7 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
368
389
.desc = "HiSilicon erratum 161010101" ,
369
390
.read_cntp_tval_el0 = hisi_161010101_read_cntp_tval_el0 ,
370
391
.read_cntv_tval_el0 = hisi_161010101_read_cntv_tval_el0 ,
392
+ .read_cntpct_el0 = hisi_161010101_read_cntpct_el0 ,
371
393
.read_cntvct_el0 = hisi_161010101_read_cntvct_el0 ,
372
394
.set_next_event_phys = erratum_set_next_event_tval_phys ,
373
395
.set_next_event_virt = erratum_set_next_event_tval_virt ,
@@ -378,6 +400,7 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
378
400
.match_type = ate_match_local_cap_id ,
379
401
.id = (void * )ARM64_WORKAROUND_858921 ,
380
402
.desc = "ARM erratum 858921" ,
403
+ .read_cntpct_el0 = arm64_858921_read_cntpct_el0 ,
381
404
.read_cntvct_el0 = arm64_858921_read_cntvct_el0 ,
382
405
},
383
406
#endif
0 commit comments