blob: 9231c876e374e503b51bef240345c521304ccdb6 [file] [log] [blame]
Peter Oruba26bf7a42008-07-28 18:44:20 +02001struct microcode_ops {
2 long (*get_next_ucode)(void **mc, long offset);
3 long (*microcode_get_next_ucode)(void **mc, long offset);
4 int (*get_matching_microcode)(void *mc, int cpu);
5 int (*apply_microcode_check_cpu)(int cpu);
6 int (*microcode_sanity_check)(void *mc);
7 int (*cpu_request_microcode)(int cpu);
8 void (*collect_cpu_info)(int cpu_num);
9 void (*apply_microcode)(int cpu);
10 void (*microcode_fini_cpu)(int cpu);
11 void (*clear_patch)(void *data);
12};
13
Peter Orubad4ee3662008-07-28 18:44:18 +020014struct microcode_header_intel {
Peter Oruba9a56a0f2008-07-28 18:44:13 +020015 unsigned int hdrver;
16 unsigned int rev;
17 unsigned int date;
18 unsigned int sig;
19 unsigned int cksum;
20 unsigned int ldrver;
21 unsigned int pf;
22 unsigned int datasize;
23 unsigned int totalsize;
24 unsigned int reserved[3];
25};
26
Peter Orubad4ee3662008-07-28 18:44:18 +020027struct microcode_intel {
28 struct microcode_header_intel hdr;
Peter Oruba9a56a0f2008-07-28 18:44:13 +020029 unsigned int bits[0];
30};
31
Peter Oruba9a56a0f2008-07-28 18:44:13 +020032/* microcode format is extended from prescott processors */
33struct extended_signature {
34 unsigned int sig;
35 unsigned int pf;
36 unsigned int cksum;
37};
38
39struct extended_sigtable {
40 unsigned int count;
41 unsigned int cksum;
42 unsigned int reserved[3];
43 struct extended_signature sigs[0];
44};
Peter Orubac3b71bc2008-07-28 18:44:15 +020045
Peter Oruba9835fd42008-07-28 18:44:19 +020046struct equiv_cpu_entry {
47 unsigned int installed_cpu;
48 unsigned int fixed_errata_mask;
49 unsigned int fixed_errata_compare;
50 unsigned int equiv_cpu;
51};
52
53struct microcode_header_amd {
54 unsigned int data_code;
55 unsigned int patch_id;
56 unsigned char mc_patch_data_id[2];
57 unsigned char mc_patch_data_len;
58 unsigned char init_flag;
59 unsigned int mc_patch_data_checksum;
60 unsigned int nb_dev_id;
61 unsigned int sb_dev_id;
62 unsigned char processor_rev_id[2];
63 unsigned char nb_rev_id;
64 unsigned char sb_rev_id;
65 unsigned char bios_api_rev;
66 unsigned char reserved1[3];
67 unsigned int match_reg[8];
68};
69
70struct microcode_amd {
71 struct microcode_header_amd hdr;
72 unsigned int mpb[0];
73};
74
Peter Orubac3b71bc2008-07-28 18:44:15 +020075struct ucode_cpu_info {
76 int valid;
77 unsigned int sig;
78 unsigned int pf;
79 unsigned int rev;
Peter Orubad4ee3662008-07-28 18:44:18 +020080 union {
81 struct microcode_intel *mc_intel;
Peter Oruba9835fd42008-07-28 18:44:19 +020082 struct microcode_amd *mc_amd;
Peter Orubad4ee3662008-07-28 18:44:18 +020083 } mc;
Peter Orubac3b71bc2008-07-28 18:44:15 +020084};