1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_MICROCODE_AMD_H
3 #define _ASM_X86_MICROCODE_AMD_H
5 #include <asm/microcode.h>
7 #define UCODE_MAGIC 0x00414d44
8 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
9 #define UCODE_UCODE_TYPE 0x00000001
11 #define SECTION_HDR_SIZE 8
12 #define CONTAINER_HDR_SZ 12
14 struct equiv_cpu_entry
{
16 u32 fixed_errata_mask
;
17 u32 fixed_errata_compare
;
20 } __attribute__((packed
));
22 struct microcode_header_amd
{
28 u32 mc_patch_data_checksum
;
37 } __attribute__((packed
));
39 struct microcode_amd
{
40 struct microcode_header_amd hdr
;
44 #define PATCH_MAX_SIZE (3 * PAGE_SIZE)
46 #ifdef CONFIG_MICROCODE_AMD
47 extern void __init
load_ucode_amd_bsp(unsigned int family
);
48 extern void load_ucode_amd_ap(unsigned int family
);
49 extern int __init
save_microcode_in_initrd_amd(unsigned int family
);
50 void reload_ucode_amd(void);
52 static inline void __init
load_ucode_amd_bsp(unsigned int family
) {}
53 static inline void load_ucode_amd_ap(unsigned int family
) {}
54 static inline int __init
55 save_microcode_in_initrd_amd(unsigned int family
) { return -EINVAL
; }
56 static inline void reload_ucode_amd(void) {}
58 #endif /* _ASM_X86_MICROCODE_AMD_H */