Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 1 | // System Management Mode support (on emulators) |
| 2 | // |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 3 | // Copyright (C) 2008-2014 Kevin O'Connor <kevin@koconnor.net> |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 4 | // Copyright (C) 2006 Fabrice Bellard |
| 5 | // |
Kevin O'Connor | b1b7c2a | 2009-01-15 20:52:58 -0500 | [diff] [blame] | 6 | // This file may be distributed under the terms of the GNU LGPLv3 license. |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 7 | |
Kevin O'Connor | 9521e26 | 2008-07-04 13:04:29 -0400 | [diff] [blame] | 8 | #include "config.h" // CONFIG_* |
Isaku Yamahata | 72a590e | 2012-11-28 10:17:33 +0100 | [diff] [blame] | 9 | #include "dev-q35.h" |
Paolo Bonzini | 40d0312 | 2014-05-15 13:22:26 +0200 | [diff] [blame] | 10 | #include "dev-piix.h" |
Kevin O'Connor | 2d2fa31 | 2013-09-14 21:55:26 -0400 | [diff] [blame] | 11 | #include "hw/pci.h" // pci_config_writel |
| 12 | #include "hw/pci_ids.h" // PCI_VENDOR_ID_INTEL |
| 13 | #include "hw/pci_regs.h" // PCI_DEVICE_ID |
Kevin O'Connor | 2d2fa31 | 2013-09-14 21:55:26 -0400 | [diff] [blame] | 14 | #include "output.h" // dprintf |
Kevin O'Connor | 4ade523 | 2013-09-18 21:41:48 -0400 | [diff] [blame] | 15 | #include "paravirt.h" // PORT_SMI_STATUS |
Kevin O'Connor | 55215cd | 2014-04-11 11:20:41 -0400 | [diff] [blame^] | 16 | #include "stacks.h" // HaveSmmCall32 |
Kevin O'Connor | fa9c66a | 2013-09-14 19:10:40 -0400 | [diff] [blame] | 17 | #include "string.h" // memcpy |
Kevin O'Connor | 2d2fa31 | 2013-09-14 21:55:26 -0400 | [diff] [blame] | 18 | #include "util.h" // smm_setup |
Kevin O'Connor | b9c6a96 | 2013-09-14 13:01:30 -0400 | [diff] [blame] | 19 | #include "x86.h" // wbinvd |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 20 | |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 21 | #define SMM_REV_I32 0x00020000 |
| 22 | #define SMM_REV_I64 0x00020064 |
| 23 | |
| 24 | struct smm_state { |
| 25 | union { |
| 26 | struct { |
| 27 | u8 pad_000[0xf8]; |
| 28 | u32 smm_base; |
| 29 | u32 smm_rev; |
| 30 | u8 pad_100[0xd0]; |
| 31 | u32 eax, ecx, edx, ebx, esp, ebp, esi, edi, eip, eflags; |
| 32 | u8 pad_1f8[0x08]; |
| 33 | } i32; |
| 34 | struct { |
| 35 | u8 pad_000[0xfc]; |
| 36 | u32 smm_rev; |
| 37 | u32 smm_base; |
| 38 | u8 pad_104[0x6c]; |
| 39 | u64 rflags, rip, r15, r14, r13, r12, r11, r10, r9, r8; |
| 40 | u64 rdi, rsi, rbp, rsp, rbx, rdx, rcx, rax; |
| 41 | } i64; |
| 42 | }; |
| 43 | }; |
| 44 | |
| 45 | struct smm_layout { |
Kevin O'Connor | 55215cd | 2014-04-11 11:20:41 -0400 | [diff] [blame^] | 46 | struct smm_state backup1; |
| 47 | struct smm_state backup2; |
| 48 | u8 stack[0x7c00]; |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 49 | u64 codeentry; |
| 50 | u8 pad_8008[0x7df8]; |
| 51 | struct smm_state cpu; |
| 52 | }; |
| 53 | |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 54 | void VISIBLE32FLAT |
| 55 | handle_smi(u16 cs) |
| 56 | { |
Kevin O'Connor | d71d52b | 2014-06-05 11:08:44 -0400 | [diff] [blame] | 57 | if (!CONFIG_USE_SMM) |
| 58 | return; |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 59 | u8 cmd = inb(PORT_SMI_CMD); |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 60 | struct smm_layout *smm = MAKE_FLATPTR(cs, 0); |
| 61 | dprintf(DEBUG_HDL_smi, "handle_smi cmd=%x smbase=%p\n", cmd, smm); |
Paolo Bonzini | 2126994 | 2014-05-15 13:22:29 +0200 | [diff] [blame] | 62 | |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 63 | if (smm == (void*)BUILD_SMM_INIT_ADDR) { |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 64 | // relocate SMBASE to 0xa0000 |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 65 | if (smm->cpu.i32.smm_rev == SMM_REV_I32) { |
| 66 | smm->cpu.i32.smm_base = BUILD_SMM_ADDR; |
| 67 | } else if (smm->cpu.i64.smm_rev == SMM_REV_I64) { |
| 68 | smm->cpu.i64.smm_base = BUILD_SMM_ADDR; |
| 69 | } else { |
| 70 | warn_internalerror(); |
| 71 | return; |
| 72 | } |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 73 | // indicate to smm_relocate_and_restore() that the SMM code was executed |
| 74 | outb(0x00, PORT_SMI_STATUS); |
Kevin O'Connor | 55215cd | 2014-04-11 11:20:41 -0400 | [diff] [blame^] | 75 | |
| 76 | if (CONFIG_CALL32_SMM) { |
| 77 | // Backup current cpu state for SMM trampolining |
| 78 | struct smm_layout *newsmm = (void*)BUILD_SMM_ADDR; |
| 79 | memcpy(&newsmm->backup1, &smm->cpu, sizeof(newsmm->backup1)); |
| 80 | memcpy(&newsmm->backup2, &smm->cpu, sizeof(newsmm->backup2)); |
| 81 | HaveSmmCall32 = 1; |
| 82 | } |
| 83 | |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 84 | return; |
| 85 | } |
Kevin O'Connor | 55215cd | 2014-04-11 11:20:41 -0400 | [diff] [blame^] | 86 | |
| 87 | if (CONFIG_CALL32_SMM && cmd == CALL32SMM_CMDID) { |
| 88 | if (smm->cpu.i32.smm_rev == SMM_REV_I32) { |
| 89 | u32 regs[8]; |
| 90 | memcpy(regs, &smm->cpu.i32.eax, sizeof(regs)); |
| 91 | if (smm->cpu.i32.ecx == CALL32SMM_ENTERID) { |
| 92 | dprintf(9, "smm cpu call pc=%x esp=%x\n", regs[3], regs[4]); |
| 93 | memcpy(&smm->backup2, &smm->cpu, sizeof(smm->backup2)); |
| 94 | memcpy(&smm->cpu, &smm->backup1, sizeof(smm->cpu)); |
| 95 | memcpy(&smm->cpu.i32.eax, regs, sizeof(regs)); |
| 96 | smm->cpu.i32.eip = regs[3]; |
| 97 | } else if (smm->cpu.i32.ecx == CALL32SMM_RETURNID) { |
| 98 | dprintf(9, "smm cpu ret %x esp=%x\n", regs[3], regs[4]); |
| 99 | memcpy(&smm->cpu, &smm->backup2, sizeof(smm->cpu)); |
| 100 | memcpy(&smm->cpu.i32.eax, regs, sizeof(regs)); |
| 101 | smm->cpu.i32.eip = regs[3]; |
| 102 | } |
| 103 | } else if (smm->cpu.i64.smm_rev == SMM_REV_I64) { |
| 104 | u64 regs[8]; |
| 105 | memcpy(regs, &smm->cpu.i64.rdi, sizeof(regs)); |
| 106 | if ((u32)smm->cpu.i64.rcx == CALL32SMM_ENTERID) { |
| 107 | memcpy(&smm->backup2, &smm->cpu, sizeof(smm->backup2)); |
| 108 | memcpy(&smm->cpu, &smm->backup1, sizeof(smm->cpu)); |
| 109 | memcpy(&smm->cpu.i64.rdi, regs, sizeof(regs)); |
| 110 | smm->cpu.i64.rip = (u32)regs[4]; |
| 111 | } else if ((u32)smm->cpu.i64.rcx == CALL32SMM_RETURNID) { |
| 112 | memcpy(&smm->cpu, &smm->backup2, sizeof(smm->cpu)); |
| 113 | memcpy(&smm->cpu.i64.rdi, regs, sizeof(regs)); |
| 114 | smm->cpu.i64.rip = (u32)regs[4]; |
| 115 | } |
| 116 | } |
| 117 | } |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 118 | } |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 119 | |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 120 | extern void entry_smi(void); |
| 121 | // movw %cs, %ax; ljmpw $SEG_BIOS, $(entry_smi - BUILD_BIOS_ADDR) |
| 122 | #define SMI_INSN (0xeac88c | ((u64)SEG_BIOS<<40) \ |
| 123 | | ((u64)((u32)entry_smi - BUILD_BIOS_ADDR) << 24)) |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 124 | |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 125 | static void |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 126 | smm_save_and_copy(void) |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 127 | { |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 128 | // save original memory content |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 129 | struct smm_layout *initsmm = (void*)BUILD_SMM_INIT_ADDR; |
| 130 | struct smm_layout *smm = (void*)BUILD_SMM_ADDR; |
| 131 | memcpy(&smm->cpu, &initsmm->cpu, sizeof(smm->cpu)); |
| 132 | memcpy(&smm->codeentry, &initsmm->codeentry, sizeof(smm->codeentry)); |
Kevin O'Connor | e682cbc | 2008-12-06 23:11:56 -0500 | [diff] [blame] | 133 | |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 134 | // Setup code entry point. |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 135 | initsmm->codeentry = SMI_INSN; |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 136 | } |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 137 | |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 138 | static void |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 139 | smm_relocate_and_restore(void) |
| 140 | { |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 141 | /* init APM status port */ |
Kevin O'Connor | e682cbc | 2008-12-06 23:11:56 -0500 | [diff] [blame] | 142 | outb(0x01, PORT_SMI_STATUS); |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 143 | |
| 144 | /* raise an SMI interrupt */ |
Kevin O'Connor | e682cbc | 2008-12-06 23:11:56 -0500 | [diff] [blame] | 145 | outb(0x00, PORT_SMI_CMD); |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 146 | |
| 147 | /* wait until SMM code executed */ |
Kevin O'Connor | e682cbc | 2008-12-06 23:11:56 -0500 | [diff] [blame] | 148 | while (inb(PORT_SMI_STATUS) != 0x00) |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 149 | ; |
| 150 | |
Kevin O'Connor | e682cbc | 2008-12-06 23:11:56 -0500 | [diff] [blame] | 151 | /* restore original memory content */ |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 152 | struct smm_layout *initsmm = (void*)BUILD_SMM_INIT_ADDR; |
| 153 | struct smm_layout *smm = (void*)BUILD_SMM_ADDR; |
| 154 | memcpy(&initsmm->cpu, &smm->cpu, sizeof(initsmm->cpu)); |
| 155 | memcpy(&initsmm->codeentry, &smm->codeentry, sizeof(initsmm->codeentry)); |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 156 | |
Kevin O'Connor | f4c511c | 2014-04-07 19:49:12 -0400 | [diff] [blame] | 157 | // Setup code entry point. |
Kevin O'Connor | 31bcda2 | 2014-05-28 13:33:50 -0400 | [diff] [blame] | 158 | smm->codeentry = SMI_INSN; |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 159 | wbinvd(); |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 160 | } |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 161 | |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 162 | // This code is hardcoded for PIIX4 Power Management device. |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 163 | static void piix4_apmc_smm_setup(int isabdf, int i440_bdf) |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 164 | { |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 165 | /* check if SMM init is already done */ |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 166 | u32 value = pci_config_readl(isabdf, PIIX_DEVACTB); |
Paolo Bonzini | 40d0312 | 2014-05-15 13:22:26 +0200 | [diff] [blame] | 167 | if (value & PIIX_DEVACTB_APMC_EN) |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 168 | return; |
| 169 | |
| 170 | /* enable the SMM memory window */ |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 171 | pci_config_writeb(i440_bdf, I440FX_SMRAM, 0x02 | 0x48); |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 172 | |
| 173 | smm_save_and_copy(); |
| 174 | |
| 175 | /* enable SMI generation when writing to the APMC register */ |
Paolo Bonzini | 40d0312 | 2014-05-15 13:22:26 +0200 | [diff] [blame] | 176 | pci_config_writel(isabdf, PIIX_DEVACTB, value | PIIX_DEVACTB_APMC_EN); |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 177 | |
Paolo Bonzini | 457ba42 | 2014-05-15 13:22:28 +0200 | [diff] [blame] | 178 | /* enable SMI generation */ |
| 179 | value = inl(acpi_pm_base + PIIX_PMIO_GLBCTL); |
Kevin O'Connor | a9f4816 | 2014-08-23 12:10:29 -0400 | [diff] [blame] | 180 | outl(acpi_pm_base + PIIX_PMIO_GLBCTL, value | PIIX_PMIO_GLBCTL_SMI_EN); |
Paolo Bonzini | 457ba42 | 2014-05-15 13:22:28 +0200 | [diff] [blame] | 181 | |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 182 | smm_relocate_and_restore(); |
| 183 | |
| 184 | /* close the SMM memory window and enable normal SMM */ |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 185 | pci_config_writeb(i440_bdf, I440FX_SMRAM, 0x02 | 0x08); |
Kevin O'Connor | 6e4583c | 2011-06-19 10:09:26 -0400 | [diff] [blame] | 186 | } |
| 187 | |
Isaku Yamahata | 72a590e | 2012-11-28 10:17:33 +0100 | [diff] [blame] | 188 | /* PCI_VENDOR_ID_INTEL && PCI_DEVICE_ID_INTEL_ICH9_LPC */ |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 189 | void ich9_lpc_apmc_smm_setup(int isabdf, int mch_bdf) |
Isaku Yamahata | 72a590e | 2012-11-28 10:17:33 +0100 | [diff] [blame] | 190 | { |
Isaku Yamahata | 72a590e | 2012-11-28 10:17:33 +0100 | [diff] [blame] | 191 | /* check if SMM init is already done */ |
Gerd Hoffmann | a217de9 | 2014-05-13 14:01:22 +0200 | [diff] [blame] | 192 | u32 value = inl(acpi_pm_base + ICH9_PMIO_SMI_EN); |
Isaku Yamahata | 72a590e | 2012-11-28 10:17:33 +0100 | [diff] [blame] | 193 | if (value & ICH9_PMIO_SMI_EN_APMC_EN) |
| 194 | return; |
| 195 | |
| 196 | /* enable the SMM memory window */ |
| 197 | pci_config_writeb(mch_bdf, Q35_HOST_BRIDGE_SMRAM, 0x02 | 0x48); |
| 198 | |
| 199 | smm_save_and_copy(); |
| 200 | |
| 201 | /* enable SMI generation when writing to the APMC register */ |
Paolo Bonzini | 457ba42 | 2014-05-15 13:22:28 +0200 | [diff] [blame] | 202 | outl(value | ICH9_PMIO_SMI_EN_APMC_EN | ICH9_PMIO_SMI_EN_GLB_SMI_EN, |
Gerd Hoffmann | a217de9 | 2014-05-13 14:01:22 +0200 | [diff] [blame] | 203 | acpi_pm_base + ICH9_PMIO_SMI_EN); |
Isaku Yamahata | 72a590e | 2012-11-28 10:17:33 +0100 | [diff] [blame] | 204 | |
Paolo Bonzini | 457ba42 | 2014-05-15 13:22:28 +0200 | [diff] [blame] | 205 | /* lock SMI generation */ |
| 206 | value = pci_config_readw(isabdf, ICH9_LPC_GEN_PMCON_1); |
| 207 | pci_config_writel(isabdf, ICH9_LPC_GEN_PMCON_1, |
| 208 | value | ICH9_LPC_GEN_PMCON_1_SMI_LOCK); |
| 209 | |
Isaku Yamahata | 72a590e | 2012-11-28 10:17:33 +0100 | [diff] [blame] | 210 | smm_relocate_and_restore(); |
| 211 | |
| 212 | /* close the SMM memory window and enable normal SMM */ |
| 213 | pci_config_writeb(mch_bdf, Q35_HOST_BRIDGE_SMRAM, 0x02 | 0x08); |
| 214 | } |
| 215 | |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 216 | static int SMMISADeviceBDF = -1, SMMPMDeviceBDF = -1; |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 217 | |
| 218 | void |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 219 | smm_device_setup(void) |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 220 | { |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 221 | if (!CONFIG_USE_SMM) |
Kevin O'Connor | 028f348 | 2014-04-11 12:08:33 -0400 | [diff] [blame] | 222 | return; |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 223 | |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 224 | struct pci_device *isapci, *pmpci; |
| 225 | isapci = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3); |
| 226 | pmpci = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441); |
| 227 | if (isapci && pmpci) { |
| 228 | SMMISADeviceBDF = isapci->bdf; |
| 229 | SMMPMDeviceBDF = pmpci->bdf; |
| 230 | return; |
| 231 | } |
| 232 | isapci = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_LPC); |
| 233 | pmpci = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q35_MCH); |
| 234 | if (isapci && pmpci) { |
| 235 | SMMISADeviceBDF = isapci->bdf; |
| 236 | SMMPMDeviceBDF = pmpci->bdf; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | void |
| 241 | smm_setup(void) |
| 242 | { |
| 243 | if (!CONFIG_USE_SMM || SMMISADeviceBDF < 0) |
Kevin O'Connor | 028f348 | 2014-04-11 12:08:33 -0400 | [diff] [blame] | 244 | return; |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 245 | |
Isaku Yamahata | aec19c9 | 2010-07-20 16:50:46 +0900 | [diff] [blame] | 246 | dprintf(3, "init smm\n"); |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 247 | u16 device = pci_config_readw(SMMISADeviceBDF, PCI_DEVICE_ID); |
| 248 | if (device == PCI_DEVICE_ID_INTEL_82371AB_3) |
| 249 | piix4_apmc_smm_setup(SMMISADeviceBDF, SMMPMDeviceBDF); |
| 250 | else |
| 251 | ich9_lpc_apmc_smm_setup(SMMISADeviceBDF, SMMPMDeviceBDF); |
Kevin O'Connor | f7ba6d7 | 2008-07-04 05:05:54 -0400 | [diff] [blame] | 252 | } |