Universal DSDT Patches for AM5 Boards, take 2
Here is a
single set of nine ACPI patches which should enable conditional devices in all AM5 motherboards (at least as far as I can check with my little collection of tables from forum contributions).
The v2 set replaces the original set (#1-3), the extended set (#1-7) and the alternate set (#1a, 3a) for MSI/AsRock.
Not all patches will apply to any single motherboard (it's either #1 or #1a, #3 or #3a), OpenCore shall just find out the applicable ones. It is quite possible that some or all of patches #4-7 in the v1 extended set are not necessary or useful (in particular, #5 and #6 target the second chipset of X670/X870 boards, which is absent from B650/B850 boards), but reports suggest that they do no harm.
What has changed?
The search pattern for #1, #1a, #3 and #3a has been extended by the final OpCode 10 ("Scope") to mark the end of the conditional statement. This OpCode is NOT patched (both Replace and ReplaceMask ensure this—belt and suspenders).
Analysing further DSDT made me realise that the main cause of possible confusion when searching for the applicable set of patches in DSDT.AML was that the pattern for patch #1 (G002 != 0x03 && G000 == One) is also found in larger sets of conditions which are the subject of other patches. More context is required to disambiguate. The single OpCode "10" (Scope) just after the condition provides just enough context to produce a search string that is unique in the enitre DSDT. It is then possible to have both alternative patches #1 and #1a in a single set: Only one shall apply.
Same for #3 and #3a.
Patches #2, #4, #5, #6 and #7 are unchanged from the previous sets, but I have added the "AM5v2" moniker for consistency, and generally changed the comments to the (main) device that is unlocked instead of the conditional statement in the DSDT—that seems friendlier.
If you're using one of the v1 sets and are happy with it, just keep it: This is not an "upgrade" in functionality, only in simplicity.
Checking against the DSDT
Checking with a hex editor in DSDT.AML is advisable, but not necessary.
| patch | search for (and then look for 'A0' before) | expected outcome
(padding bytes) |
| #1, UP00 | 90 92934730 30320A03 93473030 300110 | unique (2 or 3) |
| #2, RHUB | 90 92934730 30320A03 90934730 30300192 93473030 340C2210 FA43 | unique (2) |
| #3, XH00 | 90 92934730 30320A03 93473030 300A0210 | unique (2 or 3) |
| #4, NV00 | 90 92934730 30320A03 90934730 30300192 93473030 320A | three (2) |
| #5, 2nd chipset | 90 90929347 3030320A 03934730 30300190 92934730 30320A04 92934730 303300 | unique (2) |
| #6, 2nd EP00 | 90 90929347 3030320A 03934730 30300190 92934730 30320A04 90929347 3030320A 07929347 30303300 | unique (2) |
| #7, EP00 | 90 90929347 3030320A 03934730 30300190 92934730 30320A04 93473030 3300 | unique (2) |
Actual patches also search for 'A0' ("If") and some padding bytes (SearchMask) before the patterns in the table.
#1 and #3 look for two bytes, #1a and #3a for three: Only on in each pair shall apply to any given DSDT, so OpenCore should report that (at most) 7 out of the 9 patches are applied. All other patches look for 'A0xxxx' before the pattern in the table
As explained in a previous post, #4 patches to declare two NV00 devices and one _PRW package. That seemed simpler than having diffrent patches. (A finer bit mask could enable just the devices, but _PRW seems useful. so why not as well?)
Maybe it is not so complicated after all?