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

Function intel_me_extend_valid

util/intelmetool/src/me.c:598–637  ·  view source on GitHub ↗

Read the Extend register hash of ME firmware */

Source from the content-addressed store, hash-verified

596
597/* Read the Extend register hash of ME firmware */
598int intel_me_extend_valid(struct pci_dev *dev)
599{
600 struct me_heres status;
601 uint32_t extend[8] = {0};
602 int i, count = 0;
603
604 pci_read_dword_ptr(dev, &status, PCI_ME_HERES);
605 if (!status.extend_feature_present) {
606 printf("ME: Extend Feature not present\n");
607 return -1;
608 }
609
610 if (!status.extend_reg_valid) {
611 printf("ME: Extend Register not valid\n");
612 return -1;
613 }
614
615 switch (status.extend_reg_algorithm) {
616 case PCI_ME_EXT_SHA1:
617 count = 5;
618 printf("ME: Extend SHA-1: ");
619 break;
620 case PCI_ME_EXT_SHA256:
621 count = 8;
622 printf("ME: Extend SHA-256: ");
623 break;
624 default:
625 printf("ME: Extend Algorithm %d unknown\n",
626 status.extend_reg_algorithm);
627 return -1;
628 }
629
630 for (i = 0; i < count; ++i) {
631 extend[i] = pci_read_long(dev, PCI_ME_HER(i));
632 printf("%08x", extend[i]);
633 }
634 printf("\n");
635
636 return 0;
637}

Callers 1

dump_me_infoFunction · 0.70

Calls 3

printfFunction · 0.85
pci_read_longFunction · 0.85
pci_read_dword_ptrFunction · 0.70

Tested by

no test coverage detected