coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i8254.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TIMER0_PORT   0x40
 
#define TIMER1_PORT   0x41
 
#define TIMER2_PORT   0x42
 
#define TIMER_MODE_PORT   0x43
 
#define TIMER0_SEL   0x00
 
#define TIMER1_SEL   0x40
 
#define TIMER2_SEL   0x80
 
#define READBACK_SEL   0xC0
 
#define LATCH_COUNT   0x00
 
#define LOBYTE_ACCESS   0x10
 
#define HIBYTE_ACCESS   0x20
 
#define WORD_ACCESS   0x30
 
#define MODE0   0x00
 
#define MODE1   0x02
 
#define MODE2   0x04
 
#define MODE3   0x06
 
#define MODE4   0x08
 
#define MODE5   0x0A
 
#define BINARY_COUNT   0x00
 
#define BCD_COUNT   0x01
 
#define TICKS_PER_MS   1193
 
#define PPC_PORTB   0x61
 
#define PPCB_T2OUT   0x20 /* Bit 5 */
 
#define PPCB_SPKR   0x02 /* Bit 1 */
 
#define PPCB_T2GATE   0x01 /* Bit 0 */
 

Functions

void setup_i8254 (void)
 
unsigned long calibrate_tsc_with_pit (void)
 

Macro Definition Documentation

◆ BCD_COUNT

#define BCD_COUNT   0x01

Definition at line 31 of file i8254.h.

◆ BINARY_COUNT

#define BINARY_COUNT   0x00

Definition at line 30 of file i8254.h.

◆ HIBYTE_ACCESS

#define HIBYTE_ACCESS   0x20

Definition at line 20 of file i8254.h.

◆ LATCH_COUNT

#define LATCH_COUNT   0x00

Definition at line 18 of file i8254.h.

◆ LOBYTE_ACCESS

#define LOBYTE_ACCESS   0x10

Definition at line 19 of file i8254.h.

◆ MODE0

#define MODE0   0x00

Definition at line 23 of file i8254.h.

◆ MODE1

#define MODE1   0x02

Definition at line 24 of file i8254.h.

◆ MODE2

#define MODE2   0x04

Definition at line 25 of file i8254.h.

◆ MODE3

#define MODE3   0x06

Definition at line 26 of file i8254.h.

◆ MODE4

#define MODE4   0x08

Definition at line 27 of file i8254.h.

◆ MODE5

#define MODE5   0x0A

Definition at line 28 of file i8254.h.

◆ PPC_PORTB

#define PPC_PORTB   0x61

Definition at line 37 of file i8254.h.

◆ PPCB_SPKR

#define PPCB_SPKR   0x02 /* Bit 1 */

Definition at line 41 of file i8254.h.

◆ PPCB_T2GATE

#define PPCB_T2GATE   0x01 /* Bit 0 */

Definition at line 42 of file i8254.h.

◆ PPCB_T2OUT

#define PPCB_T2OUT   0x20 /* Bit 5 */

Definition at line 40 of file i8254.h.

◆ READBACK_SEL

#define READBACK_SEL   0xC0

Definition at line 16 of file i8254.h.

◆ TICKS_PER_MS

#define TICKS_PER_MS   1193

Definition at line 34 of file i8254.h.

◆ TIMER0_PORT

#define TIMER0_PORT   0x40

Definition at line 7 of file i8254.h.

◆ TIMER0_SEL

#define TIMER0_SEL   0x00

Definition at line 13 of file i8254.h.

◆ TIMER1_PORT

#define TIMER1_PORT   0x41

Definition at line 8 of file i8254.h.

◆ TIMER1_SEL

#define TIMER1_SEL   0x40

Definition at line 14 of file i8254.h.

◆ TIMER2_PORT

#define TIMER2_PORT   0x42

Definition at line 9 of file i8254.h.

◆ TIMER2_SEL

#define TIMER2_SEL   0x80

Definition at line 15 of file i8254.h.

◆ TIMER_MODE_PORT

#define TIMER_MODE_PORT   0x43

Definition at line 10 of file i8254.h.

◆ WORD_ACCESS

#define WORD_ACCESS   0x30

Definition at line 21 of file i8254.h.

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: