Contribute
Register

A Beginner's Guide to Creating a Custom USB SSDT

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
5,358
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. iOS
Hi and Happy New Year!




Any ideas on my issue? Thanks in advance!

Okay ... I covered a little of this in my earlier post #637.

No, the "UsbConnector type" setting will not cause the problems you are seeing. Yes, you should choose the correct ones but we can get to that later.

The two EHCI controllers are EH01 and EH02. Attached to each of these is a hub - PR01 and PR12. From these hang the USB2 ports. For your chipset there are 8+6 as you can see in IOReg. These are USB2-only ports.

The only thing I can see wrong here is that both hubs are named "PR01". Why not "PR01" and "PR12"? PR12 is present as a hub but has no ports allocated to it. Something must be causing this and so far I can't see what that is.

As you say, the XHCI controller looks fine in your IOReg.

1) Show us what kexts you have installed in EFI/ and in Library/Extensions.

2) why choose system-definition iMacPro1,1 ?

:)
 
Joined
Jun 10, 2011
Messages
332
Motherboard
Gigabyte Z370 Aorus Ultra Gaming 2.0
CPU
i7 8700K
Graphics
2x RX580
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
1) Show us what kexts you have installed in EFI/ and in Library/Extensions.

2) why choose system-definition iMacPro1,1 ?

Hi!

1) Attached you have my EFI folder. There are many kexts but in my config.plist only the necessary ones are enabled depending on what I'm testing. Regarding Library/Extensions, I don't have access to the computer right now but I remember it has very little kexts, all Apple-related. I'll make a screenshot when possible.

2) It's a Sandy Bridge CPU with a 7 series motherboard. Around 2011 its natural sysdef was iMac12,2, but that one didn't support Mojave, so I switched to iMac14,2 to be able to use Mojave. In this last update to Big Sur I wasn't sure if iMac14,2 was supported so I switched once again to iMacPro1,1. CPU power management seems to be working well via SSDT.aml (lots of p-states via AppleIntelInfo.kext > Console) as well as sleep. Is there a better sysdef for this hardware that supports Big Sur? Should I change?

Thanks in advance!
 

Attachments

  • EFI-ultrazone.zip
    3.9 MB · Views: 6

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
5,358
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. iOS
Hi!

1) Attached you have my EFI folder. There are many kexts but in my config.plist only the necessary ones are enabled depending on what I'm testing. Regarding Library/Extensions, I don't have access to the computer right now but I remember it has very little kexts, all Apple-related. I'll make a screenshot when possible.

2) It's a Sandy Bridge CPU with a 7 series motherboard. Around 2011 its natural sysdef was iMac12,2, but that one didn't support Mojave, so I switched to iMac14,2 to be able to use Mojave. In this last update to Big Sur I wasn't sure if iMac14,2 was supported so I switched once again to iMacPro1,1. CPU power management seems to be working well via SSDT.aml (lots of p-states via AppleIntelInfo.kext > Console) as well as sleep. Is there a better sysdef for this hardware that supports Big Sur? Should I change?

Thanks in advance!

Thank you. That makes things much clearer.

Do you need a full DSDT.aml? That can override a lot of other patching. You say the SSDT.aml is for your CPU, so what does the DSDT do?

I doubt there is a better system-defiinition for the H77 as it was released in 2012. No real Mac with such an old chipset is upgradable to Big Sur, as far as I know.

You are correct, iMac14,2 is not supported in Big Sur. Recommend iMac17,1 or similar instead.

None of this, apart from the possible affects of a DSDT, should affect the EHCI controllers - this remains a mystery. Perhaps run Hackintool and show the USB panel.
 
Joined
Jun 10, 2011
Messages
332
Motherboard
Gigabyte Z370 Aorus Ultra Gaming 2.0
CPU
i7 8700K
Graphics
2x RX580
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
Thank you. That makes things much clearer.

Do you need a full DSDT.aml? That can override a lot of other patching. You say the SSDT.aml is for your CPU, so what does the DSDT do?

I doubt there is a better system-defiinition for the H77 as it was released in 2012. No real Mac with such an old chipset is upgradable to Big Sur, as far as I know.

You are correct, iMac14,2 is not supported in Big Sur. Recommend iMac17,1 or similar instead.

None of this, apart from the possible affects of a DSDT, should affect the EHCI controllers - this remains a mystery. Perhaps run Hackintool and show the USB panel.

My DSDT includes EH renames and USB properties injection, as well as injection of properties for other devices. I extracted the original DSDT via Clover and then applied MaciASL patches that are still available online for older mobos. If you want the original to compare, just let me know.

Regarding the most appropriate system definition, I read somewhere that iMac14,4 is supported in Big Sur so if I confirm that then probably I'll change to iMac14,4.

