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

Go to the source code of this file.

Macros

#define MSR_PLATFORM_INFO   0xce
 

Functions

static int get_fsb_tsc (int *fsb, int *ratio)
 
static void resolve_timebase (void)
 
u32 get_timer_fsb (void)
 
unsigned long tsc_freq_mhz (void)
 
int get_ia32_fsb_x3 (void)
 Returns three times the FSB clock in MHz. More...
 

Variables

static u32 timer_fsb
 
static u32 timer_tsc
 

Macro Definition Documentation

◆ MSR_PLATFORM_INFO

#define MSR_PLATFORM_INFO   0xce

Definition at line 16 of file fsb.c.

Function Documentation

◆ get_fsb_tsc()

static int get_fsb_tsc ( int *  fsb,
int *  ratio 
)
static

Definition at line 18 of file fsb.c.

References c, cpuid_eax(), get_fms(), msr_struct::hi, IA32_PERF_STATUS, msr_struct::lo, MSR_EBC_FREQUENCY_ID, MSR_FSB_FREQ, MSR_PLATFORM_INFO, and rdmsr().

Referenced by resolve_timebase().

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

◆ get_ia32_fsb_x3()

int get_ia32_fsb_x3 ( void  )

Returns three times the FSB clock in MHz.

The result of calculations with the returned value shall be divided by 3. This helps to avoid rounding errors.

Definition at line 133 of file fsb.c.

References BIOS_ERR, DIV_ROUND_CLOSEST, get_timer_fsb(), and printk.

Referenced by gen_pstate_entries().

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

◆ get_timer_fsb()

u32 get_timer_fsb ( void  )

Definition at line 109 of file fsb.c.

References resolve_timebase(), and timer_fsb.

Referenced by get_ia32_fsb_x3(), and udelay().

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

◆ resolve_timebase()

static void resolve_timebase ( void  )
static

Definition at line 87 of file fsb.c.

References BIOS_ERR, DIV_ROUND_CLOSEST, get_fsb_tsc(), printk, timer_fsb, and timer_tsc.

Referenced by get_timer_fsb(), and tsc_freq_mhz().

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

◆ tsc_freq_mhz()

unsigned long tsc_freq_mhz ( void  )

Definition at line 118 of file fsb.c.

References resolve_timebase(), and timer_tsc.

Referenced by baytrail_run_reference_code(), bootblock_c_entry(), init_timer(), lb_arch_add_records(), timestamp_get(), timestamp_tick_freq_mhz(), and udelay().

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

Variable Documentation

◆ timer_fsb

u32 timer_fsb
static

Definition at line 12 of file fsb.c.

Referenced by get_timer_fsb(), resolve_timebase(), and udelay().

◆ timer_tsc

u32 timer_tsc
static

Definition at line 13 of file fsb.c.

Referenced by resolve_timebase(), and tsc_freq_mhz().