Disable L0 for NVMe drives

This commit is contained in:
Mykola Grymalyuk
2021-05-01 10:40:06 -06:00
parent 7209aa98d0
commit 6f1ed43f4e
3 changed files with 6 additions and 7 deletions

View File

@@ -144,9 +144,8 @@ class BuildOpenCore:
nvme_vendor = self.hexswap(binascii.hexlify(i["vendor-id"]).decode()[:4])
nvme_device = self.hexswap(binascii.hexlify(i["device-id"]).decode()[:4])
nvme_aspm = i["pci-aspm-default"]
# Check if 0x2 is already present. If not, append
if not nvme_aspm & 2:
nvme_aspm |= 2
# Disable Bit 1 (L0), enable Bit 2 (L1)
nvme_aspm = (nvme_aspm & (~3)) | 2
print(f'- Found 3rd Party NVMe SSD ({x}): {nvme_vendor}:{nvme_device}')
self.config["#Revision"][f"Hardware-NVMe-{x}"] = f'{nvme_vendor}:{nvme_device}'