• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

bavariancake/XPS9570-macOS: macOS Mojave/Catalina on Dell XPS 9570.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

bavariancake/XPS9570-macOS

开源软件地址(OpenSource Url):

https://github.com/bavariancake/XPS9570-macOS

开源编程语言(OpenSource Language):

Rich Text Format 73.7%

开源软件介绍(OpenSource Introduction):

Overview

Run macOS Mojave (10.14) or Catalina (10.15) on a Dell XPS 9570.

Most pieces are fully supported, and this setup can be used as your main machine. A few pieces are missing (and some will probably never be supported); see Known Problems/Caveats in the Hardware section.

The EFI folder can be used to boot into a USB installer, or for regular booting.

Tested hardware configuration

  • Dell XPS 9570
    • CPU: Intel i9-8950HK
    • Memory: 32GB 2x SK Hynix HMA82GS6CJR8N-VK
    • Display: 4k Sharp
    • SSD: Toshiba 2TB KXG50PNV2T04
    • Trackpad: Synaptics SYNA2393
    • Touchscreen: Wacom WCOM488F
    • Sound: Realtek ALC3266 (similar to ALC298)
    • Goodix fingerprint reader
    • Dell 6GTPY battery (11.4V, 8083mAh, 97Wh stated capacity, reports as 7488mAh)
  • Software environment
    • Dual-booting Windows 10

Tested software configurations

  • macOS Mojave: 10.14.0 - 10.14.6 (builds 18G84, 18G87, 18G95, 18G103, 18G1012)
  • macOS Catalina: 10.15 - 10.15.3
  • BIOS: 1.5.0 - 1.15.0

Hardware

Graphics

Integrated Intel UHD Graphics 630 support is handled by WhateverGreen, and configured in the PciRoot(0x0)/Pci(0x2,0x0) section of config.plist. The Nvidia GPU is not supported due to hardware differences and lack of driver support in macOS. It is disabled to save power.

Choose a DPCD maximum link rate for your display, where 4K=0x14 (default) or 1080p=0x0a.

To determine if Intel GPU (IGPU) acceleration is working, check: About This Mac -> Intel UHD Graphics 630 1536 MB. A value less than 1536MB indicates a problem (e.g. 7MB or 31MB are common).

The default BIOS DVMT pre-alloc value of 64MB is sufficient and does not need to be changed.

The IGPU supports up to 3 displays simultaneously, including the internal LCD. The type C port supports up to two DisplayPort connections with an adapter. Even though you could connect three external displays (HDMI + 2 DisplayPort via type C), one of these displays would remain powered off. This is a limitation of IGPU, which has 3 pipelines for driving displays, one per display.

Enabling acceleration

  • config.plist
    • Graphics/Inject/Intel=no
    • Devices/Properties/PciRoot(0x0)/Pci(0x2,0x0)
      • AAPL,ig-platform-id = <00009b3e>
      • device-id =<9b3e0000>
      • dpcd-max-link-rate =<14000000> (or <0a000000> for 1080p)
      • enable-dpcd-max-link-rate-fix =<01000000>
      • framebuffer-patch-enable =<01000000>
  • Install Lilu kext
  • Install WhateverGreen kext

Enabling backlight control via slider in Sys. Prefs. -> Displays

Enabling external display support

Without any options passed to WhateverGreen, a KP will occur whenever an HDMI device is attached. @0xFireWolf provided HDMI output support (HDMI 1.4 and 2.0) by adding LSPCON support to WhateverGreen.

Up to two 4k@60Hz DisplayPort connections are supported via type C with adapter, and HDMI can also be connected. However, the internal display will turn off if three external displays are connected (see Intel GPU limitation above).

Connector 0 is the internal LCD, connectors 1 and 2 are DisplayPort via type C, and connector 3 is HDMI. The boot argument agdpmod=vit9696 is required to disable board checks, since the MacBookPro15,1 doesn’t have an HDMI output, and would be ignored by the OS by default.

