File tree Expand file tree Collapse file tree 2 files changed +0
-55
lines changed Expand file tree Collapse file tree 2 files changed +0
-55
lines changed Original file line number Diff line number Diff line change 28
28
#define APBT_DEV_USED 1
29
29
30
30
extern void apbt_time_init (void );
31
- extern unsigned long apbt_quick_calibrate (void );
32
31
extern int arch_setup_apbt_irqs (int irq , int trigger , int mask , int cpu );
33
32
extern void apbt_setup_secondary_clock (void );
34
33
@@ -38,7 +37,6 @@ extern int sfi_mtimer_num;
38
37
39
38
#else /* CONFIG_APB_TIMER */
40
39
41
- static inline unsigned long apbt_quick_calibrate (void ) {return 0 ; }
42
40
static inline void apbt_time_init (void ) { }
43
41
44
42
#endif
Original file line number Diff line number Diff line change @@ -345,56 +345,3 @@ void __init apbt_time_init(void)
345
345
apb_timer_block_enabled = 0 ;
346
346
panic ("failed to enable APB timer\n" );
347
347
}
348
-
349
- /* called before apb_timer_enable, use early map */
350
- unsigned long apbt_quick_calibrate (void )
351
- {
352
- int i , scale ;
353
- u64 old , new ;
354
- u64 t1 , t2 ;
355
- unsigned long khz = 0 ;
356
- u32 loop , shift ;
357
-
358
- apbt_set_mapping ();
359
- dw_apb_clocksource_start (clocksource_apbt );
360
-
361
- /* check if the timer can count down, otherwise return */
362
- old = dw_apb_clocksource_read (clocksource_apbt );
363
- i = 10000 ;
364
- while (-- i ) {
365
- if (old != dw_apb_clocksource_read (clocksource_apbt ))
366
- break ;
367
- }
368
- if (!i )
369
- goto failed ;
370
-
371
- /* count 16 ms */
372
- loop = (apbt_freq / 1000 ) << 4 ;
373
-
374
- /* restart the timer to ensure it won't get to 0 in the calibration */
375
- dw_apb_clocksource_start (clocksource_apbt );
376
-
377
- old = dw_apb_clocksource_read (clocksource_apbt );
378
- old += loop ;
379
-
380
- t1 = rdtsc ();
381
-
382
- do {
383
- new = dw_apb_clocksource_read (clocksource_apbt );
384
- } while (new < old );
385
-
386
- t2 = rdtsc ();
387
-
388
- shift = 5 ;
389
- if (unlikely (loop >> shift == 0 )) {
390
- printk (KERN_INFO
391
- "APBT TSC calibration failed, not enough resolution\n" );
392
- return 0 ;
393
- }
394
- scale = (int )div_u64 ((t2 - t1 ), loop >> shift );
395
- khz = (scale * (apbt_freq / 1000 )) >> shift ;
396
- printk (KERN_INFO "TSC freq calculated by APB timer is %lu khz\n" , khz );
397
- return khz ;
398
- failed :
399
- return 0 ;
400
- }
You can’t perform that action at this time.
0 commit comments