AMD Rayon R7 5800H Install Monterey kernel Panic

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Hello everyone, the Monterey kernel panic problem has been solved for AMD R7 5800H notebook installation. It is a great thing that the CPU can now run on 8 cores. Thank you guys very much.Thank them for discovering the problem and providing kernel patches @ExtremeX@Visual

Brand: Lenovo
Model: Legion 5 6th Gen
CPU: AMD Ryzen 7 5800h
GPU: AMD Radeon RX 6600m 8GB ( Separate GPU mode)
HDD: Samsung SSD 970 EVO Plus 1TB (1000 GB, PCI-E 3.0 x4)
WDS500G3X0C-00SJG0 (500 GB, PCI-E 3.0 x4)
Network: RealTek Semiconductor RTL8168/8111 PCI-E Gigabit Ethernet NIC
Intel(R) Wi-Fi 6E AX210 160MHz
Ram: x2 8GB 3200mhz ddr4
Display: 15.6 1080p 165HZ

Updated October 5, 2023
Problems solved:
1. You do not need to disable XHCI
2. The microphone problem is rectified
3. Monitor brightness can be adjusted, only in Ventura

Unresolved issues:
Failure to wake from sleep

 

Attachments

  • EFI-2023-10-5.zip
    40 MB · Views: 148
Last edited:
Solution
Panic from Monterey 12.6
View attachment 7258
Thanks. I looked at the sched_prim.c file in the XNU Kernel source code (nice of Apple to let us know exactly where to search) and found that it's related to the TSC (Time Stamp Counter) Syncronization of the CPU cores. The section of the code which gives the panic is: https://github.com/apple-oss-distributions/xnu/blob/xnu-8020.140.41/osfmk/kern/sched_prim.c#L2836
Unfortunately Apple didn't update the XNU Source Code for macOS 12.6 yet, but I still managed to find the place where it calls the panic.
Image 1 is the code of XNU that panics if the time between cores does not match (not syncronized properly).

As seen when comparing the Big Sur and Monterey code (Image 2), Big Sur...

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
The EFI I provided didn't contain the cpus=1 boot argument, As I wanted to see what would happen without it.

This error in the screenshot you provided show an issue with two of the ACPI tables in the laptop. SSDT11.aml and SSDT12.aml. The two tables are identical and both call the SRFZ name.

Screenshot 2022-06-26 at 13.03.43.png


Screenshot 2022-06-26 at 13.07.13.png SSDT11.aml

Screenshot 2022-06-26 at 13.06.43.png SSDT12.aml

There is also an issue with the ECEnabler.kext I used in the EFI.

Screenshot 2022-06-26 at 13.04.00.png

Proposed fixes:
Removing/dropping one of the two SSDT's in the OC config.plist, SSDT12.aml, should fix the SRFZ namespace issue. I will add this to the ACPI/Delete section.

Screenshot 2022-06-26 at 13.19.21.png Drop/Delete SSDT12.aml table entry in config.plist
OemTableID taken from SSDT12.aml - "CB-01 " (including the three spaces after 01)
TableSignature taken from SSDT12.aml - "SSDT"
ID and signature have been converted from Text to HEX

Screenshot 2022-06-26 at 13.21.35.png SSDT Header information used for drop table entry

Removing the ECEnabler.kext should fix the other issue shown in the verbose text.

The only issue with removing the ECEnabler.kext is that the laptop's battery won't work at its best. So we may need to look in to creating an SSDT-Bat.aml to fix the battery. But that can wait.

I have swapped the SSDT-CPUR-5800H-3.aml for the latest SSDT-CPUR-5800H.aml posted by @zxc2689963.

Revised EFI is attached for someone to try.
 

Attachments

  • EFI 2.zip
    33.4 MB · Views: 11

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
Here is another EFI v3, this one contains the cpus=1 boot argument along with the changes made to the EFI folder above.

Just to see what difference it makes.
 

Attachments

  • EFI 3.zip
    33.4 MB · Views: 4

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I didn't forget about everybody, I am trying to get the older version of Big Sur downloaded to get installed...
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
The EFI I provided didn't contain the cpus=1 boot argument, As I wanted to see what would happen without it.

