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

Function mkhi_debug_me_memory

util/intelmetool/src/me.c:532–563  ·  view source on GitHub ↗

Enable debug of internal ME memory */

Source from the content-addressed store, hash-verified

530
531/* Enable debug of internal ME memory */
532int mkhi_debug_me_memory(void *physaddr)
533{
534 uint32_t data = 0;
535
536 /* copy whole ME memory to a readable space */
537 struct me_debug_mem memory = {
538 .debug_phys = (uintptr_t)physaddr,
539 .debug_size = 0x2000000,
540 .me_phys = 0x20000000,
541 .me_size = 0x2000000,
542 };
543 struct mkhi_header mkhi = {
544 .group_id = MKHI_GROUP_ID_GEN,
545 .command = GEN_SET_DEBUG_MEM,
546 .is_response = 0,
547 };
548 struct mei_header mei = {
549 .is_complete = 1,
550 .length = sizeof(mkhi) + sizeof(memory),
551 .host_address = MEI_HOST_ADDRESS,
552 .client_address = MEI_ADDRESS_MKHI,
553 };
554
555 printf("ME: Debug memory to 0x%zx ...", (size_t)physaddr);
556 if (mei_sendrecv(&mei, &mkhi, &memory, &data, 0) < 0) {
557 printf("failed\n");
558 return -1;
559 } else {
560 printf("done\n");
561 }
562 return 0;
563}
564
565/* Prepare ME for MEI messages */
566uint32_t intel_mei_setup(struct pci_dev *dev)

Callers 1

dump_me_memoryFunction · 0.85

Calls 2

printfFunction · 0.85
mei_sendrecvFunction · 0.70

Tested by

no test coverage detected