Enabling HDMI 1.4/2.0 and DisplayPort via type C connector

  • config.plist
    • Boot/Arguments
      • agdpmod=vit9696
    • Devices/Properties/PciRoot(0x0)/Pci(0x2,0x0)
      • framebuffer-portcount = <04000000>
      • framebuffer-con1-enable = <01000000>
      • framebuffer-con1-alldata = <01050900 00040000 87010000>
      • framebuffer-con2-enable = <01000000>
      • framebuffer-con2-alldata = <02060900 00040000 87010000>
      • framebuffer-con3-enable = <01000000>
      • framebuffer-con3-alldata = <03040a00 00080000 87010000>
      • enable-hdmi20 = <01000000>
      • enable-lspcon-support = <01000000>
      • framebuffer-con3-has-lspcon = <01000000>
      • framebuffer-con3-preferred-lspcon-mode = <01000000>

Known problems/caveats

  • IGPU graphics can be slightly choppy on a scaled external 4k monitor

PS/2 Keyboard

The internal keyboard is a PS/2 device, but macOS does not support PS/2. This can be implemented with VoodooPS2Controller.

Installation

Debugging key codes

  • Install debug version of VoodooPS2Controller
  • Log key codes captured
    log stream | sed -n 's/.*\(ApplePS2Keyboard: sending key\)/\1/p'
        

Known problems/caveats

  • Can cause reboot on startup (intermittent)
  • Keyboard options like modifier key settings cause an erratic/disabled keyboard For key remapping, see SSDT-PS2-Keymap.dsl above. Key repeat speed and delay are ok to change.
  • Can’t wake up from sleep with internal keyboard
  • Enables poor quality trackpad by default

Wi-Fi/Bluetooth

Based on Broadcom Wi-Fi Bluetooth Guide, and see threads one and two.

One possible replacement card is the Dell DW1830, based on the Broadcom BCM943602BAED. I’ve used this card here (purchased on EBay), although it’s currently a bit expensive at around $50. Dell no longer offers this card directly.

This card has three antennas, while the XPS 9570 has only two antennas in the display. To get full Wi-Fi speed, a third antenna with a U.FL MHF4 (thanks romton843!) connector must be added. This antenna can be placed in a small gap next to the battery. It’s OK to leave J2 unconnected, however - modern network cards should recognize this and disable the 3rd port. Without the 3rd antenna, I’m able to get speeds up to about 800Mbps.

Connectors J0, J1, J2 should be connected as follows (see installation example):

  • J0: white antenna cable to display (primary)
  • J1: black antenna cable to display (Bluetooth/secondary)
  • J2: extra retrofitted antenna next to battery

The DW1830 Wi-Fi card is based on the Broadcom BCM943602BAED, using BCM43602 for Wi-Fi and BCM20703 for Bluetooth. While Wi-Fi works by default, it shows up as a “Third-Party Wireless Card” in System Information unless AirportBrcmFixup is installed, and Bluetooth requires kexts from OS-X-BrcmPatchRAM.

Side note: romton843 explains that U.FL connectors are 2mm and white, while MHF4 are 1.5mm and black.

Installation

  • Include AirportBrcmFixup AirportBrcmFixup.kext for Wi-Fi
  • Include BrcmPatchRAM BrcmBluetoothInjector.kext, BrcmPatchRAM3.kext, and BrcmFirmwareData.kext for Bluetooth (for installation to CLOVER/kexts/Other)
  • After swapping out Wi-Fi card, reset Bluetooth info (e.g. to fix AirDrop)
    • Turn off Bluetooth
    • sudo rm -f /Library/Preferences/com.apple.Bluetooth.plist*
    • Reboot and turn on Bluetooth
  • Ensure that Wi-Fi adapter’s BSD name is en0
    • SysPrefs -> Click on Network dropdown -> BSD Device Name for Wi-Fi not en0? Continue below, otherwise skip.
    • sudo rm -f /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
    • sudo rm -f /Library/Preferences/SystemConfiguration/preferences.plist
    • Reboot

Testing Wi-Fi speed

By default, AirportBrcmFixup seems to limit Wi-Fi channel width for 802.11ac to 40MHz instead of 80MHz, even though the country code defaults to US. The workaround is to disable the country code setting with the boot flag brcmfx-country=#a (config.plist).

