diff --git a/Changelog.md b/Changelog.md index fdacb8869c14d6bfe4448955c45324423c9d037f..0b77fdd562dafa6eabf125073768a76e6fc9d7c4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -17,6 +17,7 @@ OpenCore Changelog - Fixed intermittent 32-bit prelinking failures caused by improper Mach-O expansion - Fixed failures in cacheless injection dependency resolution - Fixed detection issues with older Atom CPUs +- Fixed `ScanPolicy` NVMe handling on MacPro5,1 #### v0.6.2 - Updated builtin firmware versions for SMBIOS and the rest diff --git a/Include/Acidanthera/Library/OcDevicePathLib.h b/Include/Acidanthera/Library/OcDevicePathLib.h index fd8215b01ef447ee4f252ab709173876ef88267d..cb69dee1a995ae71e322f4f3e7894c929fdd48b5 100755 --- a/Include/Acidanthera/Library/OcDevicePathLib.h +++ b/Include/Acidanthera/Library/OcDevicePathLib.h @@ -15,6 +15,14 @@ #ifndef OC_DEVICE_PATH_LIB_H #define OC_DEVICE_PATH_LIB_H +/** + Apple MacPro5,1 includes NVMe driver, however, it contains a typo in MSG_SASEX_DP. + Instead of 0x16 aka 22 (SasEx) it uses 0x22 aka 34 (Unspecified). + Here we replace it with the "right" value. + Reference: https://forums.macrumors.com/posts/28169441. +**/ +#define MSG_APPLE_NVME_NAMESPACE_DP 0x22 + /** Append file name to device path. diff --git a/Library/OcBootManagementLib/PolicyManagement.c b/Library/OcBootManagementLib/PolicyManagement.c index e0582146be7ca9489a520d9c2ab8b6e9ed3465d1..a37d629a1f0c7c4aed12940c448e964e824d6929 100644 --- a/Library/OcBootManagementLib/PolicyManagement.c +++ b/Library/OcBootManagementLib/PolicyManagement.c @@ -80,6 +80,7 @@ OcGetDevicePolicyType ( return OC_SCAN_ALLOW_DEVICE_SASEX; case MSG_SCSI_DP: return OC_SCAN_ALLOW_DEVICE_SCSI; + case MSG_APPLE_NVME_NAMESPACE_DP: case MSG_NVME_NAMESPACE_DP: return OC_SCAN_ALLOW_DEVICE_NVME; case MSG_ATAPI_DP: diff --git a/Library/OcDevicePathLib/OcDevicePathLib.c b/Library/OcDevicePathLib/OcDevicePathLib.c index a9b471c398e6f8209eec9c34fe8160cbbcca220e..d0c6c11df68dd8aa09fb8d4129c59cb418899962 100755 --- a/Library/OcDevicePathLib/OcDevicePathLib.c +++ b/Library/OcDevicePathLib/OcDevicePathLib.c @@ -484,16 +484,13 @@ OcFixAppleBootDevicePathNode ( case MSG_NVME_NAMESPACE_DP: // - // Apple MacPro5,1 includes NVMe driver, however, it contains a typo in MSG_SASEX_DP. - // Instead of 0x16 aka 22 (SasEx) it uses 0x22 aka 34 (Unspecified). - // Here we replace it with the "right" value. - // Reference: https://forums.macrumors.com/posts/28169441. + // Workaround for MacPro5,1 using custom NVMe type. // if (RestoreContext != NULL) { RestoreContext->Types.SasExNvme.SubType = Node.DevPath->SubType; } - Node.NvmeNamespace->Header.SubType = 0x22; + Node.NvmeNamespace->Header.SubType = MSG_APPLE_NVME_NAMESPACE_DP; return 1; default: