Senior Member
Posts: 146
Join Date: Aug 2009
|
Dell Mini 10v DSDT Patches -
05-28-2015, 02:24 AM
I've been working on my old Mini10v. Here's what I got so far:
Fixes much of what's wrong with the DSDT so it will compile with MaciASL
Code:
# Fix 1299, 6043, Invalid combination of Length and Min/Max fixed flags
into device label PCI0 parent_label _SB code_regex 0x00000000\,\s\s\s\s\s\s\s\s\s\/\/\sLength replace_matched begin 0xFEC00000, // Length end;
# Fix 1306, 6043, Invalid combination of Length and Min/Max fixed flags
into device label PCI0 parent_label _SB code_regex 0x00000000\,\s\s\s\s\s\s\s\s\s\/\/\sLength replace_matched begin 0x00005000, // Length end;
# Fix Object is not referenced (Name is within method [_STM])
into method label _STM parent_label PRID code_regex CreateWordField\s\(Arg1\,\s0x7E\,\sW630\) remove_matched;
into method label _STM parent_label PRID code_regex CreateWordField\s\(Arg1\,\s0xB0\,\sW880\) remove_matched;
into method label _STM parent_label PRID code_regex CreateWordField\s\(Arg2\,\s0x7E\,\sW631\) remove_matched;
into method label _STM parent_label PRID code_regex CreateWordField\s\(Arg2\,\s0xB0\,\sW881\) remove_matched;
# Optimization: Change \_SB.PCI0.PDRC._Y1* to ^_Y1*
into_all all code_regex \\_SB\.PCI0\._Y0([0-9]) replaceall_matched begin \^_Y0%1 end;
into_all all code_regex \\_SB\.PCI0\._Y0([A-Z]) replaceall_matched begin \^_Y0%1 end;
into_all all code_regex \\_SB\.PCI0\.LPCB\.HPET\._Y0([A-Z]) replaceall_matched begin \^_Y0%1 end;
# Optimization: Integer optimized to single-byte AML opcode (One)
into_all all code_regex Package\s\(0x01\) replaceall_matched begin Package (One) end;
Injects a Mac compatible deviceID to enable DW1310 wireless card [deprecates patched IO80211.kext]
Code:
#wifi_BCM4312-RP02-PXSX.txt
# Airport fix works with vanilla IO80211 kext
# Fixes Broadcom BCM4312 (pci14e4,4315) To work with vanilla IO80211 (emulates 4318)
into method label _DSM parent_adr 0x001C0001 remove_entry;
into device label PXS2 parent_adr 0x001C0001 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer(One) { 0x03 } ) }\n
Return (Package()\n
{\n
"device-id", Buffer() { 0x18, 0x43, 0x00, 0x00 },\n
"name", "pci14e4,4318",\n
"AAPL,slot-name", Buffer() { "AirPort" },\n
"device_type", Buffer() { "AirPort" },\n
"model", Buffer() { "Broadcom Corporation BCM4312 802.11 b/g Wireless Network Adapter" },\n
"subsystem-id", Buffer() { 0x87, 0x00, 0x00, 0x00 },\n
"subsystem-vendor-id", Buffer() { 0x6b, 0x10, 0x00, 0x00 },\n
})\n
}\n
end;
Renames devices to match mac hardware of a similar vintage
Code:
into device label EC0 set_label begin EC end;
into_all all code_regex \.EC0\. replaceall_matched begin \.EC\. end;
into_all all code_regex \^EC0\. replaceall_matched begin \^EC\. end;
into_all all code_regex \^\^EC0\. replaceall_matched begin \^\^EC0\. end;
# Rename ACAD (ac adapter) to ADP1 to be more Apple-like
into device label ACAD set_label begin ADP1 end;
into method label _Q37 parent_hid PNP0C09 code_regex ACAD replaceall_matched begin ADP1 end;
into method label _Q38 parent_hid PNP0C09 code_regex ACAD replaceall_matched begin ADP1 end;
# Rename PXS3 at RP03 (ethernet) to PXS1 to be more Apple-like
into device label PXS3 parent_adr 0x001C0002 set_label begin PXS1 end;
# Rename BAT1 (battery) to SMB0 to be more Apple-like
into device name_hid PNP0C0A parent_adr 0x001F0000 set_label begin SMB0 end;
into_all all code_regex Notify\s\(BAT1 replaceall_matched begin Notify (SMB0 end;
Deprecates HDAEnabler.kext [requires method DTGP)
Code:
into method label _DSM parent_adr 0x001B0000 remove_entry;
into device name_adr 0x001B0000 parent_hid PNP0A08 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
Store (Package ()\n
{\n
"AAPL,slot-name", Buffer () { "Built in" },\n
"codec-id", Buffer () { 0x72, 0x02, 0xEC, 0x10 },\n
"built-in", Buffer (One) { 0x00 },\n
"layout-id", Buffer () { 0x10, 0x01, 0x00, 0x00 },\n
"model", Buffer () { "Realtek ALC272" },\n
"device_type", Buffer () { "Intel High Definition Audio" },\n
"PinConfigurations", Buffer (One) { 0x00 }\n
}, Local0)\n
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
Return (Local0)\n
}
end;
Patches HPET [Might need tweaking]
Code:
into device name_hid PNP0103 code_regex \sMemory32Fixed\s\(ReadOnly\, replace_matched begin
IRQNoFlags ()\n
{0}\n
IRQNoFlags ()\n
{8}\n
Memory32Fixed (ReadOnly,
end;
Graphics [needs binpatch too]
Code:
into method label _DSM parent_adr 0x00020000 remove_entry;
into device name_adr 0x00020000 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
Store (Package (0x0C)\n
{\n
"AAPL,slot-name", Buffer () { "Built-in" },\n
"AAPL,HasPanel", Buffer () { 0x01, 0x00, 0x00, 0x00 },\n
"device_type", Buffer () { "Display"},\n
"model", Buffer () { "Intel 945GME Express Integrated Graphics Controller" },\n
"name", Buffer () { "VGA compatible controller" },\n
"Built in", Buffer (One) { 0x01 }\n
}, Local0)\n
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
Return (Local0)\n
}
end;
Fix EmbeddedControl to use 8bit feilds for battery stats
Code:
# 10v Battery Patch
# BATN 128
# ERIB
# BRC0
# BPV0
# BDV0
# BDC0
# BFC0
# BAC0
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
# 16-bit registers
into device label EC0 code_regex ERIB,\s+16 replace_matched begin IB00,8,IB01,8, // Was ERIB end;
into device label EC0 code_regex BRC0,\s+16 replace_matched begin RC00,8,RC01,8, // Was BRC0 end;
into device label EC0 code_regex BPV0,\s+16 replace_matched begin PV00,8,PV01,8, // Was BPV0 end;
into device label EC0 code_regex BDV0,\s+16 replace_matched begin DV00,8,DV01,8, // Was BDV0 end;
into device label EC0 code_regex BDC0,\s+16 replace_matched begin DC00,8,DC01,8, // Was BDC0 end;
into device label EC0 code_regex BFC0,\s+16 replace_matched begin FC00,8,FC01,8, // Was BFC0 end;
into device label EC0 code_regex BAC0,\s+16 replace_matched begin AC00,8,AC01,8, // Was BAC0 end;
# fix 16-bit method Reads
into method label _BST parent_hid PNP0C0A code_regex \(\^\^EC0\.BRC0\, replaceall_matched begin (B1B2(^^EC0.RC00,^^EC0.RC01), end;
into method label _BST parent_hid PNP0C0A code_regex \(\^\^EC0\.BPV0\, replaceall_matched begin (B1B2(^^EC0.PV00,^^EC0.PV01), end;
into method label _BST parent_hid PNP0C0A code_regex \(\^\^EC0\.BDV0\, replaceall_matched begin (B1B2(^^EC0.DV00,^^EC0.DV01), end;
into method label _BIF parent_hid PNP0C0A code_regex \(\^\^EC0\.BDV0\, replaceall_matched begin (B1B2(^^EC0.DV00,^^EC0.DV01), end;
into method label _BST parent_hid PNP0C0A code_regex \(\^\^EC0\.BDC0\, replaceall_matched begin (B1B2(^^EC0.DC00,^^EC0.DC01), end;
into method label _BIF parent_hid PNP0C0A code_regex \(\^\^EC0\.BDC0\, replaceall_matched begin (B1B2(^^EC0.DC00,^^EC0.DC01), end;
into method label _BST parent_hid PNP0C0A code_regex \(\^\^EC0\.BFC0\, replaceall_matched begin (B1B2(^^EC0.FC00,^^EC0.FC01), end;
into method label _BIF parent_hid PNP0C0A code_regex \(\^\^EC0\.BFC0\, replaceall_matched begin (B1B2(^^EC0.FC00,^^EC0.FC01), end;
into method label _BST parent_hid PNP0C0A code_regex \(\^\^EC0\.BAC0\, replaceall_matched begin (B1B2(^^EC0.AC00,^^EC0.AC01), end;
# Fix 16-bit Method Writes
into method label FANW parent_hid PNP0C09 code_regex Store\s+\((.*),\sERIB\) replaceall_matched
begin
Store(%1,IB00)
Store(ShiftRight(%1,8),IB01)
end;
into method label FANG code_regex Store\s+\((.*),\sERIB\) replaceall_matched
begin
Store(%1,IB00)
Store(ShiftRight(%1,8),IB01)
end;
# Fix 128b Registers
into device label EC0 code_regex BATN,\s+128, replace_matched begin BATX, 128, // Was BATN end;
# Store (^^EC0.BATN, Index (STAT, 0x09))
into method label _BIF code_regex Store\s\(\^\^EC0\.BATN\,(.*)\) replace_matched
begin
Store(^^EC0.RECB(0x10,128),%1)
end;
# utility methods to read/write buffers from/to EC by RehabMan
into method label RE1B parent_label EC0 remove_entry;
into method label RECB parent_label EC0 remove_entry;
into device label EC0 insert
begin
Method (RE1B, 1, Serialized)\n
{\n
OperationRegion(ERAM, EmbeddedControl, Arg0, One)\n
Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
{\n
ShiftRight(Arg1, 3, Arg1)\n
Name(TEMP, Buffer(Arg1) { })\n
Add(Arg0, Arg1, Arg1)\n
Store(Zero, Local0)\n
While (LLess(Arg0, Arg1))\n
{\n
Store(RE1B(Arg0), Index(TEMP, Local0))\n
Increment(Arg0)\n
Increment(Local0)\n
}\n
Return(TEMP)\n
}\n
end;
into method label WE1B parent_label EC0 remove_entry;
into method label WECB parent_label EC0 remove_entry;
into device label EC0 insert
begin
Method (WE1B, 2, Serialized)\n
{\n
OperationRegion(ERAM, EmbeddedControl, Arg0, One)\n
Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
Store(Arg1, BYTE)\n
}\n
Method (WECB, 3, Serialized)\n
{\n
ShiftRight(Arg1, 3, Arg1)\n
Name(TEMP, Buffer(Arg1) { })\n
Store(Arg2, TEMP)\n
Add(Arg0, Arg1, Arg1)\n
Store(Zero, Local0)\n
While (LLess(Arg0, Arg1))\n
{\n
WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
Increment(Arg0)\n
Increment(Local0)\n
}\n
}\n
end;
Lid Sleep
Code:
# Add Lid Sleep Button Device
into device label SLPB parent_label _SB remove_entry;
into scope label _SB insert begin
Device (SLPB)\n
{\n
Name (_HID, EisaId ("PNP0C0E"))\n
}
end;
# Modify Device LID0
into method label _LID parent_hid PNP0C0D replace_content begin
If (LPOL) { } Else { Notify(SLPB,0x80) } Return (LPOL)
end;
More to come.
---------- Post added at 10:24 PM ---------- Previous post was at 10:09 PM ----------
While I'm info dumping, here's the mach_kernel binary patch for the 10.6.8 kernel to boot on an Intel Atom (not needed with modern bootloaders).
Code:
1:
Find:
0F B6 05 6F 1B 69 00 C1 E0 04 00 05 65 1B 69 00
Replace:
B8 0F 00 00 00 88 05 6A 1B 69 00 90 90 90 90 90
2:
Find:
0F B6 05 8A 2D 87 00 C1 E0 04 00 05 89 2D 87 00
Replace:
B8 0F 00 00 00 A2 89 2D 87 00 90 90 90 90 90 90
And the node ID pathmaps for the ALC272 codec in the 10v
Code:
Pathmaps:
Line in
Complex 18
Selector 34
input 9
Mic
Complex 25
Mixer 35
input 8
Internal Speaker-
Pin Complex 20
Mixer 12
Output 2
Headphone
Pin Complex 33
Mixer 12
Output 2
Available c-state options for a Mini10v with a n280
Code:
# Dell Mini 10v C States
# Harvested from SSDT5, CPU0cst
# Dell Mini10v Combinations
# FixedHW
# 0x0000000000000000 [access size 0x01]
# 0x0000000000000000, 0x0000000000000010, 0x0000000000000052 //c1, c2, c5(?)
# 0x0000000000000000, 0x0000000000000010, 0x0000000000000030 //c1, c2, c4
# 0x0000000000000000, 0x0000000000000010, 0x0000000000000020 //c1, c2, c3
# 0x0000000000000000, 0x0000000000000010 //c1, c2
# SystemIO [no access size bit]
# 0x0000000000000000
# 0x0000000000000000, 0x0000000000001014, 0x0000000000001018
# 0x0000000000000000, 0x0000000000001014, 0x0000000000001016
# 0x0000000000000000, 0x0000000000001014, 0x0000000000001015
# 0x0000000000000000, 0x0000000000001014
# FixedHW States (Use with _PSS Values)
#c1 Use for both SystemIO and FixedHW
Package (0x04)
{
ResourceTemplate ()
{
Register (FFixedHW,
0x00, // Bit Width
0x00, // Bit Offset
0x0000000000000000, // Address
0x01, // Access Size
)
},
0x01,
0x9D,
0x03E8
},
#c2
Package (0x04)
{
ResourceTemplate ()
{
Register (FFixedHW,
0x01, // Bit Width
0x02, // Bit Offset
0x0000000000000010, // Address
0x01, // Access Size
)
},
0x02,
0x14,
0x01F4
},
#c3
Package (0x04)
{
ResourceTemplate ()
{
Register (FFixedHW,
0x01, // Bit Width
0x02, // Bit Offset
0x0000000000000020, // Address
0x03, // Access Size
)
},
0x03,
0x3C,
0xFA
}
#c4
Package (0x04)
{
ResourceTemplate ()
{
Register (FFixedHW,
0x01, // Bit Width
0x02, // Bit Offset
0x0000000000000030, // Address
0x03, // Access Size
)
},
0x03,
0x64,
0x64
#unknown (c5?)
Package (0x04)
{
ResourceTemplate ()
{
Register (FFixedHW,
0x01, // Bit Width
0x02, // Bit Offset
0x0000000000000052, // Address
0x03, // Access Size
)
},
0x03,
0x8C,
0x0A
}
# SystemIO States (Use with SPSS Values)
#c2
Package ()
{
ResourceTemplate ()
{
Register (SystemIO,
0x08, // Bit Width\n
0x00, // Bit Offset\n
0x0000000000001014, // Address\n
,)
},
0x02,
0x14,
0x01F4
},
#c3
Package (0x04)
{
ResourceTemplate ()
{
Register (SystemIO,
0x08, // Bit Width
0x00, // Bit Offset
0x0000000000001015, // Address
,)
},
0x03,
0x3C,
0xFA
}
c4
Package (0x04)
{
ResourceTemplate ()
{
Register (SystemIO,
0x08, // Bit Width
0x00, // Bit Offset
0x0000000000001016, // Address
,)
},
0x03,
0x64,
0x64
}
#c5
Package (0x04)
{
ResourceTemplate ()
{
Register (SystemIO,
0x08, // Bit Width
0x00, // Bit Offset
0x0000000000001018, // Address
,)
},
0x03,
0x8C,
0x0A
}
Processor P-States for N280
Code:
# Dell Mini 10v P-States
# Harvested from SSDT4 CPU0ist
# _PSS [Use with FixedHW (missing NPSS?)]
Package (0x06)
{
0x00000683,
0x000088B8,
0x0000000A,
0x0000000A,
0x00000A23,
0x00000A23
},
Package (0x06)
{
0x00000535,
0x000061A8,
0x0000000A,
0x0000000A,
0x0000081B,
0x0000081B
},
Package (0x06)
{
0x000003E8,
0x00003E80,
0x0000000A,
0x0000000A,
0x00000613,
0x00000613
}
# SPSS [Use with System IO Values]
Package (0x06)
{
0x00000683,
0x000088B8,
0x0000006E,
0x0000000A,
0x00000083,
0x00000000
},
Package (0x06)
{
0x00000535,
0x000061A8,
0x0000006E,
0x0000000A,
0x00000183,
0x00000001
},
Package (0x06)
{
0x000003E8,
0x00003E80,
0x0000006E,
0x0000000A,
0x00000283,
0x00000002
}
And here's a work in progress patch for native power management/speedstepping
Code:
REDACTED - see post 2
Dell mini 10v OSx 10.6.2 | Windows 7
Last edited by shines on; 05-30-2015 at 04:04 PM.
|