If you have an 802.11ac capable access point, place the XPS 9570 next to it and option-click on the Wi-Fi icon. After a few minutes, you should see a line like Channel: 165 (5 GHz, 80 MHz) with Tx Rate below it of 800 Mbps or higher. A congested Wi-Fi environment in an apartment building could reduce this rate.

Messages and FaceTime setup

The above installation steps prepare the way for Messages and FaceTime to work as well, but there are more in-depth guides to Messages here and here if needed.

If there are issues with continuity (switching calls between macOS and iPhone for example), BT4LEContiunityFixup.kext may help fix those, but seems to not be needed for the DW1830.

Remove stale Messages and FaceTime data:

rm -rf ~/Library/Caches/com.apple.Messages
rm -rf ~/Library/Caches/com.apple.imfoundation.IMRemoteURLConnectionAgent
rm -rf ~/Library/Caches/com.apple.iCloudHelper
rm -rf ~/Library/Preferences/com.apple.iChat*
rm -rf ~/Library/Preferences/com.apple.icloud*
rm -rf ~/Library/Preferences/com.apple.ids.service*
rm -rf ~/Library/Preferences/com.apple.imagent.plist
rm -rf ~/Library/Preferences/com.apple.imessage*
rm -rf ~/Library/Preferences/com.apple.imservice*

Known problems/caveats

  • Unlock with Apple Watch only works once after actviation, or only sporadically

Battery status

Install SMCBatteryManager.kext that comes with VirtualSMC to get battery status. Ensure that you have removed ACPIBatteryManager if you’ve installed it previously.

Audio

Audio on the XPS 9570 is based on the Realtek ALC298 audio codec, referred to by Dell as “ALC3266-CG with Waves MaxxAudio Pro”. The ALC298 is not supported on macOS by default, so we use AppleALC to enable it. Audio pipelines on laptops appear to have unique amplifier and gain setups, so we need to pass a layout-id to AppleALC compatible with the XPS 9570. The only ID that works well is layout-id=30.

HDMI audio output probably requires SSDT-HDEF and FakePCIID_Intel_HDMI_Audio.kext, but is not implemented yet since it depends on a graphics fix.

Installation

  • config.plist
    • Devices/Properties/PciRoot(0)/Pci(0x1f,3)
      • Comment: AppleALC layout-id for ALC298 on XPS 9570
      • layout=id=30
  • Install AppleALC kext

Known problems/caveats

  • A bad layout-id causes constant CPU activity in a kernel_task process (30 should be ok)
  • Lack of an audio output device causes video playback problems, i.e. stalling when seeking
  • HDMI audio out not configured properly yet

USB

The XPS 9570 DSDT table has a few incorrect USB properties, but we can inject the correct properties via USBInjectAll with SSDT-UIAC.dsl.

The DSDT patch corresponds to the actual hardware config of the XPS 9570, which is as follows:

NamePortTypeUser Visible*Description
HS01, SS011, 17Type AYesRight side
HS02, SS022, 18Type AYesLeft side
HS034ProprietaryNoBluetooth
HS045Type CYesLeft side
HS057ProprietaryNoGoodix fingerprint reader
HS0612ProprietaryNoWebcam

(*) “Set if the device connection point can be seen by the user without disassembly” according to ACPI 6.2 A, 6.1.8, _PLD (Physical Location of Device)

Based on USB guide and companion guide.

Implementing USB port fixes and removing unused ports

Known issue: left side type C port only works in HS mode, not SS

Will likely work when USB type C and/or Thunderbolt fixes are added.

To-Do: Add USB power property injection

Thunderbolt 3

Thunderbolt 3 can be made to work if “BIOS assist enumeration” is enabled for Thunderbolt in the BIOS. Install the latest Thunderbolt firmware update from Dell, then boot into Windows with TB peripheral attached. Set device to “always allow”. TB device will work in macOS when attached prior to boot, but will lose functionality when hotplugged.

Touch ID / Goodix fingerprint sensor

It’s not possible to use fingerprint sensor for Touch ID according to RehabMan. Perhaps the integrated Goodix fingerprint sensor can be used, and enabled with PAM (TBD).

