October 5, 2009
Modified November 17, 2009
This guide shows the steps necessary to dump, assemble, patch, and compile a DSDT.aml for your M1330 or M1530. This DSDT.aml will allow vanilla speed stepping, vanilla sleep, enable the clamshell lid, inject NVidia graphics, and allow the use of a custom AppleHDA.kext. Tested by myself under Leopard 10.5.8, and I understand it is being used under Snow Leopard, as a copy of a DSDT.aml using this method (with unpatched HDEF audio) is on SuperHai's Snow Leopard install DVD. The DSDT.aml will vary depending on your CPU, and your graphics option (NVidia or Intel).
Prerequisits
- A working Vanilla install of Leopard
You can use wingrunr's guide as a reference:
http://www.insanelymac.com/forum/index.php...mp;#entry847294
or Snow Leopard
You can use Superhai's guide as a reference:
http://www.projectosx.com/forum/index.php?showtopic=561
- Installed and working copy of Chamelleon RC1 or higher (RC3 required for Snow Leopard).
Posting Rules:
1. Please keep this topic specific to making custom DSDT.aml files for Dell XPS M1330/M1530. More general M1330/M1530 questions can be posted in MacGirl's topic:
http://www.insanelymac.com/forum/index.php?showtopic=83039
2. If you'd like to request help about issues with a DSDT.aml that is known to work and you are running a distro, please try it on a vanilla install first. There is no reason to use a distro on these machines as vanilla works great, and there's a very good chance that issues are related to something non-standard about the distro. It is very hard to offer help on distros because it's near impossible to know what has been changed from vanilla on the distro.
Contributing:
- If you successfully use this guide on a configuration different from a DSDT.aml posted here, post it! This will help others with your configuration.
- If you find a patch that works better or adds more functionality than what is shown here, share it!
Credits
Chrysaor for his DSDT.aml for M1530. This motivated me to figure out how to do it on my M1330, and I used his DSDT.aml as a reference.
Wingrunr and MacGirl for their awesome threads.
Superhai for his great kexts and snow leopard work.
Zhell for his guide on dumping the ACPI tables.
ApexDE for his work on the USB fix.
I'm not sure who came up with the NVidia and HDEF fixes, but whoever did, thanks.
2009/11/17
Alternative to Step One and Step Two: No Linux BootCD Required
It's been found that it is possible to get Vanilla SpeedStep and sleep working without SSDT tables (thanks Brett Whinnen). The DSDT table can be dumped from OS-X, so a boot CD is not required. The only disadvantage is that you will be unable to customize your speed stepping. You will still need to apply the patches listed in Section 3.
1. Download and unzip DSDT Patcher from this thread.
http://www.insanelymac.com/forum/index.php?showtopic=133683
2. Under the "Tools" subfolder, copy "iasl" and "getDSDT.sh" to the /sbin directory (this is the compiler/decompiler, and the DSDT dumping script respectively).
3. In the folder where you want to work, execute the command:
getDSDT.sh
A file called DSDT.dat will appear in the working folder.
4. Decompile the DSDT.dat using the following command:
iasl -d dsdt.dat
The file will be decompiled to dsdt.dsl in the same folder.
5. Open the dsdt.dsl file in TextEdit.
6. In the DefinitionBlock line near the top of the file, replace the filename with the name "DSDT.aml" with no path. Otherwise it will overwrite the original.
7. Continue on to Step 3: Patching the DSDT. When installing the finished DSDT (Step 4), do NOT use the DropSSDT=y flag.
Step One: Dumping the ACPI Tables
The DSDT is built by assembling and compiling ACPI tables dumped from the computer's bios. This is best done from Linux as the complete tables cannot be dumped from OS-X. Don't worry you don't have to install linux, you can use an Ubuntu Live-CD (allows you to boot Ubuntu from your CD drive). After this step is done, we do the remainder in OS-X (although it is possible to do most of the remaining steps in Linux if you really wanted to). Here's the steps involved.
1. Download an Ubuntu Live CD (9.04 Jaunty Jackalope is the current version, I used the 64 bit version)
http://www.ubuntu.com/getubuntu/download
and burn it to CD.
EDIT 2009/10/22 -> It's been reported that Ubuntu 9.10 beta did not work for this, but 9.04 definately does (thanks Jisare).
2. Boot from the CD, and choose the option "Try Ubuntu without any change to your computer".
3. Open a terminal window (under Accessories).
4. Enable "Universe" repositories (this allows you to install the required software to do your dump)
CODE
sudo nano /etc/apt/sources.list
Uncomment the "Universe" lines, exit and save.
5. Install the ACPIDump package.
CODE
sudo apt-get update
sudo apt-get install acpidump
sudo apt-get install acpidump
6. Change to root (sudo su) and dump the tables and store them in ACPI-Tables.zip (thank you zhell)
mkdir ACPI && dmesg | perl -we '$n=0; while (<>) { if (($t,$a,$l,$o) = (/^[^a-zA-Z]*ACPI: ([-._A-Z0-9]{4,4}) +([0-9A-F]{8,8}), ([0-9A-F]{4,4})+(?:\s*\(([^)]+))?/)) { $o && $o=~s/[^-._a-zA-Z0-9]+/-/g; ($cmd="acpidump -a $a -l $l > \"ACPI/${t}".($o?"_$o":"").".aml\""); print "Running command: \"$cmd\"\n"; system($cmd); ++$n; } } die("No match") unless $n;' && zip -r ACPI-Tables.zip ACPI
7. Copy the ACPI-Tables.zip to a USB drive or network share where you can access it later from OS-X.
Step Two: Decompiling and Assembling the Tables
Look at the contents of the ACPI-Tables.zip files. The ones that are needed are the DSDT table and the SSDT PmRef tables (there are five). These six have to be assembled into a single DSDT.aml file. Each one must be decompiled, assembled together.
1. Download and unzip DSDT Patcher from this thread.
http://www.insanelymac.com/forum/index.php?showtopic=133683
2. Under the "Tools" subfolder, copy "iasl" to the /sbin directory (this is the compiler/decompiler)
3. Decompile each of the required .aml files using the following command:
CODE
iasl -d [file.asl]
A [file].dsl file will be created in the same folder.
4. Open the DSDT dsl file (called DSDT_r2-INT430-SYSFexxx-1001-INTL-20050624.aml on my computer) in TextEdit.
5. In the DefinitionBlock line near the top of the file, replace the long unfriendly filename with the name "DSDT.aml" (this is so when you compile the file it will have the name DSDT.aml. Otherwise it will overwrite the original)
6. Remove the last curly brace } at the bottom of the file.
7. Open the first SSDT file in another TextEdit window (SSDT_r1-PmRef-Cpu0Cst-3001-INTL-20050624.dsl on my computer, I don't believe the order is important, but I did them in alphabetical order).
8. Copy starting AFTER the first curly brace { (probably an "EXTERN" line) to the end of the file, and paste it to the end of the DSDT file.
9. Repeat steps 6 to 8 for the remaining SSDT files.
10. Save the DSDT file with the joined DSDT tables. We'll call it myDSDT.aml.
You may also want to date code and/or version it. The DSDT's are specific not only to the model but to the CPU, and the NVidia graphics are optional.
11. Attempt to compile the file with the following command. It will fail, but it will also tell us what we have to fix.
CODE
iasl myDSDT.dsl
12. All the errors at "External" lines e.g.:
DSDT.dsl 6026: External (\_PR_.CPU0, DeviceObj)
Error 4056 - Name already exists in scope ^ (\_PR_.CPU0)
are there because the same external was specified in multiple tables, but should only be specified once. Simply delete the offending lines, leaving each external defined only once. A few cannot even be defined once, because they are defined elsewhere as code in the file (therefore they are not external).
13. You will get an error like this on the M1330, and I'm pretty sure the M1530 as well:
DSDT.dsl 5706: Name (_HID, "*pnp0c14")
Error 4001 - ^ String must be entirely alphanumeric (*pnp0c14)
I'm not sure why that asterisk is there, but simply remove the asterisk and it will compile fine.
14. You will get a number of warnings that look like this:
DSDT.dsl 5016: And (Local0, 0x0F)
Warning 1105 - ^ Result is not used, operator has no effect
Replace all of these with:
And (Local0, 0x0F, Local0)
15. Try to compile again, and if it compiles, great! But it's not ready to be used yet. If it doesn't compile, you probably messed up a step (note to anyone not using an M1330 or M1530: some bioses actually ship with acpi tables with errors!)
Step Three: Patching the DSDT
Required: DTGP Method
This method is required for the USB fix and the NVidia injection to work. If you use don't use these you don't need it.
Insert this method under the _WAK method.
CODE
Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}
If (LEqual (Arg2, One))
{
Return (One)
}
}
}
Store (Buffer (One)
{
0x00
}, Arg4)
Return (One)
}
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}
If (LEqual (Arg2, One))
{
Return (One)
}
}
}
Store (Buffer (One)
{
0x00
}, Arg4)
Return (One)
}
Required for Snow Leopard: Fix USB Devices Randomly Not Working - Added 2009/20/14
Reportedly, some are having issues with USB randomly not working on startup, but then trying again will bring the USB back. I haven't actually experienced this. Perhaps it is Snow Leopard specific? Jkbuha and FMulder have come up with this fix (thanks!):
EDIT 2009/10/22 -> I've now updated to Snow Leopard, and sure enough this is REQUIRED for proper USB function.
Remove the following two lines from the Device (TMR) section:
CODE
IRQNoFlags ()
{2}
{2}
Optional: USB Drive Sleep Fix
Reportedly this fix will allow M1530s to sleep and wake up without causing USB drives to disconnect, but it does not work on my M1330
Find the EHC2 and EHCI sections and insert this method before the _PWR method in both sections:
CODE
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x0B)
{
"AAPL,clock-id",
Buffer (One)
{
0x01
},
"device_type",
Buffer (0x05)
{
"EHCI"
},
"AAPL,current-available",
0x04B0,
"AAPL,current-extra",
0x02BC,
"AAPL,current-in-sleep",
0x03E8,
Buffer (One)
{
0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
{
Store (Package (0x0B)
{
"AAPL,clock-id",
Buffer (One)
{
0x01
},
"device_type",
Buffer (0x05)
{
"EHCI"
},
"AAPL,current-available",
0x04B0,
"AAPL,current-extra",
0x02BC,
"AAPL,current-in-sleep",
0x03E8,
Buffer (One)
{
0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
Optional: NVidia Injection (also required for clamshell and sleep):
Insert this code under the Device (VID) section within the Device (AGP) section (not in the independent (VID) section) under Name (_ADR, 0x00) and above the _DOS section. The "8400M GS" is the card found within the M1330. M1530 users will want to replace this with "8600M GT". If you do not use this patch and you have a NVidia card you can use an injector instead.
CODE
Name (_SUN, One)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x18)
{
"@0,built-in",
Buffer (One)
{
0x01
},
"@0,compatible",
Buffer (0x0B)
{
"NVDA,NVMac"
},
"@0,device_type",
Buffer (0x08)
{
"display"
},
"@0,name",
Buffer (0x0F)
{
"NVDA,Display-A"
},
"@1,compatible",
Buffer (0x0B)
{
"NVDA,NVMac"
},
"@1,device_type",
Buffer (0x08)
{
"display"
},
"@0,display-cfg",
Buffer (0x04)
{
0x03, 0x01, 0x00, 0x00
},
"@1,display-cfg",
Buffer (0x04)
{
0xFF, 0xFF, 0x00, 0x01
},
"@1,name",
Buffer (0x0F)
{
"NVDA,Display-B"
},
"NVCAP",
Buffer (0x18)
{
/* 0000 */ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
/* 0008 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0010 */ 0x00, 0x00, 0x00, 0x00
},
"device_type",
Buffer (0x0D)
{
"NVDA,GeForce"
},
"model",
Buffer (0x18)
{
"NVIDIA GeForce 8400M GS"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x18)
{
"@0,built-in",
Buffer (One)
{
0x01
},
"@0,compatible",
Buffer (0x0B)
{
"NVDA,NVMac"
},
"@0,device_type",
Buffer (0x08)
{
"display"
},
"@0,name",
Buffer (0x0F)
{
"NVDA,Display-A"
},
"@1,compatible",
Buffer (0x0B)
{
"NVDA,NVMac"
},
"@1,device_type",
Buffer (0x08)
{
"display"
},
"@0,display-cfg",
Buffer (0x04)
{
0x03, 0x01, 0x00, 0x00
},
"@1,display-cfg",
Buffer (0x04)
{
0xFF, 0xFF, 0x00, 0x01
},
"@1,name",
Buffer (0x0F)
{
"NVDA,Display-B"
},
"NVCAP",
Buffer (0x18)
{
/* 0000 */ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
/* 0008 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0010 */ 0x00, 0x00, 0x00, 0x00
},
"device_type",
Buffer (0x0D)
{
"NVDA,GeForce"
},
"model",
Buffer (0x18)
{
"NVIDIA GeForce 8400M GS"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
Optional: HD Audio Patching
This patch allows the sound card to be detected as an HDEF audio card rather than an Azilla Audio card. Replace the Device (AZAL) section with this:
CODE
Device (HDEF)
{
Name (_ADR, 0x001B0000)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"codec-id",
Buffer (0x04)
{
0x16, 0x76, 0x84, 0x83
},
"layout-id",
Buffer (0x04)
{
0x0C, 0x00, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
{
Name (_ADR, 0x001B0000)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"codec-id",
Buffer (0x04)
{
0x16, 0x76, 0x84, 0x83
},
"layout-id",
Buffer (0x04)
{
0x0C, 0x00, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
You will also have to change any references to AZAL to HDEF. In my experience, this does nothing useful, although from what I understand real Macs have this HDEF section. With either the AZAL or HDEF section, a patched AppleHDA.kext can be used without HDAEnabler.kext (Leopard only solution at this time I believe), or alternatively VoodooHDA can be used. If you use this patch and VoodooHDA.kext, AppleHDA.kext must be removed otherwise it will conflict. It seems that you need this patch for working sleep if you do not include the SSDT tables (2009/11/17). Perhaps someday this section can be improved to allow vanilla audio...
Optional: Adding SBUS Device (Added 2009/10/22)
jkbuha came up with this fix using a guide made by Master Chief (thank you). This allows the detection of the SBUS device, and it can be confirmed as detected using IORegistry Explorer by searching for SBUS. This device is required to get C-states working, however we still do not have working C-states even with this patch.
Add this under the first curly brace under Scope (\_SB):
CODE
Method (DBEN, 0, NotSerialized)
{
}
{
}
And this under the DTGP method we added:
CODE
OperationRegion (GPIO, SystemIO, 0x0500, 0x3C)
Field (GPIO, ByteAcc, NoLock, Preserve)
{
GU00, 8,
GU01, 8,
GU02, 8,
GU03, 8,
GIO0, 8,
GIO1, 8,
GIO2, 8,
GIO3, 8,
Offset (0x0C),
GL00, 8,
GL01, 8,
GL02, 8,
GL03, 8,
Offset (0x18),
GB00, 8,
GB01, 8,
GB02, 8,
GB03, 8,
Offset (0x2C),
GIV0, 8,
GIV1, 7,
GI15, 1,
GIV2, 8,
GIV3, 8,
GU04, 8,
GU05, 8,
GU06, 8,
GU07, 8,
GIO4, 8,
GIO5, 8,
GIO6, 8,
GIO7, 8,
GL04, 8,
GL05, 8,
GL06, 8,
GL07, 8
}
OperationRegion (BSKU, SystemMemory, 0xFFBC0100, 0x01)
Field (BSKU, ByteAcc, NoLock, Preserve)
{
, 1,
BPHP, 3,
Offset (0x01)
}
OperationRegion (GPE0, SystemIO, 0x042C, 0x04)
Field (GPE0, ByteAcc, NoLock, Preserve)
{
, 1,
GPEH, 1,
, 7,
PEEN, 1,
, 1,
PMEE, 1,
Offset (0x03),
PCIX, 1,
Offset (0x04)
}
And finally this above the section Device (ISAB):
CODE
Device (SBUS)
{
Name (_ADR, 0x001F0003)
// pci8086,283e -> pci8086,3a30
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"name",
"pci8086,3a30",
"device-id",
Buffer (0x04)
{
0x30, 0x3a, 0x00, 0x00
} /* ,
"subsystem-id",
Buffer (0x04)
{
0x70, 0x72, 0x00, 0x00
},
"subsystem-vendor-id",
Buffer (0x04)
{
0x86, 0x80, 0x00, 0x00
} */
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
OperationRegion (SMBP, PCI_Config, 0x40, 0xC0)
Field (SMBP, DWordAcc, NoLock, Preserve)
{
, 2,
I2CE, 1
}
OperationRegion (SMBE, PCI_Config, 0x04, 0x02)
Field (SMBE, AnyAcc, NoLock, Preserve)
{
IOSE, 1
}
OperationRegion (SMBI, SystemIO, 0x4000, 0x10)
Field (SMBI, ByteAcc, NoLock, Preserve)
{
HSTS, 8,
Offset (0x02),
HCON, 8,
HCOM, 8,
TXSA, 8,
DAT0, 8,
DAT1, 8,
HBDR, 8,
PECR, 8,
RXSA, 8,
SDAT, 16
}
Name (SBOK, 0x00)
Method (ENAB, 0, NotSerialized)
{
Store (0x01, IOSE)
Store (One, SBOK)
}
Method (DISB, 0, NotSerialized)
{
Store (Zero, SBOK)
}
Method (SSXB, 2, Serialized)
{
If (STRT ())
{
Return (0x00)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Arg0, TXSA)
Store (Arg1, HCOM)
Store (0x48, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (0x01)
}
Return (0x00)
}
Method (SRXB, 1, Serialized)
{
If (STRT ())
{
Return (0xFFFF)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Or (Arg0, 0x01), TXSA)
Store (0x44, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (DAT0)
}
Return (0xFFFF)
}
Method (SWRB, 3, Serialized)
{
If (STRT ())
{
Return (0x00)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Arg0, TXSA)
Store (Arg1, HCOM)
Store (Arg2, DAT0)
Store (0x48, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (0x01)
}
Return (0x00)
}
Method (SRDB, 2, Serialized)
{
If (STRT ())
{
Return (0xFFFF)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Or (Arg0, 0x01), TXSA)
Store (Arg1, HCOM)
Store (0x48, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (DAT0)
}
Return (0xFFFF)
}
Method (SBLW, 4, Serialized)
{
If (STRT ())
{
Return (0x00)
}
Store (Arg3, I2CE)
Store (0xBF, HSTS)
Store (Arg0, TXSA)
Store (Arg1, HCOM)
Store (SizeOf (Arg2), DAT0)
Store (0x00, Local1)
Store (DerefOf (Index (Arg2, 0x00)), HBDR)
Store (0x54, HCON)
While (LGreater (SizeOf (Arg2), Local1))
{
Store (0x0FA0, Local0)
While (LAnd (LNot (And (HSTS, 0x80)), Local0))
{
Decrement (Local0)
Stall (0x32)
}
If (LNot (Local0))
{
KILL ()
Return (0x00)
}
Store (0x80, HSTS)
Increment (Local1)
If (LGreater (SizeOf (Arg2), Local1))
{
Store (DerefOf (Index (Arg2, Local1)), HBDR)
}
}
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (0x01)
}
Return (0x00)
}
Method (SBLR, 3, Serialized)
{
Name (TBUF, Buffer (0x0100) {})
If (STRT ())
{
Return (0x00)
}
Store (Arg2, I2CE)
Store (0xBF, HSTS)
Store (Or (Arg0, 0x01), TXSA)
Store (Arg1, HCOM)
Store (0x54, HCON)
Store (0x0FA0, Local0)
While (LAnd (LNot (And (HSTS, 0x80)), Local0))
{
Decrement (Local0)
Stall (0x32)
}
If (LNot (Local0))
{
KILL ()
Return (0x00)
}
Store (DAT0, Index (TBUF, 0x00))
Store (0x80, HSTS)
Store (0x01, Local1)
While (LLess (Local1, DerefOf (Index (TBUF, 0x00))))
{
Store (0x0FA0, Local0)
While (LAnd (LNot (And (HSTS, 0x80)), Local0))
{
Decrement (Local0)
Stall (0x32)
}
If (LNot (Local0))
{
KILL ()
Return (0x00)
}
Store (HBDR, Index (TBUF, Local1))
Store (0x80, HSTS)
Increment (Local1)
}
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (TBUF)
}
Return (0x00)
}
Method (STRT, 0, Serialized)
{
Store (0xC8, Local0)
While (Local0)
{
If (And (HSTS, 0x40))
{
Decrement (Local0)
Sleep (0x01)
If (LEqual (Local0, 0x00))
{
Return (0x01)
}
}
Else
{
Store (0x00, Local0)
}
}
Store (0x0FA0, Local0)
While (Local0)
{
If (And (HSTS, 0x01))
{
Decrement (Local0)
Stall (0x32)
If (LEqual (Local0, 0x00))
{
KILL ()
}
}
Else
{
Return (0x00)
}
}
Return (0x01)
}
Method (COMP, 0, Serialized)
{
Store (0x0FA0, Local0)
While (Local0)
{
If (And (HSTS, 0x02))
{
Return (0x01)
}
Else
{
Decrement (Local0)
Stall (0x32)
If (LEqual (Local0, 0x00))
{
KILL ()
}
}
}
Return (0x00)
}
Method (KILL, 0, Serialized)
{
Or (HCON, 0x02, HCON)
Or (HSTS, 0xFF, HSTS)
}
Device (BUS0)
{
Name (_CID, "smbus")
Name (_ADR, 0x00)
Device (MKY0)
{
Name (_ADR, 0x00)
Name (_CID, "mikey")
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x07)
{
"refnum",
0x00,
"address",
0x39,
"device-id",
0x0CCB,
Buffer (0x01)
{
0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
Method (H1EN, 1, Serialized)
{
If (LLessEqual (Arg0, 0x01))
{
If (LEqual (Arg0, 0x01))
{
Or (GL04, 0x04, GL04)
}
Else
{
And (GL04, 0xFB, GL04)
}
}
}
Method (H1IL, 0, Serialized)
{
ShiftRight (And (GL00, 0x02), 0x01, Local0)
Return (Local0)
}
Method (H1IP, 1, Serialized)
{
Store (Arg0, Local0)
}
Name (H1IN, 0x11)
Scope (\_GPE)
{
Method (_L11, 0, NotSerialized)
{
Notify (\_SB.PCI0.SBUS.BUS0.MKY0, 0x80)
}
}
Method (P1IL, 0, Serialized)
{
ShiftRight (And (GL00, 0x40), 0x06, Local0)
Return (Local0)
}
Method (P1IP, 1, Serialized)
{
If (LLessEqual (Arg0, 0x01))
{
Not (Arg0, Arg0)
And (GIV1, 0x0B, Local0)
ShiftLeft (Arg0, 0x02, Local1)
Or (Local1, Local0, GIV1)
}
}
Name (P1IN, 0x16)
Scope (\_GPE)
{
Method (_L16, 0, NotSerialized)
{
XOr (GIV1, 0x04, GIV1)
Notify (\_SB.PCI0.SBUS.BUS0.MKY0, 0x81)
}
}
}
Device (DVL0)
{
Name (_ADR, 0x57)
Name (_CID, "diagsvault")
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x03)
{
"address",
0x57,
Buffer (0x01)
{
0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
}
}
{
Name (_ADR, 0x001F0003)
// pci8086,283e -> pci8086,3a30
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"name",
"pci8086,3a30",
"device-id",
Buffer (0x04)
{
0x30, 0x3a, 0x00, 0x00
} /* ,
"subsystem-id",
Buffer (0x04)
{
0x70, 0x72, 0x00, 0x00
},
"subsystem-vendor-id",
Buffer (0x04)
{
0x86, 0x80, 0x00, 0x00
} */
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
OperationRegion (SMBP, PCI_Config, 0x40, 0xC0)
Field (SMBP, DWordAcc, NoLock, Preserve)
{
, 2,
I2CE, 1
}
OperationRegion (SMBE, PCI_Config, 0x04, 0x02)
Field (SMBE, AnyAcc, NoLock, Preserve)
{
IOSE, 1
}
OperationRegion (SMBI, SystemIO, 0x4000, 0x10)
Field (SMBI, ByteAcc, NoLock, Preserve)
{
HSTS, 8,
Offset (0x02),
HCON, 8,
HCOM, 8,
TXSA, 8,
DAT0, 8,
DAT1, 8,
HBDR, 8,
PECR, 8,
RXSA, 8,
SDAT, 16
}
Name (SBOK, 0x00)
Method (ENAB, 0, NotSerialized)
{
Store (0x01, IOSE)
Store (One, SBOK)
}
Method (DISB, 0, NotSerialized)
{
Store (Zero, SBOK)
}
Method (SSXB, 2, Serialized)
{
If (STRT ())
{
Return (0x00)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Arg0, TXSA)
Store (Arg1, HCOM)
Store (0x48, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (0x01)
}
Return (0x00)
}
Method (SRXB, 1, Serialized)
{
If (STRT ())
{
Return (0xFFFF)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Or (Arg0, 0x01), TXSA)
Store (0x44, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (DAT0)
}
Return (0xFFFF)
}
Method (SWRB, 3, Serialized)
{
If (STRT ())
{
Return (0x00)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Arg0, TXSA)
Store (Arg1, HCOM)
Store (Arg2, DAT0)
Store (0x48, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (0x01)
}
Return (0x00)
}
Method (SRDB, 2, Serialized)
{
If (STRT ())
{
Return (0xFFFF)
}
Store (0x00, I2CE)
Store (0xBF, HSTS)
Store (Or (Arg0, 0x01), TXSA)
Store (Arg1, HCOM)
Store (0x48, HCON)
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (DAT0)
}
Return (0xFFFF)
}
Method (SBLW, 4, Serialized)
{
If (STRT ())
{
Return (0x00)
}
Store (Arg3, I2CE)
Store (0xBF, HSTS)
Store (Arg0, TXSA)
Store (Arg1, HCOM)
Store (SizeOf (Arg2), DAT0)
Store (0x00, Local1)
Store (DerefOf (Index (Arg2, 0x00)), HBDR)
Store (0x54, HCON)
While (LGreater (SizeOf (Arg2), Local1))
{
Store (0x0FA0, Local0)
While (LAnd (LNot (And (HSTS, 0x80)), Local0))
{
Decrement (Local0)
Stall (0x32)
}
If (LNot (Local0))
{
KILL ()
Return (0x00)
}
Store (0x80, HSTS)
Increment (Local1)
If (LGreater (SizeOf (Arg2), Local1))
{
Store (DerefOf (Index (Arg2, Local1)), HBDR)
}
}
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (0x01)
}
Return (0x00)
}
Method (SBLR, 3, Serialized)
{
Name (TBUF, Buffer (0x0100) {})
If (STRT ())
{
Return (0x00)
}
Store (Arg2, I2CE)
Store (0xBF, HSTS)
Store (Or (Arg0, 0x01), TXSA)
Store (Arg1, HCOM)
Store (0x54, HCON)
Store (0x0FA0, Local0)
While (LAnd (LNot (And (HSTS, 0x80)), Local0))
{
Decrement (Local0)
Stall (0x32)
}
If (LNot (Local0))
{
KILL ()
Return (0x00)
}
Store (DAT0, Index (TBUF, 0x00))
Store (0x80, HSTS)
Store (0x01, Local1)
While (LLess (Local1, DerefOf (Index (TBUF, 0x00))))
{
Store (0x0FA0, Local0)
While (LAnd (LNot (And (HSTS, 0x80)), Local0))
{
Decrement (Local0)
Stall (0x32)
}
If (LNot (Local0))
{
KILL ()
Return (0x00)
}
Store (HBDR, Index (TBUF, Local1))
Store (0x80, HSTS)
Increment (Local1)
}
If (COMP ())
{
Or (HSTS, 0xFF, HSTS)
Return (TBUF)
}
Return (0x00)
}
Method (STRT, 0, Serialized)
{
Store (0xC8, Local0)
While (Local0)
{
If (And (HSTS, 0x40))
{
Decrement (Local0)
Sleep (0x01)
If (LEqual (Local0, 0x00))
{
Return (0x01)
}
}
Else
{
Store (0x00, Local0)
}
}
Store (0x0FA0, Local0)
While (Local0)
{
If (And (HSTS, 0x01))
{
Decrement (Local0)
Stall (0x32)
If (LEqual (Local0, 0x00))
{
KILL ()
}
}
Else
{
Return (0x00)
}
}
Return (0x01)
}
Method (COMP, 0, Serialized)
{
Store (0x0FA0, Local0)
While (Local0)
{
If (And (HSTS, 0x02))
{
Return (0x01)
}
Else
{
Decrement (Local0)
Stall (0x32)
If (LEqual (Local0, 0x00))
{
KILL ()
}
}
}
Return (0x00)
}
Method (KILL, 0, Serialized)
{
Or (HCON, 0x02, HCON)
Or (HSTS, 0xFF, HSTS)
}
Device (BUS0)
{
Name (_CID, "smbus")
Name (_ADR, 0x00)
Device (MKY0)
{
Name (_ADR, 0x00)
Name (_CID, "mikey")
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x07)
{
"refnum",
0x00,
"address",
0x39,
"device-id",
0x0CCB,
Buffer (0x01)
{
0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
Method (H1EN, 1, Serialized)
{
If (LLessEqual (Arg0, 0x01))
{
If (LEqual (Arg0, 0x01))
{
Or (GL04, 0x04, GL04)
}
Else
{
And (GL04, 0xFB, GL04)
}
}
}
Method (H1IL, 0, Serialized)
{
ShiftRight (And (GL00, 0x02), 0x01, Local0)
Return (Local0)
}
Method (H1IP, 1, Serialized)
{
Store (Arg0, Local0)
}
Name (H1IN, 0x11)
Scope (\_GPE)
{
Method (_L11, 0, NotSerialized)
{
Notify (\_SB.PCI0.SBUS.BUS0.MKY0, 0x80)
}
}
Method (P1IL, 0, Serialized)
{
ShiftRight (And (GL00, 0x40), 0x06, Local0)
Return (Local0)
}
Method (P1IP, 1, Serialized)
{
If (LLessEqual (Arg0, 0x01))
{
Not (Arg0, Arg0)
And (GIV1, 0x0B, Local0)
ShiftLeft (Arg0, 0x02, Local1)
Or (Local1, Local0, GIV1)
}
}
Name (P1IN, 0x16)
Scope (\_GPE)
{
Method (_L16, 0, NotSerialized)
{
XOr (GIV1, 0x04, GIV1)
Notify (\_SB.PCI0.SBUS.BUS0.MKY0, 0x81)
}
}
}
Device (DVL0)
{
Name (_ADR, 0x57)
Name (_CID, "diagsvault")
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x03)
{
"address",
0x57,
Buffer (0x01)
{
0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
}
}
Optional: IDE Fix (added 2009/11/17)
This fix allows you to use Snow Leopard with the vanilla IOATAFamily.kext (Thank you The King).
Under the both the Device (IDE1) and Device (IDE2) sections under the first Name line the add:
CODE
OperationRegion (IDET, PCI_Config, 0x40, 0x04) // IDE Timing Register
Field (IDET, WordAcc, NoLock, Preserve)
{
Offset (0x00),
M1, 8,
Offset (0x01),
M2, 8,
Offset (0x02),
M3, 8,
Offset (0x03),
M4, 8
}
Method (_DSM, 4, NotSerialized)
{
Store (0x07, M1)
Store (0xE3, M2)
Store (Zero, M3)
Store (0xC0, M4)
Return (Zero)
}
Field (IDET, WordAcc, NoLock, Preserve)
{
Offset (0x00),
M1, 8,
Offset (0x01),
M2, 8,
Offset (0x02),
M3, 8,
Offset (0x03),
M4, 8
}
Method (_DSM, 4, NotSerialized)
{
Store (0x07, M1)
Store (0xE3, M2)
Store (Zero, M3)
Store (0xC0, M4)
Return (Zero)
}
Required: Using DSDT Patcher to do Final Patches:
In the DSDT Patcher directory run the following command:
CODE
./DSDT\ Patcher -newHPET myDSDT.dsl
WARNING! If you name your dsl file DSDT.dsl, copy it to the folder, and run this command it will be DELETED!
This will make a few more patches and compile it to DSDT.aml in the patcher folder. Read the output to ensure that there is no errors and that it reads New HPET written. This is the final product! If it works, congratulations!
Step Four: Testing and Using the DSDT
I use Chamelleon RC2 so that's what I will give instructions for (no reason to upgrade to RC3 yet because I'm still using Leopard). Chamelleon installs an /Extra folder that contains the configuration information and can also contain your finished DSDT.aml. I don't recommend installing it there yet however because it might not work!
To prepare your machine to test/use the DSDT.aml
1. Edit the file /Extra/com.apple.Boot.plist. I use "sudo nano /Extra/com.apple.Boot.plist"
2. Under the key "Kernel Flags", add the flag "DropSSDT=Y" (flags are space separated if you already have another flag).
EDIT 2009/10/22 -> I ran into an interesting problem here. I installed 10.6 Snow Leopard on a second partition leaving 10.5 intact on it's partition, and Snow Leopard was looking at the com.apple.Boot.plist on the 10.5 partition! This appears to be a Chameleon bug.
3. Copy the attached smbios.plist file to the /Extra folder and edit it to match your hardware. Set SMmaximalclock to your processor speed in MHz, your SMexternalclock to your bus speed, and SMSerial to something unique but with the same number of characters. If you do not know the bus speed you can use the utility CPU-X to look it up.
4. If you use SMBIOSResolver.kext or something similar remove it. The smbios.plist takes the role of it.
5. Copy your DSDT.aml to the /Extra folder, and rename it to something different such as "DSDT_Test.aml" This is so that it does not load by default, so if it doesn't work, it's not that big a deal.
6. Correct all the permissions in the /Extra folder with the following commands:
CODE
sudo chmod -R 755 /Extra
sudo chown root:wheel /Extra
sudo chown root:wheel /Extra
7. If you use IntelCPUPMDisabler.kext (or NullCPUPowerManagement.kext), VoodooPower.kext, VoodooUSBEHCI.kext, and/or SleepEnabler.kext remove them. Also remove the patch necessary to make VoodooUSBEHCI.kext work. You can also remove HDAEnabler.kext if you have it, and if you did the NVidia patch you should remove your injector. Clear the kext cache if you removed any kexts. Repair permissions. Kext Utility comes in really helpful here.
8. Reboot
9. When the boot loader comes up, arrow over to the OS-X partition, and type:
CODE
DSDT=/Extra/[testdsdt.aml]
10. Press [ENTER] and cross your fingers!
11. If you are happy with the results, rename your test DSDT file to DSDT.aml in the /Extra folder, and it will load by default from now on.
Kexts I use for Snow Leopard (added 2009/11/17)
fakesmc.kext
VoodooTSCSync.kext
VoodooBattery.kext (these first three from Superhai's boot CD)
IOATAFamily.kext (if you do not apply the IDE fix, also on Superhai's boot CD)
AppleACPIPS2Nub.kext and VoodooPS2Controller.kext (these two from here: http://www.insanelymac.com/forum/index.php?showtopic=175372), or alternatively you can use the two PS2 kexts included on Superhai's boot CD)
VoodooSDHC.kext (From VoodooProjects)
VoodooHDA.kext (from here: http://www.projectosx.com/forum/index.php?...c=355&st=0)
Kexts that must be removed if you have them:
IntelCPUPMDisabler.kext
NullCPUPowerManagement.kext
SleepEnabler.kext
SMBIOSResolver.kext
AppleHDA (if you use the HDEF sound patch)
Hints
1. There is a great tool called MSR Tools that can be used to verify that your vanilla speed step is working.
EDIT 2009/10/22 -> MSR Tools does not work under Snow Leopard! Instead you can use CoolBook (thanks FMulder).
2. To see what other people of done, decompile other people's DSDT.aml files by using the same iasl command you used to decompile the dumped tables.
3. If you haven't tried Kext Utility, it's great. Just make whatever changes you want to your kexts (add/delete to/from your /Extra/Extensions or /System/Library/Extensions folders) and run the utility and it will take care of fixing permisions and updating your caches. (Added 2009/10/22)
Files
Click to view attachment - DSDT.aml for an M1330 with NVidia graphics and a T8300 (2.4GHz) CPU ONLY with USB fix, USB sleep fix, and audio fix. (2009/10/14).
Click to view attachment - Above DSDT with SBUS added (2009/10/22)
Click to view attachment - DSDT for M1330 with any CPU and NVidia graphics with all fixes listed in this guide (2009/11/17)
Click to view attachment - DSDT for M1530 with any CPU and NVidia graphics with all fixes listed in this guide by Brett Whinnen. Details Here. (2009/11/17)
*You must use the DropSSDT=y boot flag if you use a DSDT meant for a specific CPU, and you must NOT use it if you use a DSDT meant for any CPU.
Click to view attachment - smbios.plist. Edit for your machine.
