黑苹果 新版 bios 引发 DSDT cpu 命名问题

2023-05-25 ⏳0.7分钟(0.3千字)

介绍了 EPC621D8A 的新版 bios 的 AML 里的 CPU 命名导致黑苹果无法启动问题.

缘起

手贱更新了主板的 BIOS 发现黑苹果无法启动了, 卡在了

ACPI:6 ACPI AML tables successfully acquired and loaded

知识预备

什么是 DSDT

什么是 ACPI

方案

第一反应去 google 找了找有没有案例, 发现别人都是因为 RTC Device 导致的, 而 RTC Device 多了个函数,而函数引用的变量没有初始化导致.

  1. 如果 BIOS 里有 System Time and Alarm Source 选项, 那么从 ACPI Time and Alarm Device 切换回 Legacy RTC 即可

  2. 如果没有这个选项只能调整 SSDT 打 Patch.

DefinitionBlock ("", "SSDT", 1, "HACK", "SET-STAS", 0x00000000)
{
        External (STAS, IntObj) // (from opcode)
        Scope (_SB)
        {
               Method (_INI, 0, NotSerialized) // _INI: Initialize
               {
                   STAS = One
                }
         }
}

对比了我的 dsdt.aml 发现 RTC 函数更新 BIOS 前后并没有变化。一怒之下 BeyondCompare 开始整活.

这里还发生了小插曲, 这块主板是服务器主板, dsdt 特别大, 代码有 60W+ 行, 编辑器打开都有点费劲.

发现 CPU 命名发生了变化, 从 Processor (CP00, 0x00, 0x00000510, 0x06) 变成了 Device (CP00). 起初有两个想法:

    External (_SB_.SCK0, DeviceObj)
    External (_SB_.SCK0.CP00._CPC, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._CST, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._MAT, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._OSC, MethodObj)    // 4 Arguments
    External (_SB_.SCK0.CP00._PCT, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._PDC, MethodObj)    // 1 Arguments
    External (_SB_.SCK0.CP00._PPC, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._PSD, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._PSS, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._PTC, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._PXM, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._TPC, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00._TSS, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00.CSTT, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00.HWPT, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00.ISTT, MethodObj)    // 0 Arguments
    External (_SB_.SCK0.CP00.TSTT, MethodObj)    // 0 Arguments

    Scope (_SB.SCK0)
    {
        Processor (PR00, 0x00, 0x00000510, 0x06)
        {
            Name (_HID, "ACPI0007" /* Processor Device */)  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Method (_PXM, 0, NotSerialized)  // _PXM: Device Proximity
            {
                Return (\_SB.SCK0.CP00._PXM ())
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (_OSI ("Darwin"))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_MAT, 0, NotSerialized)  // _MAT: Multiple APIC Table Entry
            {
                Return (\_SB.SCK0.CP00._MAT ())
            }

            If (CondRefOf (\_SB.SCK0.CP00._PPC))
            {
                Method (_PPC, 0, NotSerialized)  // _PPC: Performance Present Capabilities
                {
                    Return (\_SB.SCK0.CP00._PPC ())
                }
            }

            If (CondRefOf (\_SB.SCK0.CP00._PCT))
            {
                Method (_PCT, 0, NotSerialized)  // _PCT: Performance Control
                {
                    Return (\_SB.SCK0.CP00._PCT ())
                }
            }

            If (CondRefOf (\_SB.SCK0.CP00._PSS))
            {
                Method (_PSS, 0, NotSerialized)  // _PSS: Performance Supported States
                {
                    Return (\_SB.SCK0.CP00._PSS ())
                }
            }

            If (CondRefOf (\_SB.SCK0.CP00._CPC))
            {
                Method (_CPC, 0, NotSerialized)  // _CPC: Continuous Performance Control
                {
                    Return (\_SB.SCK0.CP00._CPC ())
                }
            }

            If (CondRefOf (\_SB.SCK0.CP00._TPC))
            {
                Method (_TPC, 0, NotSerialized)  // _TPC: Throttling Present Capabilities
                {
                    Return (\_SB.SCK0.CP00._TPC ())
                }
            }

            If (CondRefOf (\_SB.SCK0.CP00._PTC))
            {
                Method (_PTC, 0, NotSerialized)  // _PTC: Processor Throttling Control
                {
                    Return (\_SB.SCK0.CP00._PTC ())
                }
            }

            If (CondRefOf (\_SB.SCK0.CP00._TSS))
            {
                Method (_TSS, 0, NotSerialized)  // _TSS: Throttling Supported States
                {
                    Return (\_SB.SCK0.CP00._TSS ())
                }
            }

            If (CondRefOf (\_SB.SCK0.CP00._CST))
            {
                Method (_CST, 0, NotSerialized)  // _CST: C-States
                {
                    Return (\_SB.SCK0.CP00._CST ())
                }
            }

            Method (HWPT, 0, NotSerialized)
            {
                Return (\_SB.SCK0.CP00.HWPT ())
            }

            Method (ISTT, 0, NotSerialized)
            {
                Return (\_SB.SCK0.CP00.ISTT ())
            }

            Method (TSTT, 0, NotSerialized)
            {
                Return (\_SB.SCK0.CP00.TSTT ())
            }

            Method (CSTT, 0, NotSerialized)
            {
                Return (\_SB.SCK0.CP00.CSTT ())
            }

            Method (_PDC, 1, NotSerialized)  // _PDC: Processor Driver Capabilities
            {
                \_SB.SCK0.CP00._PDC (Arg0)
            }

            Method (_OSC, 4, NotSerialized)  // _OSC: Operating System Capabilities
            {
                Return (\_SB.SCK0.CP00._OSC (Arg0, Arg1, Arg2, Arg3))
            }

            Method (_PSD, 0, NotSerialized)  // _PSD: Power State Dependencies
            {
                Return (\_SB.SCK0.CP00._PSD ())
            }
        }
}

放到 OpenCore,进入系统~