diff --git a/docs/distributions/fedora/faq.md b/docs/distributions/fedora/faq.md index ed0bb2c0..39209c3c 100644 --- a/docs/distributions/fedora/faq.md +++ b/docs/distributions/fedora/faq.md @@ -21,19 +21,3 @@ If you try to upgrade to a new stable release (ex: f42 -> f43), and you reboot i # Wi-Fi was working in the ISO, but broke after installing Run `sudo systemctl enable --now get-apple-firmware.service` in a terminal, then reboot. - -# My Wi-Fi stops working after suspending - -Add this to `/etc/systemd/system-sleep/unload-wifi.sh`: - -```bash -#!/usr/bin/env bash -if [ "${1}" = "pre" ]; then - systemctl stop NetworkManager - modprobe -r brcmfmac_wcc - modprobe -r brcmfmac -elif [ "${1}" = "post" ]; then - modprobe brcmfmac - systemctl start NetworkManager -fi -``` diff --git a/docs/guides/audio-config.md b/docs/guides/audio-config.md index fd110290..0b79d12e 100644 --- a/docs/guides/audio-config.md +++ b/docs/guides/audio-config.md @@ -67,9 +67,9 @@ An EasyEffects preset (tested on MacBook Pro 15,1) is available [here](https://g All of apple's fancy tuning of the speakers is done in macOS, but a similar configuration is currently available for only the MacBook Pro 16 inch 2019. -## MacBook Pro 16" 2019 +## MacBook Pro A2141 16" 2019, MacBook Air A2179 2020 -Currently we have an experimental DSP (Digital Signal Processing) config for MacBook Pro 16" 2019 with 6 speakers. +Currently we have an experimental DSP (Digital Signal Processing) config for MacBook Pro 16" 2019 with 6 speakers and for the 2020 MacBook Air with 2 speakers. Note that each model needs specific settings. Do not use it with other models as it could damage the speakers. Also do not expect same sound quality as in macOS. -[DSP config instructions](https://github.com/lemmyg/t2-apple-audio-dsp/tree/speakers_161) +[DSP config instructions](https://github.com/lemmyg/t2-apple-audio-dsp/) diff --git a/docs/guides/hybrid-graphics.md b/docs/guides/hybrid-graphics.md index 6388dd50..3700a949 100644 --- a/docs/guides/hybrid-graphics.md +++ b/docs/guides/hybrid-graphics.md @@ -100,13 +100,6 @@ We can take this a step further and save substantial amounts of energy by deacti 2:DIS: :Pwr:0000:01:00.0 ``` -### Suspend workaround - -If using the iGPU causes the screen to be black after waking up from suspend, then try one of these workarounds: - -- Add `i915.enable_guc=3` to [your kernel parameters](https://wiki.t2linux.org/guides/postinstall/#add-necessary-kernel-parameters). If that has a problem, try setting the value to 2 instead of 3. -- Turn the screen off and on after the backlight turns on. For GNOME: type your password then press enter, press Command + L to lock (this should turn off the backlight), then press any key. - ## Using iGPU as primary gpu (Mutter) Mutter-based desktop environments (e.g. GNOME) pick one GPU to use as the "primary GPU", and it's not necessarily the same as the one connected to the display. Even if apple-gmux is configured with `force_igd=y`, Mutter's primary GPU might be the AMD GPU, which makes the AMD GPU active when screen contents change. diff --git a/docs/guides/postinstall.md b/docs/guides/postinstall.md index c1601bd4..0ee208d6 100644 --- a/docs/guides/postinstall.md +++ b/docs/guides/postinstall.md @@ -160,7 +160,7 @@ sudo modprobe hid-appletb-kbd # Wi-Fi and Bluetooth -The drivers for Wi-Fi and Bluetooth are included in a kernel with T2 support. But, we also need firmware to get them working from macOS. +The drivers for Wi-Fi and Bluetooth are included in a kernel with T2 support. But, we also need firmware to get Wifi working from macOS. Instructions for the same are given in the [Wi-Fi and Bluetooth](https://wiki.t2linux.org/guides/wifi-bluetooth/) guide. @@ -178,119 +178,3 @@ cat < hid_appletb_bl -> hid_appletb_kbd) is required to properly reinitialize the Touch Bar device after resume. -- If you use tiny-dfr for Touch Bar customization, the tiny-dfr service needs to be stopped before suspend and started after resume, and appletbdrm module is required. - -The script below includes all cases with commented sections. Uncomment the relevant sections based on your model and requirements. The loading order of modules is important for proper device initialization after resume. - -1. Create and edit this file: `/etc/elogind/system-sleep/apple-bce-handler` - - ```bash - #!/bin/bash - case $1/$2 in - pre/*) - # Required for all T2 models - rmmod -f apple_bce - - # Uncomment the following if using tiny dfr for touchbar - #/etc/init.d/tiny-dfr stop - #modprobe -r appletbdrm - - # Uncomment the following for models with touchbar, irrespective of whether using tiny-dfr - #modprobe -r hid_appletb_kbd - #modprobe -r hid_appletb_bl - ;; - - post/*) - # Required for all T2 models - sleep 4 - modprobe apple_bce - - # Uncomment the following for models with touchbar, irrespective of whether using tiny-dfr - #sleep 4 - #modprobe hid_appletb_bl - #sleep 2 - #modprobe hid_appletb_kbd - - # Uncomment the following if using tiny dfr for touchbar - #sleep 2 - #modprobe appletbdrm - #sleep 3 - #/etc/init.d/tiny-dfr start - ;; - esac - ``` - -2. Make the script executable: - - ```bash - chmod +x /etc/elogind/system-sleep/apple-bce-handler - ``` - -!!! note - Make sure you have CONFIG_MODULE_FORCE_UNLOAD=y in the kernel config. diff --git a/docs/guides/suspend.md b/docs/guides/suspend.md new file mode 100644 index 00000000..d416ebae --- /dev/null +++ b/docs/guides/suspend.md @@ -0,0 +1,107 @@ +# Suspend + +Suspend is working on all T2 Macs since early 2026, but not on all of them out of the box. +On some hardware we need workarounds because of upstream driver/ACPI or Apple firmware issues. + +## Thunderbolt / slow resume times + +We can either have fast resume from suspend, or we can have Thunderbolt support. Not both. +Linux by default masquerades as macOS to make certain features accessible. +Thunderbolt is one of those. +On the other hand, masquerading as macOS makes resume from suspend extremely slow. +Depending on the number of cores your CPU has, it can take up to three minutes on a I9, +while it takes around 20 seconds on a I5 because `smpboot`-times rise exponentially per core. + +To stop masquerading as macOS and to make the CPU cores wake within milliseconds, +you need to add the kernel arguments + +```bash +acpi_osi=!Darwin acpi_osi='Windows 2012' +``` + +How to add kernel parameter is described in [postinstall](postinstall.md/#add-necessary-kernel-parameters). +But note this will break Thunderbolt support. This needs to be fixed in the Linux +mainline ACPI driver and is a trade-off we have to make for now. + +## iGPU black screen on resume + +If using the iGPU causes the screen to be black after waking up from suspend, then try one of these workarounds: + +- Add `i915.enable_guc=3` to [your kernel parameters](postinstall.md/#add-necessary-kernel-parameters). If that has a problem, try setting the value to 2 instead of 3. +- Turn the screen off and on after the backlight turns on. For GNOME: type your password then press enter, press Command + L to lock (this should turn off the backlight), then press any key. + +## MacBook Pro 15,1 black screen on resume + +The MacBook Pro 15,1 suffers the issue to come up with a black screen on resume +because the SMU dies when the driver suspends the hardware. The cause for this is +known and being worked on. As a temporary workaround you can make the iGPU primary +as described in the [hybrid graphics guide](hybrid-graphics.md) and unload/reload the dGPU driver on +suspend using systemd. +Paste and run the following code block to create and enable this service: + +```bash +sudo tee /etc/systemd/system/amdgpu-suspend.service >/dev/null <<'EOF' +[Unit] +Description=Unload and Reload amdgpu for Suspend and Resume +Before=sleep.target +StopWhenUnneeded=yes + +[Service] +User=root +Type=oneshot +RemainAfterExit=yes + +ExecStart=-/usr/bin/modprobe -r amdgpu + +ExecStop=-/usr/bin/modprobe amdgpu + +[Install] +WantedBy=sleep.target +EOF + +sudo systemctl daemon-reload +sudo systemctl enable amdgpu-suspend.service +``` + +## Broadcom 4377 + +Opposite to the Broadcom 4364 and 4365, which use dedicated chips and firmwares +for Bluetooth and Wifi, the 4377 uses a single chip and a single unified firmware. +The bluetooth part of the firmware is holding back the 4377 chip from transitioning +from `D0` to `D3cold`. While the 4364 and 4365 don't even need or use the Bluetooth firmware +on Linux, a 4377 user can't choose to not use the BT firmware. What you can do though, +is unloading the Linux drivers on suspend and reloading them on resume using a systemd service. + +You will know that you are on affected hardware, when `journalctl -b --grep=4377` returns +something `brcmfmac` related. + +If so, simply run the following terminal command: + +```bash +sudo tee /etc/systemd/system/brcmfmac-suspend.service >/dev/null <<'EOF' +[Unit] +Description=Unload and Reload brcmfmac for Suspend and Resume +Before=sleep.target +StopWhenUnneeded=yes + +[Service] +User=root +Type=oneshot +RemainAfterExit=yes + +ExecStart=-/usr/bin/modprobe -r brcmfmac_wcc +ExecStart=-/usr/bin/modprobe -r brcmfmac +ExecStart=-/usr/bin/modprobe -r hci_bcm4377 + + +ExecStop=-/usr/bin/modprobe hci_bcm4377 +ExecStop=-/usr/bin/modprobe brcmfmac +ExecStop=-/usr/bin/modprobe brcmfmac_wcc + +[Install] +WantedBy=sleep.target +EOF + +sudo systemctl daemon-reload +sudo systemctl enable brcmfmac-suspend.service +``` diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index a37c1a5b..a5db486a 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -133,14 +133,25 @@ Once you have run the script on macOS, depending on the method you chose, the st Replace `/path/to/firmware.tar` with the actual path of the tarball. For example, if `firmware.tar` is copied to the Downloads folder in Linux, command to be run would be `sudo tar -v -xC /lib/firmware/brcm -f $HOME/Downloads/firmware.tar` - Then reload the Wi-Fi and Bluetooth drivers by running: + Then reload the Wi-Fi and Bluetooth drivers. For the Broadcom 4377 chip: ```bash sudo modprobe -r brcmfmac_wcc sudo modprobe -r brcmfmac - sudo modprobe brcmfmac sudo modprobe -r hci_bcm4377 sudo modprobe hci_bcm4377 + sudo modprobe brcmfmac + sudo modprobe brcmfmac_wcc + ``` + For Broadcomn 4364 and 4365 chips: + + ```bash + sudo modprobe -r brcmfmac_wcc + sudo modprobe -r brcmfmac + sudo modprobe -r hci_uart + sudo modprobe hci_uart + sudo modprobe brcmfmac + sudo modprobe brcmfmac_wcc ``` === ":fontawesome-brands-linux: Method 3" diff --git a/docs/state.md b/docs/state.md index 4c73bee8..3c9841e0 100644 --- a/docs/state.md +++ b/docs/state.md @@ -7,15 +7,15 @@ While Linux is usable on all T2 models, some features are limited due to the lac |Internal Drive / SSD|🟢 Working|🟢 Kernel 5.4||[Filesystem notes](#filesystem-notes)| |Screen, iGPU|🟢 Working|🟡 Partial||| |USB|🟢 Working|🟢 Yes||| -|Keyboard|🟢 Working|🔴 No||[apple-bce](https://github.com/t2linux/apple-bce-drv)| -|Trackpad|🟢 Working|🔴 No|Works, but isn't as great as on macOS (no force touch or palm rejection).|[apple-bce](https://github.com/t2linux/apple-bce-drv), [Trackpad tuning](https://wiki.t2linux.org/#trackpad-tuning)| +|Keyboard|🟢 Working|🔴 No||| +|Trackpad|🟢 Working|🔴 No||[Trackpad tuning](https://wiki.t2linux.org/#trackpad-tuning)| |Wi-Fi|🟢 Working|🟢 Yes|Requires macOS firmware|[Setup guide](https://wiki.t2linux.org/guides/wifi-bluetooth/)| -|Bluetooth|🟡 Partially working|🟢 Yes|Requires macOS firmware only for devices with BCM4377 chip. Also, Bluetooth glitches on devices with BCM4377 Chip if connected to a 2.4 GHz Wi-Fi connection. Thus, in order to use Bluetooth either turn off your Wi-Fi or use a 5 GHz Wi-Fi connection.|[Setup guide](https://wiki.t2linux.org/guides/wifi-bluetooth/)| -|Camera|🟢 Working|🔴 No||[apple-bce](https://github.com/t2linux/apple-bce-drv)| -|Thunderbolt|🟢 Working|🟢 Yes|If it doesn't work, try adding `pcie_ports=native` in the kernel parameters via GRUB.|| -|Touch Bar|🟢 Working|🟡 Partial|"Touch Bar Keyboard" mode works OOTB, where only the Function Keys or the Media/Brightness Control Keys are shown. Touch Bar drivers were upstreamed in kernel 6.15, but we still need apple-bce to make it work.|[apple-bce](https://github.com/t2linux/apple-bce-drv), [tiny-dfr](https://github.com/AsahiLinux/tiny-dfr)| -|Suspend|🟡 Partially working|🟢 Yes|A firmware upgrade attached to macOS Sonoma broke suspend. Some users were having difficulty with it even before Sonoma. The issue has something to do with the apple-bce driver, because suspend works when it's disabled.|[#53](https://github.com/t2linux/T2-Ubuntu-Kernel/issues/53)| -|Audio|🟡 Partially working|🔴 No|With proper configuration audio can work, however it is not stable in some older kernels and switching between speakers and when using the microphone. Microphone volume is low in some Macs.|[apple-bce](https://github.com/t2linux/apple-bce-drv)| +|Bluetooth|🟡 Partially working|🟢 Yes| 5 GHz Wi-Fi connection is recommended to prevent Bluetooth interferences.|[Setup guide](https://wiki.t2linux.org/guides/wifi-bluetooth/)| +|Camera|🟢 Working|🔴 No||| +|Thunderbolt|🟢 Working|🟢 Yes|Needs`pcie_ports=native` in kernel parameters|| +|Touch Bar|🟢 Working|🟢 Yes|Touchbar works in native mode and can be customized using tiny-dfr or react-drm|| +|Suspend|🟢 Working|🟡 Prepared|Generally working but requires hardware-specific adjustments until further notice.|[guide](guides/suspend.md)| +|Audio|🟢 Working|🟡 Prepared| Microphone volume is low, what is factory intended state. Gain needs to be turned up in userland|| |Hybrid Graphics|🟡 Partially working|🟡 Partial|Toggling dGPU power doesn't work.|[Hybrid Graphics](https://wiki.t2linux.org/guides/hybrid-graphics/)| |AMD GPUs|🟡 Partially working||Changing resolution, using DRI_PRIME and doing various other things can cause crashes, but `echo high \| sudo tee /sys/bus/pci/drivers/amdgpu/0000:??:??.?/power_dpm_force_performance_level` or adding `amdgpu.dpm=0` to the kernel commandline stops these crashes.|| |MacPro7,1|🟡 Partially working||Users have encountered PCIe Address Space issues, with auto remap breaking. A temporary solution may be possible by removing the Infinity Fabric Link (Bridge or Jumper) from the GPU(s).||