This error in the screenshot you provided show an issue with two of the ACPI tables in the laptop. SSDT11.aml and SSDT12.aml. The two tables are identical and both call the SRFZ name.

View attachment 6381


View attachment 6378 SSDT11.aml

View attachment 6377 SSDT12.aml

There is also an issue with the ECEnabler.kext I used in the EFI.

View attachment 6382

Proposed fixes:
Removing/dropping one of the two SSDT's in the OC config.plist, SSDT12.aml, should fix the SRFZ namespace issue. I will add this to the ACPI/Delete section.

View attachment 6383 Drop/Delete SSDT12.aml table entry in config.plist
OemTableID taken from SSDT12.aml - "CB-01 " (including the three spaces after 01)
TableSignature taken from SSDT12.aml - "SSDT"
ID and signature have been converted from Text to HEX

View attachment 6384 SSDT Header information used for drop table entry

Removing the ECEnabler.kext should fix the other issue shown in the verbose text.

The only issue with removing the ECEnabler.kext is that the laptop's battery won't work at its best. So we may need to look in to creating an SSDT-Bat.aml to fix the battery. But that can wait.

I have swapped the SSDT-CPUR-5800H-3.aml for the latest SSDT-CPUR-5800H.aml posted by @zxc2689963.

Revised EFI is attached for someone to try.
As with my original EFI, if cpus=1 is not used, there will be kernel Panic. If cpus=1 is used, as shown in the figure, genericusbxhci.kext is required to enter the system
 

Attachments

  • 66.jpg
    66.jpg
    269.7 KB · Views: 9
  • 67.jpg
    67.jpg
    278.3 KB · Views: 10

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
I've seen people say that his AMDCPU doesn't support tsc_adjust and can start Monterey, which may not be necessary, and there are other issues affecting it. I saw that when cpus=1 started, Hyper-Threading Technology was deactivated, and I was trying to get CPU 8 cores to deactivate Hyper-Threading Technology when it started, which may be the key
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
I've seen people say that his AMDCPU doesn't support tsc_adjust and can start Monterey, which may not be necessary, and there are other issues affecting it. I saw that when cpus=1 started, Hyper-Threading Technology was deactivated, and I was trying to get CPU 8 cores to deactivate Hyper-Threading Technology when it started, which may be the key
In that case you should try to enable Hyperthreading and turn off cpus=1 and see what happens.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
@OG Nerd Please give this a go.
Shaneee's EFI got me into Big Sur that I already installed V. 11.6.5, however the usb mouse and keyboard are VERY laggy, pretty much unusable BUT does boot into mac os Big Sur...


Here's mine. Using Shanee's updated EFI as base, I've added a new updated CPUR based on the Legion 5's BIOS dump, plus the device id for the RX6600M.
On yours middleman, it starts to boot but hangs right where it switches from verbose logging into the apple loading menu, hiding whatever logged error it freezes on, I am suspecting this has something to do with the graphics PCIE properties in the config.plist... I will try removing it and seeing if I can get past it.


@OG Nerd I have attached an OC 0.8.1 EFI folder for your Legion 5 laptop. I have gone a bit left field with this EFI as I am treating your laptop as a laptop, not an iMacPro or MacPro.

I have looked at the DSDT.aml tables provided by users from post #1, 14 and another later post.
I have inspected the DSDT.aml and other SSDT's provided and come up with what I hope are a few helpful solutions.

There are a few notable items that appear in the DSDT.aml table.
  1. Graphics card is named VGA, not GFX0, - so WhateverGreen.kext would never match with the VGA device.
  2. Processor is named C000 - C00F inclusive, not PR01 etc.
  3. USB controllers are named XHC0 and XHC1
  4. The Trackpad appears to be an ELAN I2C device found under _SB/PCI0/I2CB/TPDD
