Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nanosector/840g2-opencore-config

OpenCore configuration for EliteBook 840 G2
https://github.com/nanosector/840g2-opencore-config

Last synced: about 1 month ago
JSON representation

OpenCore configuration for EliteBook 840 G2

Awesome Lists containing this project

README

        

# 840g2-opencore-config
OpenCore configuration for my Elitebook.

# OpenCore version tested with: 0.8.0
## macOS version tested with: 12.1
Please do not use this with any newer or older version as some options may no longer exist or be interpreted differently, or new options may be needed in order to successfully boot.

# Specs
- System: HP Elitebook 840 G2
- CPU: i5 5200U
- GPU: Intel HD Graphics 5500
- RAM: 16 GB Kingston 1600 MHz DDR3
- SSD: 256 GB Samsung 830
- Wifi: Fenvi Broadcom BCM94352Z
- Ethernet: Intel I218LM
- Audio: Realtek ALC280
- Card reader: Realtek RTS5227

# BIOS Settings (version 1.48)
## TODO: UPDATE THIS
Settings not specified are left on their default values or are unimportant.

- [ ] = unchecked
- [x] = checked

- Boot Options:
- [ ] Fast Boot
- [ ] All boot options except USB boot and Customized boot
- [ ] Secure Boot
- Boot mode: `UEFI Native (Without CSM)`
- Device Configurations
- [ ] USB Legacy Support
- [x] USB 3.0 (XHCI)
- Video memory size: `64 MB`
- [ ] Wake on USB
- [x] VT-x
- [ ] VT-d
- Deep sleep: `Off`
- Built-In Device Options
- [ ] Wireless Button State
- [ ] LAN/WLAN switching
- Wake on LAN: `Disable` -> System will instantly wake from sleep with this enabled.
- Port Options
- [ ] Flash Media Reader -> Doesn't work anyway, see current issues below.

