13 #define CPU_MICROCODE_BLOB_NAME "cpu_microcode_blob.bin"
16 "SOC_AMD_COMMON_BLOCK_UCODE_SIZE is not set");
18 #define MPB_MAX_SIZE CONFIG_SOC_AMD_COMMON_BLOCK_UCODE_SIZE
19 #define MPB_DATA_OFFSET 32
57 new_patch_id = msr.
lo;
59 if (new_patch_id ==
m->patch_id)
60 printk(
BIOS_INFO,
"microcode: being updated to patch id = 0x%08x succeeded\n",
63 printk(
BIOS_ERR,
"microcode: being updated to patch id = 0x%08x failed\n",
71 return (
uint16_t)((cpuid_family & 0xff0000) >> 8 | (cpuid_family & 0xff));
80 if (
m->processor_rev_id == equivalent_processor_rev_id)
85 equivalent_processor_rev_id);
93 static bool cache_valid;
111 if (!matching_ucode) {
116 ucode_cache = *matching_ucode;
129 if (!
CONFIG(CBFS_PRELOAD))
static unsigned int cpuid_eax(unsigned int op)
void cbfs_unmap(void *mapping)
static void * cbfs_map(const char *name, size_t *size_out)
void cbfs_preload(const char *name)
#define printk(level,...)
void amd_update_microcode_from_cbfs(void)
struct microcode __packed
static __always_inline msr_t rdmsr(unsigned int index)
#define IA32_BIOS_SIGN_ID
static __always_inline void wrmsr(unsigned int index, msr_t msr)
void timestamp_add_now(enum timestamp_id id)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
_Static_assert(CONFIG_SOC_AMD_COMMON_BLOCK_UCODE_SIZE > 0, "SOC_AMD_COMMON_BLOCK_UCODE_SIZE is not set")
static uint16_t get_equivalent_processor_rev_id(void)
#define CPU_MICROCODE_BLOB_NAME
void preload_microcode(void)
static void apply_microcode_patch(const struct microcode *m)
static const struct microcode * find_microcode(const struct microcode *ucode, size_t ucode_len)
unsigned long long uint64_t
uint16_t mc_patch_data_id
uint16_t processor_rev_id
uint8_t m_patch_data[F16H_MPB_MAX_SIZE-F16H_MPB_DATA_OFFSET]
#define m(clkreg, src_bits, pmcreg, dst_bits)