And about the USB part... just thought about a bad configuration of USB-related BIOS options... could that be the culprit? Right now I believe it is configured as "Auto" (not "Smart Auto") and the rest of the choices to "Enabled". I'll double check what are the actual settings (the ones I've used throughout the procedure) and I'll make a screenshot of USB @ Hackintool.

Once again, thanks a lot! Cheers from Spain!
 

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
5,358
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. iOS
My DSDT includes EH renames and USB properties injection, as well as injection of properties for other devices. I extracted the original DSDT via Clover and then applied MaciASL patches that are still available online for older mobos. If you want the original to compare, just let me know.

Regarding the most appropriate system definition, I read somewhere that iMac14,4 is supported in Big Sur so if I confirm that then probably I'll change to iMac14,4.

And about the USB part... just thought about a bad configuration of USB-related BIOS options... could that be the culprit? Right now I believe it is configured as "Auto" (not "Smart Auto") and the rest of the choices to "Enabled". I'll double check what are the actual settings (the ones I've used throughout the procedure) and I'll make a screenshot of USB @ Hackintool.

Once again, thanks a lot! Cheers from Spain!

I do not think the BIOS settings will cause the problems you have. As long as XHCI Handoff is Enabled, that is enough.

Because you are quite an advanced user, able to edit your own DSDT, I am not sure anything I can offer will help. However I'll keep going ... :)

First question - do you actually need the EHCI renames to start with? Did your H77 provide EHC1 and EHC2 as controller names before you created your DSDT? Worth double-checking with IORegistryExplorer.

The Renames are listed in the ACPI - Patch section of config.plist but are not enabled because you are relying on the physical DSDT.aml.

The cause for your PR01/PR12 hubs being out-of-line could be due to the DSDT, because the unnecessary kexts you have installed, which might cause this, have not actually been enabled. Something is responsible though and the only thing I can see is that DSDT.

Personally I think the set up is more complicated than it needs to be. I would remove all the surplus kexts and drivers, do without the full DSDT and patch instead. This would make troubleshooting much simpler.
 
Joined
Jun 10, 2011
Messages
332
Motherboard
Gigabyte Z370 Aorus Ultra Gaming 2.0
CPU
i7 8700K
Graphics
2x RX580
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
First question - do you actually need the EHCI renames to start with? Did your H77 provide EHC1 and EHC2 as controller names before you created your DSDT? Worth double-checking with IORegistryExplorer.

The Renames are listed in the ACPI - Patch section of config.plist but are not enabled because you are relying on the physical DSDT.aml.

The cause for your PR01/PR12 hubs being out-of-line could be due to the DSDT, because the unnecessary kexts you have installed, which might cause this, have not actually been enabled. Something is responsible though and the only thing I can see is that DSDT.

Personally I think the set up is more complicated than it needs to be. I would remove all the surplus kexts and drivers, do without the full DSDT and patch instead. This would make troubleshooting much simpler.

Hi again!

In response to your first question, I need the EHCI renames since the DSDT.aml extracted via Clover refers to the EHCI controllers as "EHC1" and "EHC2".

Following your advice I've disabled my DSDT.aml and enabled the Renames, and attached is the .ioreg file as well as the EFI folder used for this test.

Regarding excessive number of kexts: it is my understanding that it's not problematic to have several kexts under the Kexts folder, as long as you only enable the necessary ones. Correct me if I'm wrong please!

I mean, throughout the tests I've been doing, the kexts and .aml files are there, but that doesn't mean all of them are enabled in the config.plist.

Regarding sysdefs, iMac14,4 is supported by Big Sur but the processor is a dual core i5 (mine is a quad core i7), so maybe iMac15,1 (quad core i7) is a better choice. What do you think about it?

Thanks again!
 

Attachments

  • iMacPro - 05 - No DSDT.ioreg
    4.7 MB · Views: 5
  • EFI-ultrazone-NO DSDT.zip
    17.7 MB · Views: 5

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
5,358
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. iOS
Hi again!

In response to your first question, I need the EHCI renames since the DSDT.aml extracted via Clover refers to the EHCI controllers as "EHC1" and "EHC2".
Okay, that's fine :thumbup:

Following your advice I've disabled my DSDT.aml and enabled the Renames, and attached is the .ioreg file as well as the EFI folder used for this test.
That's great. We can now see that doing this - which is simpler and cleaner in my opinion - has made no difference to the output so I give that another ... :thumbup:

Regarding excessive number of kexts: it is my understanding that it's not problematic to have several kexts under the Kexts folder, as long as you only enable the necessary ones. Correct me if I'm wrong please!

