mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
Fix loading to run some utiles that do not require cfg/driver
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
This commit is contained in:
@@ -135,20 +135,21 @@ class CoreConfig(BaseConfigParser):
|
||||
if 'did' in dev_attr:
|
||||
for did in dev_attr['did']:
|
||||
did_str = self.cfg._make_hex_key_str(did)
|
||||
if did_str in self.cfg.CONFIG_PCI_RAW[vid_str]:
|
||||
if vid_str in self.cfg.CONFIG_PCI_RAW and did_str in self.cfg.CONFIG_PCI_RAW[vid_str]:
|
||||
pci_data = self.cfg.CONFIG_PCI_RAW[vid_str][did_str]
|
||||
self._add_dev(vid_str, dev_name, pci_data, dev_attr)
|
||||
device_added = True
|
||||
break
|
||||
else:
|
||||
for did_str in self.cfg.CONFIG_PCI_RAW[vid_str]:
|
||||
pci_data = self.cfg.CONFIG_PCI_RAW[vid_str][did_str]
|
||||
|
||||
if dev_attr['bus'] in pci_data['bus'] and dev_attr['dev'] == pci_data['dev'] and \
|
||||
dev_attr['fun'] == pci_data['fun']:
|
||||
self._add_dev(vid_str, dev_name, pci_data, dev_attr)
|
||||
device_added = True
|
||||
break
|
||||
if vid_str in self.cfg.CONFIG_PCI_RAW:
|
||||
for did_str in self.cfg.CONFIG_PCI_RAW[vid_str]:
|
||||
pci_data = self.cfg.CONFIG_PCI_RAW[vid_str][did_str]
|
||||
|
||||
if dev_attr['bus'] in pci_data['bus'] and dev_attr['dev'] == pci_data['dev'] and \
|
||||
dev_attr['fun'] == pci_data['fun']:
|
||||
self._add_dev(vid_str, dev_name, pci_data, dev_attr)
|
||||
device_added = True
|
||||
break
|
||||
if not device_added:
|
||||
self._add_dev(vid_str, dev_name, None, dev_attr)
|
||||
|
||||
|
||||
+2
-2
@@ -120,7 +120,7 @@ class Chipset:
|
||||
# platform detection
|
||||
|
||||
# get cpuid only if driver using driver (otherwise it will cause problems)
|
||||
self.cpuid = None
|
||||
self.cpuid = 0
|
||||
if start_helper:
|
||||
self.load_helper(helper_name)
|
||||
self.start_helper()
|
||||
@@ -133,7 +133,7 @@ class Chipset:
|
||||
if not ignore_platform:
|
||||
self.Cfg.platform_detection(platform_code, req_pch_code, self.cpuid)
|
||||
_unknown_proc = not bool(self.Cfg.get_chipset_code())
|
||||
if self.Cfg.is_pch_req() == False or self.Cfg.get_pch_code() != CHIPSET_CODE_UNKNOWN:
|
||||
if self.Cfg.is_pch_req() is False or self.Cfg.get_pch_code() != CHIPSET_CODE_UNKNOWN:
|
||||
_unknown_pch = False
|
||||
if _unknown_proc:
|
||||
msg = f'Unknown Platform: VID = 0x{self.Cfg.vid:04X}, DID = 0x{self.Cfg.did:04X}, RID = 0x{self.Cfg.rid:02X}, CPUID = 0x{self.cpuid:X}'
|
||||
|
||||
+1
-1
@@ -222,7 +222,7 @@ class Cfg:
|
||||
else:
|
||||
for did in sku['did']:
|
||||
did_str = self._make_hex_key_str(did)
|
||||
if did_str in self.CONFIG_PCI_RAW[vid_str]:
|
||||
if vid_str in self.CONFIG_PCI_RAW and did_str in self.CONFIG_PCI_RAW[vid_str]:
|
||||
return did
|
||||
return 0xFFFF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user