MCPcopy Create free account
hub / github.com/coreboot/coreboot / intel_mei_setup

Function intel_mei_setup

util/intelmetool/src/me.c:566–595  ·  view source on GitHub ↗

Prepare ME for MEI messages */

Source from the content-addressed store, hash-verified

564
565/* Prepare ME for MEI messages */
566uint32_t intel_mei_setup(struct pci_dev *dev)
567{
568 struct mei_csr host;
569 uint16_t reg16;
570 uint32_t pagerounded;
571
572 mei_base_address = dev->base_addr[0] & ~0xf;
573 pagerounded = mei_base_address & ~0xfff;
574 mei_mmap = map_physical(pagerounded, 0x2000);
575 mei_mmap += mei_base_address - pagerounded;
576 if (mei_mmap == NULL) {
577 printf("Could not map ME setup memory.\n"
578 "Do you have kernel cmdline argument 'iomem=relaxed' set ?\n");
579 return 1;
580 }
581
582 /* Ensure Memory and Bus Master bits are set */
583 reg16 = pci_read_word(dev, PCI_COMMAND);
584 reg16 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
585 pci_write_word(dev, PCI_COMMAND, reg16);
586
587 /* Clean up status for next message */
588 read_host_csr(&host);
589 host.interrupt_generate = 1;
590 host.ready = 1;
591 host.reset = 0;
592 write_host_csr(&host);
593
594 return 0;
595}
596
597/* Read the Extend register hash of ME firmware */
598int intel_me_extend_valid(struct pci_dev *dev)

Callers 1

dump_me_infoFunction · 0.70

Calls 6

printfFunction · 0.85
pci_read_wordFunction · 0.85
pci_write_wordFunction · 0.85
map_physicalFunction · 0.70
read_host_csrFunction · 0.70
write_host_csrFunction · 0.70

Tested by

no test coverage detected