To remedy the above I have done the following:
  1. Used the DSDT.aml table provided in post #1 with Corpnewt's SSDTTime script to generate the following SSDT's and config.plist patches
    1. SSDT-EC.aml
    2. SSDT-HPET.aml + 3 x ACPI patches
    3. SSDT-USB-Reset.aml
  2. I have also added the following tables
    1. SSDT-CPUR-5800H-3.aml [provided by @Middleman) as this uses the correct naming convention for your CPU processor entries
    2. SSDT-USBX.aml for USB power settings
    3. SSDT-XOSI.aml + ACPI rename patch
  3. The Drivers and Tools folders I have set as standard for an OC 0.8.1 AMD setup.
  4. The kexts folder has been reconfigured to reflect this device is a LAPTOP.
    1. I have included the kexts shown in the screenshot below:
    2. View attachment 6344 /EFI/OC/Kexts folder contents
    3. Laptop specific kexts:
      1. BrightnessKeys.kext - Brightness fix
      2. ECEnabler.kext - Battery fix
      3. NoTouchID.kext - Touch ID fix
      4. SMCBatteryManager.kext - battery fix
      5. VoodooI2C.kext - HID fix
      6. VoodooI2CELAN.kext - fix for Elan Touchpad
      7. VoodooI2CHID.kext - HID fix
      8. VoodooPS2Controller.kext - Keyboard and Trackpad fix - with Mouse kext disabled in config.plist
  5. Regarding the config.plist I have used the following:
    1. I have used the SMBIOS from a MacBookPro16,4 not an iMP or MP, as this is a LAPTOP not a desktop system.
    2. I have added a number of ACPI Rename patches for USB, GPU, HPET and _OSI
    3. I have followed the setup for a Ryzen system, mostly. With a few changes to the basic setup that are more inline with a laptop setup.
This is how the EFI tree looks in expanded mode:

View attachment 6345 EFI OC 0.8.1 folder contents

The config.plist in the OC folder has the SMBIOS data redacted, so you need to generate and add the MacBookPro16,4 SMBIOS data yourself; Serial Number, MLB, ROM and SystemUUID.

You need to use the ResetNvramEntry.efi tool (press SpaceBar to display tools) before trying to boot with this EFI. So as to clear any existing Nvram settings, otherwise your system may not work with this EFI.

Post a photo of the Verbose text if it kernel panics.
I did as suggested, but on yours it hangs at [PCI Configuration Begin] Even after resetting NVRam.

If each of you guys would like to respond, I will try all your suggestions.... I still do not have an earlier version of Big Sur, for some reason I am having trouble making an installer with the older version of Big Sur, I tried Install Disk Creator, AnyMac OS Create Media, Disk Drill Install Disk Maker, they all error out saying something wrong with the USB Drive, however, I can reformat and install a newer version of Big Sur & Monterey on the USB Drive with no issues. I even tried another USB drive with same errors.

IMG_0279.jpeg
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
@zxc2689963 I don't know why this section of verbose text mentions an ALPS controller. The Trackpad is an ELAN device. The kext I provided was for an Elan trackpad.

Screenshot 2022-06-28 at 14.21.31.png ALPS device not present error.

Did you change the VoodooI2CELAN.kext for the VoodooI2CALPS.kext?

Immediately above the ALPS error is an issue with the ApplePS2Controller.kext being present. If possible this kext needs to be removed from macOS or the installer, for the VoodooPS2Controller.kext to work, otherwise a clash occurs and VoodooPS2Controller won't be used.

We may need to use ApplePS2SmartTouchpad.kext in place of VoodooPS2Controller.kext, or an even older kext ApplePS2ELANTouchpad.kext. Both are attached below, if someone wants to try using either or both,

Don't try both at the same time.
 

Attachments

  • ELAN_v4.0.5.zip
    91.6 KB · Views: 2
  • SmartTouchpad v4.7 beta 5.zip
    355.7 KB · Views: 3

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
The 'PCI Configuration Begins' error is a common one for Intel systems.

Unfortunately it has a number of possible causes. As explained in the OC Troubleshooting guide section linked below.

# PCI Configuration Begins error

I will have a look at the EFI again and also take a look at the EFI @Shaneee provided, to see what I messed up!
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
Do you have 'Above 4G Decoding' enabled in your bios?

If yes, the cause of the PCI Configuration Begins error might be due to me adding the 'npci=0x2000' boot argument to the config.plist. as the two should not be used together.

I have removed the npci=02000 and cpus=1 boot arguments from the attached EFI.

There is no Serial or other SMBIOS data in the config.plist, to it needs to be added before using this EFI.
 

Attachments

  • EFI 4.zip
    33.4 MB · Views: 3

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
The 'PCI Configuration Begins' error is a common one for Intel systems.