Since we’re using the MacBookPro15,1 SMBIOS, macOS is expecting Touch ID to be available, causing lag on password prompts. This can be disabled for now with the NoTouchID kext.

Trackpad and touchscreen

Both the Synaptics trackpad and Wacom touchscreen are I2C devices that can be driven with VoodooI2C. VoodooPS2Controller also provides basic trackpad support, but the quality is not as good.

Installation

  • Include VoodooI2C’s VoodooI2c.kext and VoodooI2CHID.kext
  • Include SSDT-I2C.aml (SSDT-I2C.dsl)
  • config.plist
    • ACPI/DSDT/Patches/Item n
      • Comment: Rename _CRS to XCRS, pair with SSDT-I2C.aml
      • Key=Find, Type=Data, Value=<144c045f 43525300 a00e954f 5359530b dc07a453 424649>
      • Key=Replace, Type=Data, Value=<144c0458 43525300 a00e954f 5359530b dc07a453 424649>
  • VoodooI2CHID.kext/Contents/Info.plist (no longer necessary with VoodooI2C 2.3)
    • =IOKitPersonalities/VoodooI2CHIDDevice Precision Touchpad HID Event Driver=
      • =QuietTimeAfterTyping=0= (so trackpad isn’t disabled by keystroke for 500ms)

Power management

Note: There is some information in power management guides that only applies pre-Coffee Lake. See section below to avoid unnecessary changes.

Based on the laptop power management guide by RehabMan, as well as macOS native power management by toleda.

Set up power managemnt

  • Disable hibernation (suspend to disk or S4 sleep) macOS combines sleep and hibernation into one feature, where closing the lid initially sleeps the laptop, and eventually hibernates it. In any event, hibernation is not supported on hackintosh, and should be disabled/checked after updates.
    sudo pmset -a hibernatemode 0
    sudo rm -f /var/vm/sleepimage
    sudo mkdir /var/vm/sleepimage # try to prevent update from re-enabling
    sudo pmset -a standby 0
    sudo pmset -a autopoweroff 0
        
  • config.plist/ACPI/SSDT/Generate/PluginType=YES
  • Verify that X86PlatformPlugin is loaded (see testing section)
  • config.plist/KernelAndKextPatches/KernelPm=YES
  • Enable xcpm_idle patch to prevent reboot with HWP (hardare P-state coordination)
    • config.plist/KernelAndKextPatches/KernelToPatch/Item n
      • Key=Find, Type=Data, Value=<20b9e200 00000f30>
      • Key=Replace, Type=Data, Value=<20b9e200 00009090>

Items that are no longer relevant to Coffee Lake (DO NOT USE)

  • config.plist/KernelAndKextPatches/AppleIntelCPUPM=YES
  • ssdtPRgen.sh
  • HWPEnabler

Testing power management (WIP)

  • Use Intel Power Gadget to graph CPU power/frequency/temp over time
  • Verify X86PlatformPlugin is loading under PR00 in IORegistryExplorer
    • Root -> MacBookPro15,1 -> AppleACPIPlatformExpert -> PR00@0 -> AppleACPICPU -> X86PlatformPlugin
  • Testing Power Management Load AppleIntelInfo.kext (but don’t install it):
    sudo chown -R root:wheel AppleIntelInfo.kext
    sudo kextload AppleIntelInfo.kext
        

    Then use the system for a few minutes, perform some work, let it idle, etc. Finally, copy results file to where you want to save it:

    sudo kextunload AppleIntelInfo.kext
    sudo cp /tmp/AppleIntelInfo.dat ~/AppleIntelInfo.txt
    sudo chmod g+rw ~/AppleIntelInfo.txt
        

VirtualSMC/FakeSMC

Either VirtualSMC or FakeSMC is required to boot macOS, since PCs don’t have Apple SMC hardware. VirtualSMC is newer and actively maintained.

Installation

Windows compatibility

Real-time clock

macOS sets BIOS clock to UTC, but Windows sets clock to local time. The solution is to set Windows to use UTC as well, with regedit:

  • regedit -> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
  • create new DWORD (32-bit) RealTimeIsUniversal with value ‘1’

