aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/microcode.h
diff options
context:
space:
mode:
authorDmitry Adamushko <dmitry.adamushko@gmail.com>2008-09-23 06:08:44 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-23 06:21:42 -0400
commit18dbc9160507dc7df998e00cd1dcd7889557307b (patch)
tree81262b57db5de63267762083a54a37558d8555f0 /include/asm-x86/microcode.h
parenta1c75cc5018f17ff6d80ce45a13435b1536f76db (diff)
x86: moved microcode.c to microcode_intel.c
Combine both generic and arch-specific parts of microcode into a single module (arch-specific parts are config-dependent). Also while we are at it, move arch-specific parts from microcode.h into their respective arch-specific .c files. Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com> Cc: "Peter Oruba" <peter.oruba@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/microcode.h')
-rw-r--r--include/asm-x86/microcode.h99
1 files changed, 24 insertions, 75 deletions
diff --git a/include/asm-x86/microcode.h b/include/asm-x86/microcode.h
index e2887facdb4a..62c793bb70ca 100644
--- a/include/asm-x86/microcode.h
+++ b/include/asm-x86/microcode.h
@@ -1,10 +1,12 @@
1#ifndef ASM_X86__MICROCODE_H 1#ifndef ASM_X86__MICROCODE_H
2#define ASM_X86__MICROCODE_H 2#define ASM_X86__MICROCODE_H
3 3
4extern int microcode_init(void *opaque, struct module *module); 4struct cpu_signature {
5extern void microcode_exit(void); 5 unsigned int sig;
6 unsigned int pf;
7 unsigned int rev;
8};
6 9
7struct cpu_signature;
8struct device; 10struct device;
9 11
10struct microcode_ops { 12struct microcode_ops {
@@ -17,82 +19,29 @@ struct microcode_ops {
17 void (*microcode_fini_cpu) (int cpu); 19 void (*microcode_fini_cpu) (int cpu);
18}; 20};
19 21
20struct microcode_header_intel {
21 unsigned int hdrver;
22 unsigned int rev;
23 unsigned int date;
24 unsigned int sig;
25 unsigned int cksum;
26 unsigned int ldrver;
27 unsigned int pf;
28 unsigned int datasize;
29 unsigned int totalsize;
30 unsigned int reserved[3];
31};
32
33struct microcode_intel {
34 struct microcode_header_intel hdr;
35 unsigned int bits[0];
36};
37
38/* microcode format is extended from prescott processors */
39struct extended_signature {
40 unsigned int sig;
41 unsigned int pf;
42 unsigned int cksum;
43};
44
45struct extended_sigtable {
46 unsigned int count;
47 unsigned int cksum;
48 unsigned int reserved[3];
49 struct extended_signature sigs[0];
50};
51
52struct equiv_cpu_entry {
53 unsigned int installed_cpu;
54 unsigned int fixed_errata_mask;
55 unsigned int fixed_errata_compare;
56 unsigned int equiv_cpu;
57};
58
59struct microcode_header_amd {
60 unsigned int data_code;
61 unsigned int patch_id;
62 unsigned char mc_patch_data_id[2];
63 unsigned char mc_patch_data_len;
64 unsigned char init_flag;
65 unsigned int mc_patch_data_checksum;
66 unsigned int nb_dev_id;
67 unsigned int sb_dev_id;
68 unsigned char processor_rev_id[2];
69 unsigned char nb_rev_id;
70 unsigned char sb_rev_id;
71 unsigned char bios_api_rev;
72 unsigned char reserved1[3];
73 unsigned int match_reg[8];
74};
75
76struct microcode_amd {
77 struct microcode_header_amd hdr;
78 unsigned int mpb[0];
79};
80
81struct cpu_signature {
82 unsigned int sig;
83 unsigned int pf;
84 unsigned int rev;
85};
86
87struct ucode_cpu_info { 22struct ucode_cpu_info {
88 struct cpu_signature cpu_sig; 23 struct cpu_signature cpu_sig;
89 int valid; 24 int valid;
90 union { 25 void *mc;
91 struct microcode_intel *mc_intel;
92 struct microcode_amd *mc_amd;
93 void *valid_mc;
94 } mc;
95}; 26};
96extern struct ucode_cpu_info ucode_cpu_info[]; 27extern struct ucode_cpu_info ucode_cpu_info[];
97 28
29#ifdef CONFIG_MICROCODE_INTEL
30extern struct microcode_ops * __init init_intel_microcode(void);
31#else
32static inline struct microcode_ops * __init init_intel_microcode(void)
33{
34 return NULL;
35}
36#endif /* CONFIG_MICROCODE_INTEL */
37
38#ifdef CONFIG_MICROCODE_AMD
39extern struct microcode_ops * __init init_amd_microcode(void);
40#else
41static inline struct microcode_ops * __init init_amd_microcode(void)
42{
43 return NULL;
44}
45#endif
46
98#endif /* ASM_X86__MICROCODE_H */ 47#endif /* ASM_X86__MICROCODE_H */