|
@@ -25,7 +25,18 @@ unsigned long get_tbclk(void)
|
|
unsigned long timer_read_counter(void)
|
|
unsigned long timer_read_counter(void)
|
|
{
|
|
{
|
|
unsigned long cntpct;
|
|
unsigned long cntpct;
|
|
|
|
+#ifdef CONFIG_SYS_FSL_ERRATUM_A008585
|
|
|
|
+ /* This erratum number needs to be confirmed to match ARM document */
|
|
|
|
+ unsigned long temp;
|
|
|
|
+#endif
|
|
isb();
|
|
isb();
|
|
asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
|
|
asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
|
|
|
|
+#ifdef CONFIG_SYS_FSL_ERRATUM_A008585
|
|
|
|
+ asm volatile("mrs %0, cntpct_el0" : "=r" (temp));
|
|
|
|
+ while (temp != cntpct) {
|
|
|
|
+ asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
|
|
|
|
+ asm volatile("mrs %0, cntpct_el0" : "=r" (temp));
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
return cntpct;
|
|
return cntpct;
|
|
}
|
|
}
|