lpc_ich9.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. /*
  2. * QEMU ICH9 Emulation
  3. *
  4. * Copyright (c) 2006 Fabrice Bellard
  5. * Copyright (c) 2009, 2010, 2011
  6. * Isaku Yamahata <yamahata at valinux co jp>
  7. * VA Linux Systems Japan K.K.
  8. * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
  9. *
  10. * This is based on piix_pci.c, but heavily modified.
  11. *
  12. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13. * of this software and associated documentation files (the "Software"), to deal
  14. * in the Software without restriction, including without limitation the rights
  15. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16. * copies of the Software, and to permit persons to whom the Software is
  17. * furnished to do so, subject to the following conditions:
  18. *
  19. * The above copyright notice and this permission notice shall be included in
  20. * all copies or substantial portions of the Software.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  25. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  26. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  27. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  28. * THE SOFTWARE.
  29. */
  30. #include "qemu-common.h"
  31. #include "hw.h"
  32. #include "qemu/range.h"
  33. #include "isa.h"
  34. #include "sysbus.h"
  35. #include "pc.h"
  36. #include "apm.h"
  37. #include "ioapic.h"
  38. #include "pci/pci.h"
  39. #include "pci/pcie_host.h"
  40. #include "pci/pci_bridge.h"
  41. #include "ich9.h"
  42. #include "acpi.h"
  43. #include "acpi_ich9.h"
  44. #include "pam.h"
  45. #include "pci/pci_bus.h"
  46. #include "exec/address-spaces.h"
  47. #include "sysemu/sysemu.h"
  48. static int ich9_lpc_sci_irq(ICH9LPCState *lpc);
  49. /*****************************************************************************/
  50. /* ICH9 LPC PCI to ISA bridge */
  51. static void ich9_lpc_reset(DeviceState *qdev);
  52. /* chipset configuration register
  53. * to access chipset configuration registers, pci_[sg]et_{byte, word, long}
  54. * are used.
  55. * Although it's not pci configuration space, it's little endian as Intel.
  56. */
  57. static void ich9_cc_update_ir(uint8_t irr[PCI_NUM_PINS], uint16_t ir)
  58. {
  59. int intx;
  60. for (intx = 0; intx < PCI_NUM_PINS; intx++) {
  61. irr[intx] = (ir >> (intx * ICH9_CC_DIR_SHIFT)) & ICH9_CC_DIR_MASK;
  62. }
  63. }
  64. static void ich9_cc_update(ICH9LPCState *lpc)
  65. {
  66. int slot;
  67. int pci_intx;
  68. const int reg_offsets[] = {
  69. ICH9_CC_D25IR,
  70. ICH9_CC_D26IR,
  71. ICH9_CC_D27IR,
  72. ICH9_CC_D28IR,
  73. ICH9_CC_D29IR,
  74. ICH9_CC_D30IR,
  75. ICH9_CC_D31IR,
  76. };
  77. const int *offset;
  78. /* D{25 - 31}IR, but D30IR is read only to 0. */
  79. for (slot = 25, offset = reg_offsets; slot < 32; slot++, offset++) {
  80. if (slot == 30) {
  81. continue;
  82. }
  83. ich9_cc_update_ir(lpc->irr[slot],
  84. pci_get_word(lpc->chip_config + *offset));
  85. }
  86. /*
  87. * D30: DMI2PCI bridge
  88. * It is arbitrarily decided how INTx lines of PCI devicesbehind the bridge
  89. * are connected to pirq lines. Our choice is PIRQ[E-H].
  90. * INT[A-D] are connected to PIRQ[E-H]
  91. */
  92. for (pci_intx = 0; pci_intx < PCI_NUM_PINS; pci_intx++) {
  93. lpc->irr[30][pci_intx] = pci_intx + 4;
  94. }
  95. }
  96. static void ich9_cc_init(ICH9LPCState *lpc)
  97. {
  98. int slot;
  99. int intx;
  100. /* the default irq routing is arbitrary as long as it matches with
  101. * acpi irq routing table.
  102. * The one that is incompatible with piix_pci(= bochs) one is
  103. * intentionally chosen to let the users know that the different
  104. * board is used.
  105. *
  106. * int[A-D] -> pirq[E-F]
  107. * avoid pirq A-D because they are used for pci express port
  108. */
  109. for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
  110. for (intx = 0; intx < PCI_NUM_PINS; intx++) {
  111. lpc->irr[slot][intx] = (slot + intx) % 4 + 4;
  112. }
  113. }
  114. ich9_cc_update(lpc);
  115. }
  116. static void ich9_cc_reset(ICH9LPCState *lpc)
  117. {
  118. uint8_t *c = lpc->chip_config;
  119. memset(lpc->chip_config, 0, sizeof(lpc->chip_config));
  120. pci_set_long(c + ICH9_CC_D31IR, ICH9_CC_DIR_DEFAULT);
  121. pci_set_long(c + ICH9_CC_D30IR, ICH9_CC_D30IR_DEFAULT);
  122. pci_set_long(c + ICH9_CC_D29IR, ICH9_CC_DIR_DEFAULT);
  123. pci_set_long(c + ICH9_CC_D28IR, ICH9_CC_DIR_DEFAULT);
  124. pci_set_long(c + ICH9_CC_D27IR, ICH9_CC_DIR_DEFAULT);
  125. pci_set_long(c + ICH9_CC_D26IR, ICH9_CC_DIR_DEFAULT);
  126. pci_set_long(c + ICH9_CC_D25IR, ICH9_CC_DIR_DEFAULT);
  127. ich9_cc_update(lpc);
  128. }
  129. static void ich9_cc_addr_len(uint64_t *addr, unsigned *len)
  130. {
  131. *addr &= ICH9_CC_ADDR_MASK;
  132. if (*addr + *len >= ICH9_CC_SIZE) {
  133. *len = ICH9_CC_SIZE - *addr;
  134. }
  135. }
  136. /* val: little endian */
  137. static void ich9_cc_write(void *opaque, hwaddr addr,
  138. uint64_t val, unsigned len)
  139. {
  140. ICH9LPCState *lpc = (ICH9LPCState *)opaque;
  141. ich9_cc_addr_len(&addr, &len);
  142. memcpy(lpc->chip_config + addr, &val, len);
  143. pci_bus_fire_intx_routing_notifier(lpc->d.bus);
  144. ich9_cc_update(lpc);
  145. }
  146. /* return value: little endian */
  147. static uint64_t ich9_cc_read(void *opaque, hwaddr addr,
  148. unsigned len)
  149. {
  150. ICH9LPCState *lpc = (ICH9LPCState *)opaque;
  151. uint32_t val = 0;
  152. ich9_cc_addr_len(&addr, &len);
  153. memcpy(&val, lpc->chip_config + addr, len);
  154. return val;
  155. }
  156. /* IRQ routing */
  157. /* */
  158. static void ich9_lpc_rout(uint8_t pirq_rout, int *pic_irq, int *pic_dis)
  159. {
  160. *pic_irq = pirq_rout & ICH9_LPC_PIRQ_ROUT_MASK;
  161. *pic_dis = pirq_rout & ICH9_LPC_PIRQ_ROUT_IRQEN;
  162. }
  163. static void ich9_lpc_pic_irq(ICH9LPCState *lpc, int pirq_num,
  164. int *pic_irq, int *pic_dis)
  165. {
  166. switch (pirq_num) {
  167. case 0 ... 3: /* A-D */
  168. ich9_lpc_rout(lpc->d.config[ICH9_LPC_PIRQA_ROUT + pirq_num],
  169. pic_irq, pic_dis);
  170. return;
  171. case 4 ... 7: /* E-H */
  172. ich9_lpc_rout(lpc->d.config[ICH9_LPC_PIRQE_ROUT + (pirq_num - 4)],
  173. pic_irq, pic_dis);
  174. return;
  175. default:
  176. break;
  177. }
  178. abort();
  179. }
  180. /* pic_irq: i8254 irq 0-15 */
  181. static void ich9_lpc_update_pic(ICH9LPCState *lpc, int pic_irq)
  182. {
  183. int i, pic_level;
  184. /* The pic level is the logical OR of all the PCI irqs mapped to it */
  185. pic_level = 0;
  186. for (i = 0; i < ICH9_LPC_NB_PIRQS; i++) {
  187. int tmp_irq;
  188. int tmp_dis;
  189. ich9_lpc_pic_irq(lpc, i, &tmp_irq, &tmp_dis);
  190. if (!tmp_dis && pic_irq == tmp_irq) {
  191. pic_level |= pci_bus_get_irq_level(lpc->d.bus, i);
  192. }
  193. }
  194. if (pic_irq == ich9_lpc_sci_irq(lpc)) {
  195. pic_level |= lpc->sci_level;
  196. }
  197. qemu_set_irq(lpc->pic[pic_irq], pic_level);
  198. }
  199. /* pirq: pirq[A-H] 0-7*/
  200. static void ich9_lpc_update_by_pirq(ICH9LPCState *lpc, int pirq)
  201. {
  202. int pic_irq;
  203. int pic_dis;
  204. ich9_lpc_pic_irq(lpc, pirq, &pic_irq, &pic_dis);
  205. assert(pic_irq < ICH9_LPC_PIC_NUM_PINS);
  206. if (pic_dis) {
  207. return;
  208. }
  209. ich9_lpc_update_pic(lpc, pic_irq);
  210. }
  211. /* APIC mode: GSIx: PIRQ[A-H] -> GSI 16, ... no pirq shares same APIC pins. */
  212. static int ich9_pirq_to_gsi(int pirq)
  213. {
  214. return pirq + ICH9_LPC_PIC_NUM_PINS;
  215. }
  216. static int ich9_gsi_to_pirq(int gsi)
  217. {
  218. return gsi - ICH9_LPC_PIC_NUM_PINS;
  219. }
  220. static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)
  221. {
  222. int level = 0;
  223. if (gsi >= ICH9_LPC_PIC_NUM_PINS) {
  224. level |= pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
  225. }
  226. if (gsi == ich9_lpc_sci_irq(lpc)) {
  227. level |= lpc->sci_level;
  228. }
  229. qemu_set_irq(lpc->ioapic[gsi], level);
  230. }
  231. void ich9_lpc_set_irq(void *opaque, int pirq, int level)
  232. {
  233. ICH9LPCState *lpc = opaque;
  234. assert(0 <= pirq);
  235. assert(pirq < ICH9_LPC_NB_PIRQS);
  236. ich9_lpc_update_apic(lpc, ich9_pirq_to_gsi(pirq));
  237. ich9_lpc_update_by_pirq(lpc, pirq);
  238. }
  239. /* return the pirq number (PIRQ[A-H]:0-7) corresponding to
  240. * a given device irq pin.
  241. */
  242. int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx)
  243. {
  244. BusState *bus = qdev_get_parent_bus(&pci_dev->qdev);
  245. PCIBus *pci_bus = PCI_BUS(bus);
  246. PCIDevice *lpc_pdev =
  247. pci_bus->devices[PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC)];
  248. ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pdev);
  249. return lpc->irr[PCI_SLOT(pci_dev->devfn)][intx];
  250. }
  251. PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin)
  252. {
  253. ICH9LPCState *lpc = opaque;
  254. PCIINTxRoute route;
  255. int pic_irq;
  256. int pic_dis;
  257. assert(0 <= pirq_pin);
  258. assert(pirq_pin < ICH9_LPC_NB_PIRQS);
  259. route.mode = PCI_INTX_ENABLED;
  260. ich9_lpc_pic_irq(lpc, pirq_pin, &pic_irq, &pic_dis);
  261. if (!pic_dis) {
  262. if (pic_irq < ICH9_LPC_PIC_NUM_PINS) {
  263. route.irq = pic_irq;
  264. } else {
  265. route.mode = PCI_INTX_DISABLED;
  266. route.irq = -1;
  267. }
  268. } else {
  269. route.irq = ich9_pirq_to_gsi(pirq_pin);
  270. }
  271. return route;
  272. }
  273. static int ich9_lpc_sci_irq(ICH9LPCState *lpc)
  274. {
  275. switch (lpc->d.config[ICH9_LPC_ACPI_CTRL] &
  276. ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK) {
  277. case ICH9_LPC_ACPI_CTRL_9:
  278. return 9;
  279. case ICH9_LPC_ACPI_CTRL_10:
  280. return 10;
  281. case ICH9_LPC_ACPI_CTRL_11:
  282. return 11;
  283. case ICH9_LPC_ACPI_CTRL_20:
  284. return 20;
  285. case ICH9_LPC_ACPI_CTRL_21:
  286. return 21;
  287. default:
  288. /* reserved */
  289. break;
  290. }
  291. return -1;
  292. }
  293. static void ich9_set_sci(void *opaque, int irq_num, int level)
  294. {
  295. ICH9LPCState *lpc = opaque;
  296. int irq;
  297. assert(irq_num == 0);
  298. level = !!level;
  299. if (level == lpc->sci_level) {
  300. return;
  301. }
  302. lpc->sci_level = level;
  303. irq = ich9_lpc_sci_irq(lpc);
  304. if (irq < 0) {
  305. return;
  306. }
  307. ich9_lpc_update_apic(lpc, irq);
  308. if (irq < ICH9_LPC_PIC_NUM_PINS) {
  309. ich9_lpc_update_pic(lpc, irq);
  310. }
  311. }
  312. void ich9_lpc_pm_init(PCIDevice *lpc_pci, qemu_irq cmos_s3)
  313. {
  314. ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pci);
  315. qemu_irq *sci_irq;
  316. sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
  317. ich9_pm_init(lpc_pci, &lpc->pm, sci_irq[0], cmos_s3);
  318. ich9_lpc_reset(&lpc->d.qdev);
  319. }
  320. /* APM */
  321. static void ich9_apm_ctrl_changed(uint32_t val, void *arg)
  322. {
  323. ICH9LPCState *lpc = arg;
  324. /* ACPI specs 3.0, 4.7.2.5 */
  325. acpi_pm1_cnt_update(&lpc->pm.acpi_regs,
  326. val == ICH9_APM_ACPI_ENABLE,
  327. val == ICH9_APM_ACPI_DISABLE);
  328. /* SMI_EN = PMBASE + 30. SMI control and enable register */
  329. if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {
  330. cpu_interrupt(first_cpu, CPU_INTERRUPT_SMI);
  331. }
  332. }
  333. /* config:PMBASE */
  334. static void
  335. ich9_lpc_pmbase_update(ICH9LPCState *lpc)
  336. {
  337. uint32_t pm_io_base = pci_get_long(lpc->d.config + ICH9_LPC_PMBASE);
  338. pm_io_base &= ICH9_LPC_PMBASE_BASE_ADDRESS_MASK;
  339. ich9_pm_iospace_update(&lpc->pm, pm_io_base);
  340. }
  341. /* config:RBCA */
  342. static void ich9_lpc_rcba_update(ICH9LPCState *lpc, uint32_t rbca_old)
  343. {
  344. uint32_t rbca = pci_get_long(lpc->d.config + ICH9_LPC_RCBA);
  345. if (rbca_old & ICH9_LPC_RCBA_EN) {
  346. memory_region_del_subregion(get_system_memory(), &lpc->rbca_mem);
  347. }
  348. if (rbca & ICH9_LPC_RCBA_EN) {
  349. memory_region_add_subregion_overlap(get_system_memory(),
  350. rbca & ICH9_LPC_RCBA_BA_MASK,
  351. &lpc->rbca_mem, 1);
  352. }
  353. }
  354. static int ich9_lpc_post_load(void *opaque, int version_id)
  355. {
  356. ICH9LPCState *lpc = opaque;
  357. ich9_lpc_pmbase_update(lpc);
  358. ich9_lpc_rcba_update(lpc, 0 /* disabled ICH9_LPC_RBCA_EN */);
  359. return 0;
  360. }
  361. static void ich9_lpc_config_write(PCIDevice *d,
  362. uint32_t addr, uint32_t val, int len)
  363. {
  364. ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
  365. uint32_t rbca_old = pci_get_long(d->config + ICH9_LPC_RCBA);
  366. pci_default_write_config(d, addr, val, len);
  367. if (ranges_overlap(addr, len, ICH9_LPC_PMBASE, 4)) {
  368. ich9_lpc_pmbase_update(lpc);
  369. }
  370. if (ranges_overlap(addr, len, ICH9_LPC_RCBA, 4)) {
  371. ich9_lpc_rcba_update(lpc, rbca_old);
  372. }
  373. if (ranges_overlap(addr, len, ICH9_LPC_PIRQA_ROUT, 4)) {
  374. pci_bus_fire_intx_routing_notifier(lpc->d.bus);
  375. }
  376. if (ranges_overlap(addr, len, ICH9_LPC_PIRQE_ROUT, 4)) {
  377. pci_bus_fire_intx_routing_notifier(lpc->d.bus);
  378. }
  379. }
  380. static void ich9_lpc_reset(DeviceState *qdev)
  381. {
  382. PCIDevice *d = PCI_DEVICE(qdev);
  383. ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
  384. uint32_t rbca_old = pci_get_long(d->config + ICH9_LPC_RCBA);
  385. int i;
  386. for (i = 0; i < 4; i++) {
  387. pci_set_byte(d->config + ICH9_LPC_PIRQA_ROUT + i,
  388. ICH9_LPC_PIRQ_ROUT_DEFAULT);
  389. }
  390. for (i = 0; i < 4; i++) {
  391. pci_set_byte(d->config + ICH9_LPC_PIRQE_ROUT + i,
  392. ICH9_LPC_PIRQ_ROUT_DEFAULT);
  393. }
  394. pci_set_byte(d->config + ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_DEFAULT);
  395. pci_set_long(d->config + ICH9_LPC_PMBASE, ICH9_LPC_PMBASE_DEFAULT);
  396. pci_set_long(d->config + ICH9_LPC_RCBA, ICH9_LPC_RCBA_DEFAULT);
  397. ich9_cc_reset(lpc);
  398. ich9_lpc_pmbase_update(lpc);
  399. ich9_lpc_rcba_update(lpc, rbca_old);
  400. lpc->sci_level = 0;
  401. }
  402. static const MemoryRegionOps rbca_mmio_ops = {
  403. .read = ich9_cc_read,
  404. .write = ich9_cc_write,
  405. .endianness = DEVICE_LITTLE_ENDIAN,
  406. };
  407. static void ich9_lpc_machine_ready(Notifier *n, void *opaque)
  408. {
  409. ICH9LPCState *s = container_of(n, ICH9LPCState, machine_ready);
  410. uint8_t *pci_conf;
  411. pci_conf = s->d.config;
  412. if (isa_is_ioport_assigned(0x3f8)) {
  413. /* com1 */
  414. pci_conf[0x82] |= 0x01;
  415. }
  416. if (isa_is_ioport_assigned(0x2f8)) {
  417. /* com2 */
  418. pci_conf[0x82] |= 0x02;
  419. }
  420. if (isa_is_ioport_assigned(0x378)) {
  421. /* lpt */
  422. pci_conf[0x82] |= 0x04;
  423. }
  424. if (isa_is_ioport_assigned(0x3f0)) {
  425. /* floppy */
  426. pci_conf[0x82] |= 0x08;
  427. }
  428. }
  429. static int ich9_lpc_initfn(PCIDevice *d)
  430. {
  431. ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
  432. ISABus *isa_bus;
  433. isa_bus = isa_bus_new(&d->qdev, get_system_io());
  434. pci_set_long(d->wmask + ICH9_LPC_PMBASE,
  435. ICH9_LPC_PMBASE_BASE_ADDRESS_MASK);
  436. memory_region_init_io(&lpc->rbca_mem, &rbca_mmio_ops, lpc,
  437. "lpc-rbca-mmio", ICH9_CC_SIZE);
  438. lpc->isa_bus = isa_bus;
  439. ich9_cc_init(lpc);
  440. apm_init(d, &lpc->apm, ich9_apm_ctrl_changed, lpc);
  441. lpc->machine_ready.notify = ich9_lpc_machine_ready;
  442. qemu_add_machine_init_done_notifier(&lpc->machine_ready);
  443. return 0;
  444. }
  445. static const VMStateDescription vmstate_ich9_lpc = {
  446. .name = "ICH9LPC",
  447. .version_id = 1,
  448. .minimum_version_id = 1,
  449. .minimum_version_id_old = 1,
  450. .post_load = ich9_lpc_post_load,
  451. .fields = (VMStateField[]) {
  452. VMSTATE_PCI_DEVICE(d, ICH9LPCState),
  453. VMSTATE_STRUCT(apm, ICH9LPCState, 0, vmstate_apm, APMState),
  454. VMSTATE_STRUCT(pm, ICH9LPCState, 0, vmstate_ich9_pm, ICH9LPCPMRegs),
  455. VMSTATE_UINT8_ARRAY(chip_config, ICH9LPCState, ICH9_CC_SIZE),
  456. VMSTATE_UINT32(sci_level, ICH9LPCState),
  457. VMSTATE_END_OF_LIST()
  458. }
  459. };
  460. static void ich9_lpc_class_init(ObjectClass *klass, void *data)
  461. {
  462. DeviceClass *dc = DEVICE_CLASS(klass);
  463. PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
  464. dc->reset = ich9_lpc_reset;
  465. k->init = ich9_lpc_initfn;
  466. dc->vmsd = &vmstate_ich9_lpc;
  467. dc->no_user = 1;
  468. k->config_write = ich9_lpc_config_write;
  469. dc->desc = "ICH9 LPC bridge";
  470. k->vendor_id = PCI_VENDOR_ID_INTEL;
  471. k->device_id = PCI_DEVICE_ID_INTEL_ICH9_8;
  472. k->revision = ICH9_A2_LPC_REVISION;
  473. k->class_id = PCI_CLASS_BRIDGE_ISA;
  474. }
  475. static const TypeInfo ich9_lpc_info = {
  476. .name = TYPE_ICH9_LPC_DEVICE,
  477. .parent = TYPE_PCI_DEVICE,
  478. .instance_size = sizeof(struct ICH9LPCState),
  479. .class_init = ich9_lpc_class_init,
  480. };
  481. static void ich9_lpc_register(void)
  482. {
  483. type_register_static(&ich9_lpc_info);
  484. }
  485. type_init(ich9_lpc_register);