bavariancake / XPS9570-macOS

macOS Mojave/Catalina on Dell XPS 9570.
263 stars 45 forks source link
hackintosh mojave xps15 xps9570

+STARTUP: indent

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

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 [[https://www.intel.com/content/www/us/en/support/articles/000025672/graphics-drivers.html][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

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

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 [[file:images/3rd_antenna.jpg][installation example]]):

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

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 [[https://www.tonymacx86.com/threads/an-idiots-guide-to-imessage.196827/][here]] and [[https://www.tonymacx86.com/threads/how-to-fix-imessage.110471/][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:

+BEGIN_SRC sh

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*

+END_SRC

*** Known problems/caveats

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

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

| Name | Port | Type | User Visible* | Description | |------------+-------+-------------+---------------+---------------------------| | HS01, SS01 | 1, 17 | Type A | Yes | Right side | | HS02, SS02 | 2, 18 | Type A | Yes | Left side | | HS03 | 4 | Proprietary | No | Bluetooth | | HS04 | 5 | Type C | Yes | Left side | | HS05 | 7 | Proprietary | No | Goodix fingerprint reader | | HS06 | 12 | Proprietary | No | Webcam |

(*) "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 [[https://www.tonymacx86.com/threads/guide-10-11-usb-changes-and-solutions.173616/][USB guide]] and [[https://www.tonymacx86.com/threads/guide-creating-a-custom-ssdt-for-usbinjectall-kext.211311/][companion guide.]] *** Implementing USB port fixes and removing unused ports

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.

Based on the [[https://www.tonymacx86.com/threads/guide-native-power-management-for-laptops.175801/][laptop power management guide]] by RehabMan, as well as [[https://www.tonymacx86.com/threads/macos-native-cpu-igpu-power-management.222982/][macOS native power management]] by toleda. *** Set up power managemnt

The ACPIBatteryManager (no longer used) [[https://www.tonymacx86.com/threads/guide-how-to-patch-dsdt-for-working-battery-status.116102/][guide]] includes good step-by-step tutorial on how to make DSDT edits with [[https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/][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):

    +BEGIN_SRC sh

    log show --predicate 'process == "kernel"' --style syslog --source --debug --last 10m > sys_log.txt

    +END_SRC

    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

    +BEGIN_SRC sh

    patchmatic -extract iasl -da -dl DSDT.aml SSDT-*.aml

    +END_SRC

    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).

Using both CLOVER/kexts/Other and /Library/Extensions for some kexts and not others is not recommended. It looks like Clover can get confused if it needs to load a kext when doing this.

This seems to work well and provides more flexibility, but if you run into any issues doing this, please report it.

To update the kext cache in /Library/Extensions after making changes there, do:

+BEGIN_SRC sh

sudo kextcache -i /

+END_SRC

Be sure to check output for errors! Every custom kext should be listed with the line =Kext with invalid signatured (-67062) allowed= ** Kext patching Kexts can be patched on boot by Clover (see =KernelAndKextPatches/KextsToPatch= section in [[file:EFI/CLOVER/config.plist][config.plist]]), but Clover has some limitations, e.g. it can only patch kexts that are in the kext cache. More complex cases can be handled by [[https://github.com/acidanthera/Lilu][Lilu]], used for "arbitrary kext and process patching", which is itself installed as a [[file:EFI/CLOVER/kexts/Other/Lilu.kext][kext]]. Excellent [[https://www.tonymacx86.com/threads/an-idiots-guide-to-lilu-and-its-plug-ins.260063/][guide]] to using Lilu and commonly used plugins.

See also guide to [[https://www.tonymacx86.com/threads/guide-installing-3rd-party-kexts-el-capitan-sierra-high-sierra-mojave.268964/][installing 3rd party kexts]]. ** System Integrity Protection (SIP) We want to disable SIP to allow loading unapproved kexts and allow other system features that are normally restricted. This is accomplished by setting =CsrActiveConfig= in config.plist:

The bitmask and settings defined by 0x3E7 are [[https://www.reddit.com/r/hackintosh/comments/bt17xk/differences_between_0x67_and_0x3e7/][explained in more detail]] by [[https://www.reddit.com/user/dracoflar][dracoflar]]. Hackintool https://www.tonymacx86.com/threads/release-hackintool-v2-3-8.254559/ A full-featured utility to fix various issues, including graphics, USB, audio, etc. Requires a fair bit of reading, but is useful to verify an installed config or hardware. ACPI debugging The [[https://github.com/RehabMan/OS-X-ACPI-Debug][OS-X-ACPI-Debug]] repo allows for "debug tracing from ACPI code (DSDT) to system.log". Not currently installed and not tested, but should be useful if ACPI problems come up. ** Boot arguments These are the boot arguments currently used:

Xcode 11.3 and newer has a quirk when editing binary data. Data must be entered in the format == with hex input between brackets, but the editor will show ={length = 4, bytes = 0xdeadbeef}=. To make changes to the data, you have to enter it again in the =<...>= format.

You can edit .plist files on the command line with PlistBuddy: =/usr/libexec/PlistBuddy -c "Add :SomeData data echo 0xDEADBEEF | xxd -r -p" test.plist= Or you can print .plist contents with plutil: =plutil -p test.plist= Which would show the output:

+BEGIN_SRC

{ "SomeData" => {length = 4, bytes = 0xdeadbeef} }

+END_SRC

Update completes after waiting a while. 2019-05-13: Add support for dual DisplayPort via type C The type C connector supports up to two 4k@60Hz DisplayPort outputs with an adapter. The HDMI output can be used simultaneously, for up to three displays (including the LCD). A Thunderbolt 3 adapter is recommended to get 60Hz and other benefits. 2019-04-29: Add initial HDMI support @0xFireWolf created patches to enable Type C and HDMI connected output. This will likely require more changes to support HDMI 2.0 fully. 2019-04-01: Use WhateverGreen for DPCD link rate patching @0xFireWolf has added DPCD link rate patching to WhateverGreen, which is available with commit ab43814f45, or with the next release (1.2.8 probably). A WhateverGreen kext with these changes is also included with this repo. 2019-03-26: Upgrade to 10.14.4 This update takes quite some time on initial install, so it may be necessary to wait more than 20 minutes before seeing a progress bar.

AppleIntelCFLGraphicsFramebuffer changed again, and this time the DPCD link rate patch needs to be updated. See changes in the Intel UHD 630 "enabling acceleration section".