xref: /linux/arch/x86/include/asm/cpu_device_id.h (revision 44f57d78)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_CPU_DEVICE_ID
3 #define _ASM_X86_CPU_DEVICE_ID
4 
5 /*
6  * Declare drivers belonging to specific x86 CPUs
7  * Similar in spirit to pci_device_id and related PCI functions
8  */
9 
10 #include <linux/mod_devicetable.h>
11 
12 /*
13  * Match specific microcode revisions.
14  *
15  * vendor/family/model/stepping must be all set.
16  *
17  * Only checks against the boot CPU.  When mixed-stepping configs are
18  * valid for a CPU model, add a quirk for every valid stepping and
19  * do the fine-tuning in the quirk handler.
20  */
21 
22 struct x86_cpu_desc {
23 	u8	x86_family;
24 	u8	x86_vendor;
25 	u8	x86_model;
26 	u8	x86_stepping;
27 	u32	x86_microcode_rev;
28 };
29 
30 #define INTEL_CPU_DESC(model, stepping, revision) {		\
31 	.x86_family		= 6,				\
32 	.x86_vendor		= X86_VENDOR_INTEL,		\
33 	.x86_model		= (model),			\
34 	.x86_stepping		= (stepping),			\
35 	.x86_microcode_rev	= (revision),			\
36 }
37 
38 extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
39 extern bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table);
40 
41 #endif /* _ASM_X86_CPU_DEVICE_ID */
42