Patch DSDT for JMB362 in AHCI mode

Posted 20 May 2011 - 10:27 PM

stradivari1723

InsanelyMac Protégé

Members

21 posts

Hi, all.

First post. Huzzah.

Anyhoo... I've got an Asus P8P67 Pro. There's an issue with the onboard eSATA ports (Jmicron JMB362 powered), whereby the Asus BIOS/UEFI only allows "enabled" or "disabled" for that particular controller, and unfortunately "enabled" really means "legacy IDE". There is no BIOS option to start it in true AHCI mode.

I have been successful using the controller in Snow Leopard by getting Apple's AHCI driver to attach itself to the controller even though it is in legacy IDE mode, and then switching the controller to AHCI mode by brute force, by setting the PCI registers with setpci.

Once done, the eSATA ports work like a charm, including hot-swapping and all AHCI eSATA goodness.

What I'd like to do now is get this change done in DSDT, and I need some help if you've got the time! :-)

But to no avail. I'm simply lacking enough of a foundation in this kind of thing to know what exactly to change, what to modify and adapt for my entry.

Can anybody help me by showing me where to put this bit of code (I understand that it sets the registers to the same value as the setpci command arguments I first posted?) into my DSDT? I'm also not sure of the function of the name, operationregion, and field lines. Do they need to be changed to match what is already in the JMB0 entry in my DSDT? Or do they specify where to write the values. I really need some help! :-)

This worked perfectly, although there is still a second "ghost" IDE entry when I run lspci. However, I don't care because first and foremost now there is an AHCI Sata entry, and that is the one getting picked up by the Apple AHCI driver, and it works perfectly. Any idea why there would still be an IDE entry?

Posted 25 May 2011 - 04:31 AM

LatinMcG

Insanely digesting DSDT

Members

2,525 posts

Gender:Male

Location:Tampa, Florida

nice job.
ghost entry hmm..can be disabled with the ide timing fix also from king. on the ide section (ioregexplorer). or it might be in bios ? do u have any ide devices at all ? can it be disabled in bios ? removed from dsdt ?

Posted 26 May 2011 - 02:37 PM

Posted 29 May 2011 - 02:52 PM

stradivari1723

InsanelyMac Protégé

Members

21 posts

the ini should fix that. or PINI

I really need some more precise help, if you have time. I've been trying, but I'm still somewhat clueless. The way I understand it, PINI is a function you create (I've been following this thread here), and I assume it would write those same registers I used in my initial device call during startup, right? But... how to I identify where the registers are located (i.e., how do I identify the device, etc.) Sorry, maybe that question doesn't even make sense??

But anyway, if I'm able to make that function successfully, then where do I call it from? _WAK? And I don't really understand the "disable register" business... is that during prepare to sleep? So where do I put that? And what would it look like?? :-(

Posted 02 June 2011 - 04:37 PM

stradivari1723

InsanelyMac Protégé

Members

21 posts

Thanks for your continued support!

So I can just add that into the device () entry? I think I already know where the device is listed in the DSDT (it is called Device (GIGE) I think). I'll give it a try when I get home. So with that entry, the port will remain powered during sleep... but fans and all will still go off? And WOL packets will be recognized...? I also wonder (out loud, to myself, at this point LOL!) if adding this line will cause OS X to enable the "Wake for administrative access" option in Energy Saver. It probably doesn't even need to be there though, right? I mean, WOL is a hardware solution, no?

Posted 03 June 2011 - 08:49 PM

DSDT I am currently using, with Device(JMB0) and Device(JMB1) entries modified to get AHCI working, PINI method to restore registers for JMB, and PINI() call in _WAK to restore AHCI mode upon wake, and finally (of course) the DTGP method for hacks. LAN is untouched:dsdt.aml.zip12.98KB73 downloads