coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ramstage.c File Reference
#include <arch/cpu.h>
#include <acpi/acpi_gnvs.h>
#include <acpi/acpi_pm.h>
#include <bootstate.h>
#include <console/console.h>
#include <cpu/intel/microcode.h>
#include <cpu/x86/cr.h>
#include <cpu/x86/msr.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <soc/device_nvs.h>
#include <soc/gpio.h>
#include <soc/lpc.h>
#include <soc/msr.h>
#include <soc/nvs.h>
#include <soc/pattrs.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/ramstage.h>
#include <soc/iosf.h>
Include dependency graph for ramstage.c:

Go to the source code of this file.

Macros

#define SHOW_PATTRS   1
 

Functions

static void detect_num_cpus (struct pattrs *attrs)
 
static void fill_in_msr (msr_t *msr, int idx)
 
static void fill_in_pattrs (void)
 
size_t size_of_dnvs (void)
 
static void pm_fill_gnvs (struct global_nvs *gnvs, const struct chipset_power_state *ps)
 
static void acpi_save_wake_source (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_PRE_DEVICE, BS_ON_ENTRY, acpi_save_wake_source, NULL)
 
static void baytrail_enable_2x_refresh_rate (void)
 
void baytrail_init_pre_device (struct soc_intel_baytrail_config *config)
 

Variables

struct pattrs __global_pattrs
 
static const char * stepping_str []
 

Macro Definition Documentation

◆ SHOW_PATTRS

#define SHOW_PATTRS   1

Definition at line 26 of file ramstage.c.

Function Documentation

◆ acpi_save_wake_source()

static void acpi_save_wake_source ( void unused)
static

Definition at line 143 of file ramstage.c.

References acpi_pm_state_for_wake(), acpi_reset_gnvs_for_wake(), BIOS_DEBUG, gnvs, global_nvs::pm1i, pm_fill_gnvs(), and printk.

Here is the call graph for this function:

◆ baytrail_enable_2x_refresh_rate()

static void baytrail_enable_2x_refresh_rate ( void  )
static

Definition at line 161 of file ramstage.c.

References iosf_dunit_read(), and iosf_dunit_write().

Referenced by baytrail_init_pre_device().

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

◆ baytrail_init_pre_device()

void baytrail_init_pre_device ( struct soc_intel_baytrail_config config)

Definition at line 170 of file ramstage.c.

References baytrail_enable_2x_refresh_rate(), baytrail_init_scc(), baytrail_run_reference_code(), config, CR4_OSFXSR, CR4_OSXMMEXCPT, fill_in_pattrs(), gpio_config, mainboard_get_gpios(), read_cr4(), setup_soc_gpios(), and write_cr4().

Referenced by soc_init().

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

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_PRE_DEVICE  ,
BS_ON_ENTRY  ,
acpi_save_wake_source  ,
NULL   
)

◆ detect_num_cpus()

static void detect_num_cpus ( struct pattrs attrs)
static

Definition at line 30 of file ramstage.c.

References attrs, cpuid_ext(), cpuid_result::ebx, and cpuid_result::ecx.

Referenced by fill_in_pattrs().

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

◆ fill_in_msr()

static void fill_in_msr ( msr_t msr,
int  idx 
)
inlinestatic

Definition at line 49 of file ramstage.c.

References BIOS_DEBUG, msr_struct::hi, msr_struct::lo, printk, rdmsr(), and SHOW_PATTRS.

Referenced by fill_in_pattrs().

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

◆ fill_in_pattrs()

◆ pm_fill_gnvs()

static void pm_fill_gnvs ( struct global_nvs gnvs,
const struct chipset_power_state ps 
)
static

Definition at line 125 of file ramstage.c.

References gnvs, chipset_power_state::pm1_en, chipset_power_state::pm1_sts, and global_nvs::pm1i.

Referenced by acpi_save_wake_source().

Here is the caller graph for this function:

◆ size_of_dnvs()

size_t size_of_dnvs ( void  )

Definition at line 119 of file ramstage.c.

Variable Documentation

◆ __global_pattrs

struct pattrs __global_pattrs

Definition at line 1 of file ramstage.c.

◆ stepping_str

const char* stepping_str[]
static
Initial value:
= {
"A0", "A1", "B0", "B1", "B2", "B3", "C0", "D0",
}

Definition at line 58 of file ramstage.c.

Referenced by fill_in_pattrs().