I mean, throughout the tests I've been doing, the kexts and .aml files are there, but that doesn't mean all of them are enabled in the config.plist.
You are correct. And I mentioned this previously. But keeping the OC folder 'clean' makes it easier to spot potential problems if you are trouble-shooting. Obviously it is totally your choice to leave everything in the EFI. No problem.
Regarding sysdefs, iMac14,4 is supported by Big Sur but the processor is a dual core i5 (mine is a quad core i7), so maybe iMac15,1 (quad core i7) is a better choice. What do you think about it?
I think many builders spend too much effort trying to match their hardware to a real Mac. By doing this they often choose obscure or little-used system-definitions which throw up problems in other areas besides CPU power-management or GPU compatibility. Over the years there have been a few "Golden Ticket" definitions that have prooved very reliable both in booting a PC and keeping it reliable without crashing. Way back we used "MacPro3,1", then my favourite iMac14,2 however these are not Big Sur compatible. iMac17,1 is and in my opinion, a good, solid definition. (Take care experimenting as the Apple servers can get confused if you change too often. Best to disconnect from the Internet when you try different ones).

To help your PC power-manage the CPU you can use an SSDT. There are two main scripts used to create this. I'm sure you realise this already.

:)
 
Last edited:
Joined
Jun 10, 2011
Messages
332
Motherboard
Gigabyte Z370 Aorus Ultra Gaming 2.0
CPU
i7 8700K
Graphics
2x RX580
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
I think many builders spend too much effort trying to match their hardware to a real Mac. By doing this they often choose obscure or little-used system-definitions which throw up problems in other areas besides CPU power-management or GPU compatibility. Over the years there have been a few "Golden Ticket" definitions that have prooved very reliable both in booting a PC and keeping it reliable without crashing. Way back we used "MacPro3,1", then my favourite iMac14,2 however these are not Big Sur compatible. iMac17,1 is and in my opinion, a good, solid definition. (Take care experimenting as the Apple servers can get confused if you change too often. Best to disconnect from the Internet when you try different ones).

Agree. Now I've switched to iMac17,1 as suggested. iMac15,1 was also a good choice but in the long run iMac17,1 will last till latest Intel-supported macOS is published.

To help your PC power-manage the CPU you can use an SSDT. There are two main scripts used to create this. I'm sure you realise this already.

Yes, I already use a SSDT for power management. It's a must!

After the change to iMac17,1 I had a look at IOReg to check for changes but it looked the same (EH01 and EH02 don't have HSxx ports, just addresses and XHC part OK).

So I'm starting to think I've reached the dead end street... any ideas?

Thanks again!
 

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
5,358
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. iOS
Agree. Now I've switched to iMac17,1 as suggested. iMac15,1 was also a good choice but in the long run iMac17,1 will last till latest Intel-supported macOS is published.



Yes, I already use a SSDT for power management. It's a must!

After the change to iMac17,1 I had a look at IOReg to check for changes but it looked the same (EH01 and EH02 don't have HSxx ports, just addresses and XHC part OK).

So I'm starting to think I've reached the dead end street... any ideas?

Thanks again!

The "H" series of chipsets has always been a little more problematic than the "Z" series. The USB configuration has always been slightly different. To be honest the only thing which has baffled me is the way the EHCI controllers have been allocated their hubs - PR01 and PR12 in this case. Why PR01 for both hubs is a mystery. Perhaps a bug in the system that doesn't affect Windows so no one cares?

I think we have explored everything that could make a difference. Unless someone else can give us another explanation. I'm always willing to learn more. :thumbup:
 
Joined
Jun 10, 2011
Messages
332
Motherboard
Gigabyte Z370 Aorus Ultra Gaming 2.0
CPU
i7 8700K
Graphics
2x RX580
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
Hi there!

The "H" series of chipsets has always been a little more problematic than the "Z" series. The USB configuration has always been slightly different. To be honest the only thing which has baffled me is the way the EHCI controllers have been allocated their hubs - PR01 and PR12 in this case. Why PR01 for both hubs is a mystery. Perhaps a bug in the system that doesn't affect Windows so no one cares?

I think we have explored everything that could make a difference. Unless someone else can give us another explanation. I'm always willing to learn more. :thumbup:

Thanks a lot for all your help! Finally I solved the problem and I would like to tell you how I did it. In complete desperation, I started having a look at UBSInjectAll's plist, and I found that some sysdefs have more info that others. Concretely, I found that iMac16,1 and iMac16,2 (among others) include definitions of EHCI, HUB1 and HUB2 devices.

Captura de pantalla 2021-01-12 a las 15.11.30.png


So I duplicated and renamed these data in order for it to be available for iMac17,1. Then things started to change. I created my USBPorts.kext with Hackintool but it wasn't perfect yet, so I modded it in order to have the correct naming and numbering of ports.

After a couple of reboots and changes in the USBPorts.kext's info.plist the USB part of IOReg looks like you can see in the attached .ioreg file. Attached is also my EFI folder, just in case you want to know what changes I did exactly.

Thanks again and cheers!
 

Attachments

  • EFI.zip
    17.6 MB · Views: 4
  • ultrazone.ioreg
    4.8 MB · Views: 4
Top