# OpenCore config noteworthy things
- SIP is completely enabled
- The system is set to play the startup beep/bong on its internal speaker. Drop the Resources folder from [OcBinaryData](https://github.com/acidanthera/OcBinaryData) in your EFI/OC folder. Strip out the excess files for languages you don't use for faster bootup times.

## ScanPolicy enabled flags
ScanPolicy is set to a value of `65795` or binary `000000010000000100000011`. This means the following flags are set:

- `OC_SCAN_FILE_SYSTEM_LOCK` (bit 0)
- `OC_SCAN_DEVICE_LOCK` (bit 1)
- `OC_SCAN_ALLOW_FS_APFS` (bit 8)
- `OC_SCAN_ALLOW_DEVICE_SATA` (bit 16)

Please refer to the OpenCore manual for the meaning of these flags. In short, these flags allow scanning of APFS partitions (for macOS) on SATA and USB drives only. The USB part should be temporary.

# ACPI edits
See the ACPI subfolder.

- `BATC`: Combines both the built-in and external batteries together in one device
- `BATM`: Overrides methods using both batteries which are renamed with ACPI patches
- `EC`: Provides a laptop EC device
- `HP-FixLidSleep`: Does what it says on the tin. Mutes a sleep key event generated when the lid is closed, causing massive key spam before sleep
- `HPET`: Fixes some conflicting IRQs. Works together with a couple ACPI patches defined in config.plist
- `PLUG`: Sets `plugin-type` to 1, needed for AGPM and proper CPU power management.
- `PNLF`: Backlight patches, copied from WhateverGreen
- `SBUS-MCHC`: SMBus fixes
- `XOSI`: Overrides the OSI method to enable more Windows-only features

# Device Properties
- `PciRoot(0x0)/Pci(0x1b,0x0)`: Realtek ALC280
- `layout-id`: `3`, used to tell AppleALC which layout ID to pick to get the onboard sound working.
- `PciRoot(0x0)/Pci(0x2,0x0)`: Intel HD Graphics 4400
- `ig-platform-id`: `0x16260006` (reversed)
- `force-online`: `0x00000001` (reversed)

# Drivers
Not included in this repo, I use the following drivers:

- [AudioDxe](https://github.com/acidanthera/OpenCorePkg) TODO: Implement chime support
- [HFSPlus](https://github.com/acidanthera/OcBinaryData/blob/master/Drivers/HfsPlus.efi)
- OpenRuntime (in the OpenCore package)

# Kexts
Not included in this repo, I use the following kexts:

- [AppleALC](https://github.com/acidanthera/AppleALC): Used to get the onboard audio working
- [CPUFriend](https://github.com/acidanthera/CPUFriend): Used to fix CPU power management
- [CPUFriendFriend](https://github.com/corpnewt/CPUFriendFriend) is used to generate CPUFriendDataProvider.kext
- [ECEnabler](https://github.com/1Revenger1/ECEnabler): Battery status
- [IntelMausi](https://github.com/acidanthera/IntelMausi): Driver for the built-in Ethernet controller
- [Lilu](https://github.com/acidanthera/Lilu): Requirement for most other kexts in this list
- [Sinetek-rtsx](https://github.com/cholonam/Sinetek-rtsx): For the PCIe card reader
- [RTCMemoryFixup](https://github.com/acidanthera/RTCMemoryFixup): Fixup kext for RTC memory
- [VirtualSMC](https://github.com/acidanthera/VirtualSMC): SMC emulator (+ SMCBatteryManager + SMCProcessor + SMCSuperIO)
- USBToolBox + UTBMap: Generated by [USBToolbox](https://github.com/USBToolBox/tool)
- [VoodooPS2Controller](https://github.com/acidanthera/VoodooPS2): Base driver for the trackpad and keyboard
- [VoodooRMI & VoodooSMBus](https://github.com/VoodooSMBus/VoodooRMI): Synaptics touchpad driver
- [WhateverGreen](https://github.com/acidanthera/WhateverGreen): Required for proper functioning of the integrated graphics

# Current issues

## Secondary battery hotplug
- Hotplugging a second battery is not consistent and usually requires an AC adapter re-plug

## Inconsistent black screen after lid open

**Maybe fixed? CPUFriend with the included data provider seems to eliminate this issue. Leaving this here for reference or for when the issue decides to pop up again.**
One small issue is that you need to sleep the system, wake it up and then wake the screen at least twice after sleep (press Esc and then any key). But after this it seems to consistently work. No idea why.

-----

Sometimes the system wakes to a black screen, waking it again a few more times fixes the issue randomly.

Observations:
- External displays are not affected, although they sometimes fail to initialize as well.
- It is not limited to sleep as originally thought
- `force-online` property has no effect (neither does force-online-framebuffers with framebuffer 0)
- `disable-agdc` property has no effect so AGDC isn't causing this(?)
- Brightness keys give an invalid key sound effect when pressed in this state - maybe macOS assumes the display to be unavailable?
- It seems to work better while plugged in to the AC adapter

Logs with a failed attempt seem to repetitively indicate the following:

```
kernel: (AppleIntelBDWGraphicsFramebuffer) FB0 power state transition Doze --> Wake
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Lighting up display at index 0 in resume from sleep
kernel: (AppleIntelBDWGraphicsFramebuffer) FB0: Complete modeset
kernel: (AppleIntelBDWGraphicsFramebuffer) Clock recovery failed..
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping linearization as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) FB0 power state transition complete
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 150270
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received for fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Setting display mode on index 0 1600 x 900 -> 0 x 0 encoded with 0x0 0 bpc with color 0 and range 0, Pixelclock = 119400000
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] CD Clock Reg value in the End = 0X4c000000
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 150352
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeDidChange notification received for fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping the flip as intended
...repeats a couple times...
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping setting of gamma as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 150603
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 4->1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x0, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 150689
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAADidExitDefer notification received for fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 1 at time 150690
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 4->1
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 1 at time 150690
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAADidExitDefer notification received for fb 1
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 2 at time 150690
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 4->1
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 2 at time 150690
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAADidExitDefer notification received for fb 2
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x0, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x0, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x0, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Blanking out the screen without black gamma
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 151999
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAAWillEnterDefer notification received for fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Blanking out the screen without black gamma
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 1->4
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 152097
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 1 at time 152097
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAAWillEnterDefer notification received for fb 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 1->4
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 1 at time 152097
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 2 at time 152097
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAAWillEnterDefer notification received for fb 2
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 1->4
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 2 at time 152097
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Blanking out the screen without black gamma
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Blanking out the screen without black gamma
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Blanking out the screen without black gamma
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Blanking out the screen without black gamma
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Blanking out the screen without black gamma
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x2, fLiveState = 0x0 fOnline: 1
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2
kernel: (AppleIntelBDWGraphicsFramebuffer) Reporting Fake VBL for pipe 0 on Fb 0
```

A successful attempt later down the line:
```
kernel: (AppleIntelBDWGraphicsFramebuffer) FB0 power state transition Doze --> Wake
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Lighting up display at index 0 in resume from sleep
kernel: (AppleIntelBDWGraphicsFramebuffer) FB0: Complete modeset
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping linearization as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) FB0 power state transition complete
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 157984
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received for fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Setting display mode on index 0 1600 x 900 -> 0 x 0 encoded with 0x0 0 bpc with color 0 and range 0, Pixelclock = 119400000
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] CD Clock Reg value in the End = 0X4c000000
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 158038
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeDidChange notification received for fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping the flip as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping setting of gamma as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping the flip as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping setting of gamma as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping the flip as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Changes not allowed. Skipping setting of gamma as intended
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 158235
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 4->1
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 0 at time 158258
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAADidExitDefer notification received for fb 0
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 1 at time 158258
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 4->1
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 1 at time 158258
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAADidExitDefer notification received for fb 1
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 2 at time 158258
kernel: (AppleIntelBDWGraphicsFramebuffer) [IGFB][INFO ] Transitioning wsaa from 4->1
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyDisplayModeWillChange notification received on Fb 2 at time 158258
kernel: (AppleIntelBDWGraphicsFramebuffer) kIOFBNotifyWSAADidExitDefer notification received for fb 2
```

## Trackpoint doesn't work
I don't care, it's better this way. Probably requires an ACPI patch to get working.

## Wireless button is always orange
Minor "issue", not sure how I could fix this. Wifi works fine so I'm probably not going to bother.