coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mp_init.c File Reference
#include <assert.h>
#include <bootstate.h>
#include <console/console.h>
#include <cpu/cpu.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mp.h>
#include <cpu/intel/microcode.h>
#include <intelblocks/cfg.h>
#include <intelblocks/cpulib.h>
#include <intelblocks/fast_spi.h>
#include <intelblocks/mp_init.h>
#include <intelblocks/msr.h>
#include <soc/cpu.h>
Include dependency graph for mp_init.c:

Go to the source code of this file.

Functions

static void init_one_cpu (struct device *dev)
 
int get_cpu_count (void)
 
void get_microcode_info (const void **microcode, int *parallel)
 
void init_cpus (void)
 
static void coreboot_init_cpus (void *unused)
 
static void post_cpus_add_romcache (void)
 
static void wrapper_x86_setup_mtrrs (void *unused)
 
static void post_cpus_init (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_DEV_INIT_CHIPS, BS_ON_ENTRY, coreboot_init_cpus, NULL)
 
 BOOT_STATE_INIT_ENTRY (BS_WRITE_TABLES, BS_ON_EXIT, post_cpus_init, NULL)
 
 BOOT_STATE_INIT_ENTRY (BS_OS_RESUME, BS_ON_ENTRY, post_cpus_init, NULL)
 

Variables

static struct device_operations cpu_dev_ops
 
static const struct cpu_device_id cpu_table []
 
static const struct cpu_driver driver __cpu_driver
 

Function Documentation

◆ BOOT_STATE_INIT_ENTRY() [1/3]

BOOT_STATE_INIT_ENTRY ( BS_DEV_INIT_CHIPS  ,
BS_ON_ENTRY  ,
coreboot_init_cpus  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [2/3]

BOOT_STATE_INIT_ENTRY ( BS_OS_RESUME  ,
BS_ON_ENTRY  ,
post_cpus_init  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [3/3]

BOOT_STATE_INIT_ENTRY ( BS_WRITE_TABLES  ,
BS_ON_EXIT  ,
post_cpus_init  ,
NULL   
)

◆ coreboot_init_cpus()

static void coreboot_init_cpus ( void unused)
static

Definition at line 145 of file mp_init.c.

References CONFIG, init_cpus(), intel_microcode_find(), intel_microcode_load_unlocked(), and microcode_patch.

Here is the call graph for this function:

◆ get_cpu_count()

int get_cpu_count ( void  )

Definition at line 91 of file mp_init.c.

References BIOS_DEBUG, cpu_read_topology(), and printk.

Here is the call graph for this function:

◆ get_microcode_info()

void get_microcode_info ( const void **  microcode,
int *  parallel 
)

Definition at line 111 of file mp_init.c.

References intel_microcode_find().

Here is the call graph for this function:

◆ init_cpus()

void init_cpus ( void  )

Definition at line 133 of file mp_init.c.

References add_more_links(), assert, dev_find_path(), DEVICE_PATH_CPU_CLUSTER, device::link_list, NULL, and soc_init_cpus().

Referenced by coreboot_init_cpus(), and do_mpinit_after_fsp().

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

◆ init_one_cpu()

static void init_one_cpu ( struct device dev)
static

Definition at line 18 of file mp_init.c.

◆ post_cpus_add_romcache()

static void post_cpus_add_romcache ( void  )
static

Definition at line 156 of file mp_init.c.

References CONFIG, and fast_spi_cache_bios_region().

Referenced by post_cpus_init().

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

◆ post_cpus_init()

static void post_cpus_init ( void unused)
static

Definition at line 170 of file mp_init.c.

References BIOS_ERR, CB_SUCCESS, mp_run_on_all_cpus(), NULL, post_cpus_add_romcache(), printk, wrapper_x86_setup_mtrrs(), and x86_mtrr_check().

Here is the call graph for this function:

◆ wrapper_x86_setup_mtrrs()

static void wrapper_x86_setup_mtrrs ( void unused)
static

Definition at line 164 of file mp_init.c.

References x86_setup_mtrrs_with_detect().

Referenced by post_cpus_init().

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

Variable Documentation

◆ __cpu_driver

const struct cpu_driver driver __cpu_driver
static
Initial value:
= {
.ops = &cpu_dev_ops,
.id_table = cpu_table,
}
static const struct cpu_device_id cpu_table[]
Definition: mp_init.c:30
static struct device_operations cpu_dev_ops
Definition: mp_init.c:26

Definition at line 18 of file mp_init.c.

◆ cpu_dev_ops

struct device_operations cpu_dev_ops
static
Initial value:
= {
.init = init_one_cpu,
}
static void init_one_cpu(struct device *dev)
Definition: mp_init.c:18

Definition at line 18 of file mp_init.c.

◆ cpu_table

const struct cpu_device_id cpu_table[]
static

Definition at line 18 of file mp_init.c.