Unfortunately it has a number of possible causes. As explained in the OC Troubleshooting guide section linked below.

# PCI Configuration Begins error

I will have a look at the EFI again and also take a look at the EFI @Shaneee provided, to see what I messed up!
The bios of this does not have an Above 4G decoding, but on Shaneees he does not have the npci=02000 boot arg, but he also chose the ImacPro1,1 symbios.

So far zxc2689963's EFI from post #98 responds the most under Big Sur.... I am working on making the Installer for the older version of Big Sur and will try to get a dump from it using his efi at least...
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I am about to reformat and install using a modified EFI that I made starting from zxc2689963's EFI.... His so far responds the best in Big sur and the USB ports work, it just does not have proper wireless (using realtek nic for now) nor sound. I am not too worried about those things yet, I just want to get a ioreg dump. On this EFI I am posting here, what should I do to enable all usb ports to make ioreg dump?


I did an ioreg dump of what I have right now...
 

Attachments

  • EFI.zip
    32.7 MB · Views: 5
  • Legion 5 Big Sur 11_6_2.zip
    548.8 KB · Views: 6

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,142
How many ports are on the laptop? I count 11 on that IOReg but that includes internal ones like the webcam and BT.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
How many ports are on the laptop? I count 11 on that IOReg but that includes internal ones like the webcam and BT.
There are 6 external, (2 are USB-C)

In the meantime, I created a DDST out of SSDTTIME and remade my usb. port mappings using USB toolbox in Windows. Now when I boot into 11.6.2 it freezes at the following.... wondering if I missed something, I have UTMap.kext and USBToolbox.kext installed.

IMG_0232.jpeg
 

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,142
Out of curiosity try this. It's not ideal as it simply sets all ports as 3.0 but should work for the time being.
 

Attachments

  • USBMap.kext.zip
    2 KB · Views: 3

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
The IOReg you posted above shows there are 6 x ports on XHC0 and 6 x ports on XHC1.

Screenshot 2022-06-30 at 22.29.56.png XHC0 & XHC1 USB controllers.

The XHC1 controller is likely to clash/try to match with the native Apple USB controller. So it might be wise to use a rename patch to prevent this clash.

XHC0:
PRT2 is a USB2 hub, should be set as USB2 (0)
PRT3 is the Webcam, should be set as Internal (255)
PRT4 is an internal port for the ITE device, should be set as Internal (255)
PRT6 is a USB3 hub, should be set as USB3 (3)
PRT1 & PRT5 don't have anything attached so haven't a clue what type to set those two ports.

XHC1:
HS04 is the Bluetooth module, should be set as Internal (255).
No idea what type the other 5 ports require, i.e. HS01, HS02, HS03, HS05 and HS06.

That is half of the ports identified.

This information has been incorporated in to the attached USBMAp2.kext below.
 

Attachments

  • USBMap2.kext.zip
    2.8 KB · Views: 3

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Out of curiosity try this. It's not ideal as it simply sets all ports as 3.0 but should work for the time being.
The IOReg you posted above shows there are 6 x ports on XHC0 and 6 x ports on XHC1.

View attachment 6432 XHC0 & XHC1 USB controllers.

The XHC1 controller is likely to clash/try to match with the native Apple USB controller. So it might be wise to use a rename patch to prevent this clash.

XHC0:
PRT2 is a USB2 hub, should be set as USB2 (0)
PRT3 is the Webcam, should be set as Internal (255)
PRT4 is an internal port for the ITE device, should be set as Internal (255)
PRT6 is a USB3 hub, should be set as USB3 (3)
PRT1 & PRT5 don't have anything attached so haven't a clue what type to set those two ports.

XHC1:
HS04 is the Bluetooth module, should be set as Internal (255).
No idea what type the other 5 ports require, i.e. HS01, HS02, HS03, HS05 and HS06.

That is half of the ports identified.

This information has been incorporated in to the attached USBMAp2.kext below.


Ok, I will try these tomorrow… Edhawk, on your usbmap2.kext, should I try it with the efi that functions the best?
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
Yes, Use the best functioning EFI.
 
Top Bottom
  AdBlock Detected
Sure, ad-blocking software does a great job at blocking ads, but it also blocks some useful and important features of our website. For the best possible site experience please take a moment to disable your AdBlocker.