- Joined
- Dec 11, 2015
- Messages
- 17
- Motherboard
- Dell Latitude 3330-Clover
- CPU
- i5-3337U/HM77
- Graphics
- HD4000 1366x768
- Mac
While making progress on my Dell Latitude 3330 I have encountered an issue while making the battery status work.
After reading the guide I found out I was very lucky as all my EC fields are 8 bit.
However after installing ACPIBatteryManager.kext the battery status was not working. By debugging the DSDT with ACPIDebug.kext I found that the _STA method of BAT0 was not returning. Digging deeper I found that it was hanging in the SNVC method, because the SMIB value was 0x00.
Reading the above lines I thought the SMIB value should be 0xDA7D6000 instead of 0x00. Thus I applied the following hack:
Now the battery status is working! See also this excerpt from the log:
While it is working, this hack does not seem "right". Why is SMIB 0x00? I have searched my DSDT to find out if anything is overwriting the SMIB variable, but could not find anything.
How is it possible that SMIB is 0x00?
Attached:
Some background information:
config.plist based on https://github.com/RehabMan/OS-X-Clo...1366x768.plist with one AppleIntelFramebufferCapri patch added.
Custom kexts in /Library/Extensions/:
ACPIBatteryManager.kext
ACPIDebug.kext
IntelBacklight.kext
/Volumes/EFI/EFI/CLOVER/kexts/Other/
AppleIntelE1000e.kext
FakeSMC_ACPISensors.kext
FakeSMC_GPUSensors.kext
VoodooPS2Controller.kext (extracted from Vietnam tools for ALPS)
FakeSMC.kext
FakeSMC_CPUSensors.kext
FakeSMC_LPCSensors.kext
Extracted DSDT with Fedora and applied these patches:
[syn] Fix *pnp/pnp lower case Error
[igpu] Rename GFX0 to IGPU
[igpu] Brightness fix
[sys] Fix Mutex with non-zero SyncLevel
[sys] IRQ Fix
[sys] OS Check Fix (Windows 7)
[sys] Add IMEI
[sys] RTC Fix
[sys] SMBUS Fix
[sys] Fix PNOT/PPNT
After reading the guide I found out I was very lucky as all my EC fields are 8 bit.
However after installing ACPIBatteryManager.kext the battery status was not working. By debugging the DSDT with ACPIDebug.kext I found that the _STA method of BAT0 was not returning. Digging deeper I found that it was hanging in the SNVC method, because the SMIB value was 0x00.
Code:
Scope (\)
{
Mutex(SMIX, 0)
Name (SMIB, 0xDA7D6000)
Name (PSMI, 0x000000B2)
Method (SNVC, 1, NotSerialized)
{
\RMDT.P2 ("SNVC value SMIB = ", SMIB)
OperationRegion (WWPR, SystemMemory, SMIB, 0x04)
Field (WWPR, DWordAcc, Lock, Preserve)
{
SCDW, 32
}
Store (Arg0, SCDW)
}
Reading the above lines I thought the SMIB value should be 0xDA7D6000 instead of 0x00. Thus I applied the following hack:
Code:
\RMDT.P2 ("SNVC value SMIB = ", SMIB)
If (LEqual (SMIB, Zero))
{
\RMDT.PUSH ("SNVC patch SMIB value")
Store (0xDA7D6000, SMIB)
}
OperationRegion (WWPR, SystemMemory, SMIB, 0x04)
Now the battery status is working! See also this excerpt from the log:
Code:
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: starting ACPIACAdapter.
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: Version 0.1.4 starting on OS X Darwin 15.2.
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0x0, }
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "SNVC patch SMIB value"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _STA enter"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _STA return 0x1F"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _STA enter"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _STA return 0x1F"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT1 _STA enter"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT1 _STA return 0x00"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT2 _STA enter"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT2 _STA return 0x00"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPISensors (THM): 1 sensor added
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: AppleSmartBatteryManager::init: Initializing
Jan 8 20:55:18 localhost kernel[0]: ACPISensors (THM): started
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: AppleSmartBatteryManager::probe: Probing
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: AppleSmartBatteryManager::start: called
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: Version 1.60.5 starting on OS X Darwin 15.2.
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: AppleSmartBatteryManager::setPowerState: which = 0x1
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: Using ACPI regular battery information method _BIF
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: clearBatteryState: do_update = false
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: rebuildLegacyIOBatteryInfo called
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "SNVC value SMIB = ", 0xda7d6000, }
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: pollBatteryState: path = 2
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: pollBatteryState: path = 1
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: getBatterySTA called
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _STA enter"
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: setBatterySTA: battery_status = 0x1f
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: getBatteryBIF called
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: validateObject return 0x0
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _STA return 0x1F"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _BIF enter"
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "BAT0 _BIF return ", { 0x1, 0x16e0, 0x14b7, 0x1, 0x2b5c, 0x249, 0xb1, 0x3a, 0x3a, { 44 45 4c 4c 20 4d 30 50 37 50 33 31 00 }, { 33 33 32 35 00 }, { 4c 49 4f 4e 00 }, { 53 4d 50 00 }, }, }
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: setBatteryBIF: acpibat_bif size = 13
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fPowerUnit = 0x1
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fDesignCapacityRaw = 5856
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fMaxCapacityRaw = 5303
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fBatteryTech = 0x1
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fDesignVoltage = 11100
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fCapacityWarningRaw = 0
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fLowWarningRaw = 0
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fDeviceName = 'DELL M0P7P31'
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fSerialNumber = '3325'
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fType = 'LION'
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fManufacturer = 'SMP'
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: getBatteryBST called
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: "BAT0 _BST enter"
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: setBatteryBST: acpibat_bst size = 4
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fPowerUnit = 0x1
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: currentStatus = 0x1
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fCurrentRate = 1115
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fCurrentCapacity = 3652
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fCurrentVoltage = 11819
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: fAverageRate = 1115
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: AppleSmartBattery: Battery is discharging.
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: constructAppleSerialNumber called
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: rebuildLegacyIOBatteryInfo called
Jan 8 20:55:18 localhost kernel[0]: ACPIBatteryManager: entering addBatteryManager(<ptr>)
Jan 8 20:55:18 localhost kernel[0]: ACPIDebug: { "BAT0 _BST return ", { 0x1, 0x45b, 0xe44, 0x2e2b, }, }
While it is working, this hack does not seem "right". Why is SMIB 0x00? I have searched my DSDT to find out if anything is overwriting the SMIB variable, but could not find anything.
How is it possible that SMIB is 0x00?
Attached:
Some background information:
config.plist based on https://github.com/RehabMan/OS-X-Clo...1366x768.plist with one AppleIntelFramebufferCapri patch added.
Custom kexts in /Library/Extensions/:
ACPIBatteryManager.kext
ACPIDebug.kext
IntelBacklight.kext
/Volumes/EFI/EFI/CLOVER/kexts/Other/
AppleIntelE1000e.kext
FakeSMC_ACPISensors.kext
FakeSMC_GPUSensors.kext
VoodooPS2Controller.kext (extracted from Vietnam tools for ALPS)
FakeSMC.kext
FakeSMC_CPUSensors.kext
FakeSMC_LPCSensors.kext
Extracted DSDT with Fedora and applied these patches:
[syn] Fix *pnp/pnp lower case Error
[igpu] Rename GFX0 to IGPU
[igpu] Brightness fix
[sys] Fix Mutex with non-zero SyncLevel
[sys] IRQ Fix
[sys] OS Check Fix (Windows 7)
[sys] Add IMEI
[sys] RTC Fix
[sys] SMBUS Fix
[sys] Fix PNOT/PPNT