coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i8254.c File Reference
#include <arch/io.h>
#include <commonlib/helpers.h>
#include <cpu/x86/tsc.h>
#include <pc80/i8254.h>
Include dependency graph for i8254.c:

Go to the source code of this file.

Macros

#define CLOCK_TICK_RATE   1193180U /* Underlying HZ */
 
#define CALIBRATE_INTERVAL   ((2*CLOCK_TICK_RATE)/1000) /* 2ms */
 
#define CALIBRATE_DIVISOR   (2*1000) /* 2ms / 2000 == 1usec */
 

Functions

void setup_i8254 (void)
 
unsigned long calibrate_tsc_with_pit (void)
 

Macro Definition Documentation

◆ CALIBRATE_DIVISOR

#define CALIBRATE_DIVISOR   (2*1000) /* 2ms / 2000 == 1usec */

Definition at line 34 of file i8254.c.

◆ CALIBRATE_INTERVAL

#define CALIBRATE_INTERVAL   ((2*CLOCK_TICK_RATE)/1000) /* 2ms */

Definition at line 33 of file i8254.c.

◆ CLOCK_TICK_RATE

#define CLOCK_TICK_RATE   1193180U /* Underlying HZ */

Definition at line 23 of file i8254.c.

Function Documentation

◆ calibrate_tsc_with_pit()

unsigned long calibrate_tsc_with_pit ( void  )

Definition at line 36 of file i8254.c.

References CALIBRATE_DIVISOR, CALIBRATE_INTERVAL, count, DIV_ROUND_UP, tsc_struct::hi, inb(), tsc_struct::lo, outb(), and rdtsc().

Here is the call graph for this function:

◆ setup_i8254()

void setup_i8254 ( void  )

Definition at line 10 of file i8254.c.

References BINARY_COUNT, LOBYTE_ACCESS, MODE3, outb(), TIMER0_PORT, TIMER0_SEL, TIMER1_PORT, TIMER1_SEL, TIMER_MODE_PORT, and WORD_ACCESS.

Referenced by lpc_init(), run_bios(), and sc_init().

Here is the call graph for this function:
Here is the caller graph for this function: