Contribute
Register

[Guide] How to patch DSDT for working battery status

Ok for the past few days I have been trying everything I can to get as much working on my HP EliteBook x360 1030 G3 with an i7-8650U and Clover. However I never figured out the battery Indicator and the Webcam. So I went after Open Core and OMG is totally different beast.

I did find someone's config from another HP with a similar CPU and I started messing with that config, it was for Big Sur but I added the EFI to my Catalina USB and started to mess with it. After a lot of messing around with the config.plist and using his ACPI files and adding some more ACPI files and kexts I managed to get.

Catalina with latest update working with

Sound with boot arguments in config.plist and AppleALC.kext
Intel HD Graphics 620 with some stuff added to config.plist
Internal Wifi with itlwm.kext
Bluetooth with IntelBluetoothFirmware.kext and IntelBluetoothInjector.kext
TouchPad worked great with that EFI and the kexts files that were in it
Touch Screen worked out of the box with the settings and kext files in the EFI folder
Brightness and Volume hot keys working
Battery Indicator working

Not working
Webcam - with USBInjectAll.kext I can see it and the system sees it but anything that wants to use it can't use it. It just shows a black screen

Really the only thing I would like to fix is the webcam now but I can't figured it out, Not sure which kexts or settings take care of it. I'm using OpenCore now
 
Ok for the past few days I have been trying everything I can to get as much working on my HP EliteBook x360 1030 G3 with an i7-8650U and Clover. However I never figured out the battery Indicator and the Webcam. So I went after Open Core and OMG is totally different beast.

I did find someone's config from another HP with a similar CPU and I started messing with that config, it was for Big Sur but I added the EFI to my Catalina USB and started to mess with it. After a lot of messing around with the config.plist and using his ACPI files and adding some more ACPI files and kexts I managed to get.

Catalina with latest update working with

Sound with boot arguments in config.plist and AppleALC.kext
Intel HD Graphics 620 with some stuff added to config.plist
Internal Wifi with itlwm.kext
Bluetooth with IntelBluetoothFirmware.kext and IntelBluetoothInjector.kext
TouchPad worked great with that EFI and the kexts files that were in it
Touch Screen worked out of the box with the settings and kext files in the EFI folder
Brightness and Volume hot keys working
Battery Indicator working

Not working
Webcam - with USBInjectAll.kext I can see it and the system sees it but anything that wants to use it can't use it. It just shows a black screen

Really the only thing I would like to fix is the webcam now but I can't figured it out, Not sure which kexts or settings take care of it. I'm using OpenCore now
I have the same system but brightness keys do not work, can you guide me how to get them working ?
 
I used this EFI to get me started


It took adding a few extra kexts and patches to get past the errors before it got to the installation point. But even on the installation screen touch screen was working and the brightness and volume hot keys worked right after installation
 
Hello, everyone.

I'm having problems with battery hotpatch. I got the static patch in DSDT perfectly.

At start, the laptop shows 3 or 4 problems with method BTST. I thought that would be a rename problem but the renames are OK.

These are my problem files.

Thank you so much.
 

Attachments

  • debug_5213.zip
    1.4 MB · Views: 101
  • IMG_4409.jpg
    IMG_4409.jpg
    310.2 KB · Views: 92
Hello, everyone.

I'm having problems with battery hotpatch. I got the static patch in DSDT perfectly.

At start, the laptop shows 3 or 4 problems with method BTST. I thought that would be a rename problem but the renames are OK.

These are my problem files.

Thank you so much.
missing your clover folder

also best to keep your kexts in your efi
 
How to patch DSDT for working battery status



The only problem I found was in this line in _BTP:
Code:
                                Store (Local0, ^^PCI0.LPCB.H_EC.BTPC)

Needs this patch:
Code:
into method label _BTP code_regex Store\s\((.*),\s\^\^PCI0\.LPCB\.H_EC\.BTPC\) replace_matched
begin
Store(ShiftRight(%1,8), ^^PCI0.LPCB.H_EC.BPC1) Store(%1, ^^PCI0.LPCB.H_EC.BPC1)
end;

The other patch related to _BTP is not effective and so I removed it.
Thanks for the fix, I ran into this problem as well.
Why is BPC1 used twice? What happens to BPC0?
 
Offset is used to change the offset of the next field.
By definition, any field that directly follows Offset(X) is at offset X.
Read the ACPI specification.



Wrong. BCT0 is at offset 0x2f (0x20 + (120/8)).

Now I am completely lost again why is the final offset 0x2f? The previous offset is 0x21 and not 0x20 in my example above. 0x21 to decimal is 33 plus 120/8 which is 15. 15 plus 33 is 48 and 48 decimal converted back to hexadecimal is 0x30.

Rehabman is not around anymore to answer maybe Feartech or someone with complete knowledge of offsets can let me know why this is 0x2f rather than 0x30. Thanks!

Edited:

The other question becomes are the calculations of offsets based on the ones already coded in the DSDT, even if there are fields 3-4 deep for example? I know they are for the next field but the following field is that value based off the original offset in the DSDT or the offset you calculate for the 2nd and 3rd etc fields before you come across the next offset already set in the DSDT. This was not explained well at all.



Edited:

Never-mind it is from the first Offset set by the DSDT then you use that converted to decimal and add this each time.

Edited Again:

Actually what he replied to me with is incorrect because if I go by exactly what he wrote for my DSDT example then in his DSDT example from the original post his BCT0 would be calculated at offset 0x2B and not 0x30.
 
Last edited:
Back
Top