Sharing Bluetooth devices

You may have noticed you need to re-pair a Bluetooth devices when booting between macOS <-> Windows, because the 128 bit device link key changes. This can be fixed by exporting macOS’s BT keys, and importing them in Windows. See BT-LinkkeySync for instructions, and BT-LinkkeySync.py in this repo (updated for Mojave).

Known problems/caveats

  • FileVault is disabled - unable to boot encrypted volume (stuck on black screen)
  • Thunderbolt 3 requires Windows configuration (one time), no hotplug support
  • USB3 on type-C port not working? Maybe requires cold booting?
  • Suspend and resume not implemented properly - power button should wake however
  • Internal keyboard behaves strangely when Keyboard SysPrefs are changed - must use SSDT to configure VoodooPS2Controller
  • Wi-Fi and Bluetooth require card swap, since there are no macOS drivers for OEM Killer Qualcomm card
  • Fingerprint reader does not work (see Touch ID / fingerprint reader section)
  • SD card reader not present

ACPI DSDT/SSDT patching

Most of the ACPI patching info is based on the laptop DSDT/SSDT guide and hotpatching guide.

The ACPIBatteryManager (no longer used) guide includes good step-by-step tutorial on how to make DSDT edits with MaciASL.

Many ACPI patches depend on starting out with a working set of ACPI tables (accomplished via patching if needed), so it’s useful to test if this is the case and fix any errors before attempting further changes.

To do this, we can look through the macOS boot logs for ACPI errors, dump the unmodified ACPI tables, and dump the ACPI tables as modified by Clover. Making changes as needed, rebooting, and re-inspecting system logs, we can iterate until there are no more ACPI problems as seen by macOS.

Note: this process wasn’t clear to me from reading the patching guides initially, but it may not be the best way to do it - caveat emptor.

  1. Inspect system logs for errors Immediately after bootup, dump system log for the last 10 minutes (adjust as needed):
    log show --predicate 'process == "kernel"' --style syslog --source --debug --last 10m > sys_log.txt
        

    Then search sys_log.txt for “ACPI Error” or “ACPI Exception”.

  2. Dump unmodified ACPI tables Press F4 on Clover boot screen (no output will show), then mount EFI partition and look for ACPI tables in CLOVER/ACPI/origin.
  3. Check unmodified tables for errors with iasl Disassembling all tables from a single namespace with the -da option should yield no errors: iasl -da -dl DSDT.aml SSDT-*.aml Although, some duplicate definitions with the error AE_ALREADY_EXISTS may not be a problem (TBD). If an error occurs, check the file DSDT.dsl for possible error output.
  4. Check modified tables as injected by Clover with patchmatic and iasl
    patchmatic -extract
    iasl -da -dl DSDT.aml SSDT-*.aml
        

    Again, this should yield no errors. If a duplicate definition is found with AE_ALREADY_EXISTS, try disassembling the tables without the -da option: iasl -dl DSDT.aml SSDT-*.aml If this still fails, there is likely a problem that needs to be fixed via Clover patching first.

Installation and system updates

Installation from scratch

Preparing the XPS 9570

This setup dual-boots Windows 10, which is nice to have for games, since we can actually use the Nvidia GTX 1050, unlike in macOS.

Begin with the default Windows 10 installation (or install Windows 10 if using a new drive).

  • Create a Windows USB installer using the media creation tool (not in a VM) The installed copy of Windows will be wiped when switching to 4k sectors or AHCI mode below.
  • Update BIOS and other firmware using Dell SupportAssist in Windows
  • Toshiba SSD only
    • Update Toshiba SSD firmware (search for “toshiba”) Needed to fix 4k sector bug. Dell SupportAssist does not do this automatically!
    • Set SSD to use 4k sectors - this will WIPE the drive!
  • Enable Intel SpeedShift in BIOS
  • Ensure SSD mode is set to AHCI mode instead of RAID in BIOS This will make an existing installation of Windows unbootable.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
leits/MeetingBar: 发布时间:2022-08-18
下一篇:
KrisYu/swift14macOSApps: approaching macOS development using swift with 14 mini ...发布时间:2022-08-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap