coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
update_microcode.c File Reference
#include <stdint.h>
#include <arch/cpu.h>
#include <cpu/amd/microcode.h>
#include <commonlib/helpers.h>
#include <console/console.h>
#include <cpu/x86/msr.h>
#include <cpu/amd/msr.h>
#include <cbfs.h>
Include dependency graph for update_microcode.c:

Go to the source code of this file.

Data Structures

struct  microcode
 

Macros

#define F16H_MPB_MAX_SIZE   3458
 
#define F16H_MPB_DATA_OFFSET   32
 

Functions

static void apply_microcode_patch (const struct microcode *m)
 
static uint16_t get_equivalent_processor_rev_id (void)
 
static void amd_update_microcode (const void *ucode, size_t ucode_len, uint16_t equivalent_processor_rev_id)
 
void amd_update_microcode_from_cbfs (void)
 

Variables

struct microcode __packed
 

Macro Definition Documentation

◆ F16H_MPB_DATA_OFFSET

#define F16H_MPB_DATA_OFFSET   32

Definition at line 19 of file update_microcode.c.

◆ F16H_MPB_MAX_SIZE

#define F16H_MPB_MAX_SIZE   3458

Definition at line 18 of file update_microcode.c.

Function Documentation

◆ amd_update_microcode()

static void amd_update_microcode ( const void ucode,
size_t  ucode_len,
uint16_t  equivalent_processor_rev_id 
)
static

Definition at line 100 of file update_microcode.c.

References apply_microcode_patch(), c, and m.

Referenced by amd_update_microcode_from_cbfs().

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

◆ amd_update_microcode_from_cbfs()

void amd_update_microcode_from_cbfs ( void  )

Definition at line 113 of file update_microcode.c.

References amd_update_microcode(), BIOS_DEBUG, BIOS_WARNING, cbfs_map(), F16H_MPB_DATA_OFFSET, F16H_MPB_MAX_SIZE, get_equivalent_processor_rev_id(), and printk.

Here is the call graph for this function:

◆ apply_microcode_patch()

static void apply_microcode_patch ( const struct microcode m)
static

Definition at line 69 of file update_microcode.c.

References BIOS_DEBUG, BIOS_ERR, BIOS_INFO, msr_struct::hi, IA32_BIOS_SIGN_ID, msr_struct::lo, m, MSR_PATCH_LOADER, printk, rdmsr(), and wrmsr().

Referenced by amd_update_microcode().

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

◆ get_equivalent_processor_rev_id()

static uint16_t get_equivalent_processor_rev_id ( void  )
static

Definition at line 93 of file update_microcode.c.

References cpuid_eax().

Referenced by amd_update_microcode_from_cbfs().

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

Variable Documentation

◆ __packed