Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ See "partially working" features at [State](https://wiki.t2linux.org/state/) to

Here is the list and links to donate to some of our maintainers.

- [MCMrARM](https://github.com/MCMrARM) - Author of the [apple-bce driver](https://github.com/t2linux/apple-bce-drv). Donate via [Paypal](https://paypal.me/mcmrarm).
- [MCMrARM](https://github.com/MCMrARM) - Author of the original [apple-bce driver](https://github.com/t2linux/apple-bce-drv), which provided the foundation for t2bce. Donate via [Paypal](https://paypal.me/mcmrarm).
- [André Eikmeyer](https://github.com/deqrocks) - Author and maintainer of the [t2bce driver stack](https://github.com/deqrocks/t2bce). Donate via [Paypal](https://www.paypal.com/paypalme/negmaster).
- [JPyke3](https://github.com/JPyke3) - Played a major role in getting Manjaro working on T2 Macs. Donate via [Patreon](https://patreon.com/pykee) or [On Chain](https://github.com/JPyke3/mbp-manjaro#donations).
- [marcosfad](https://github.com/marcosfad) - Played a major role in getting Ubuntu working on T2 Macs. Donate via [Paypal](https://paypal.me/marcosfad) or [GitHub Sponsors](https://github.com/sponsors/marcosfad).
- [NoaHimesaka1873](https://github.com/NoaHimesaka1873) - Currently maintains boot images and kernels for Arch and EndeavourOS and runs chat.t2linux.org homeserver. Donate via [GitHub Sponsors](https://github.com/sponsors/NoaHimesaka1873).
Expand Down
4 changes: 3 additions & 1 deletion docs/distributions/gentoo/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
2. Alternatively, you can use the kernel sources and manually compile. With this method, the update process is not automated, and manual configuration is necessary. However, `sys-kernel/t2gentoo-sources` tends to get new kernel versions faster than `sys-kernel/t2gentoo-kernel`. To install it, run: `emerge -av sys-kernel/t2gentoo-sources`. After installing the kernel sources, run `eselect kernel set 1` to point `/usr/src/linux` to the correct path, then follow the directions in the [Manual Configuration](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel#Alternative:_Manual_configuration) section of the handbook. If you decide to manually configure your kernel, make sure the following options are set:

```bash
CONFIG_APPLE_BCE=m
CONFIG_T2BCE_CORE=m
CONFIG_T2BCE_VHCI=m
CONFIG_T2BCE_AUDIO=m
CONFIG_APPLE_GMUX=m
CONFIG_IRQ_REMAP=y
CONFIG_HID_APPLE_IBRIDGE=m
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/audio-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This page explains how to get the config files for using the T2 audio device, which allows use of the 3.5mm headphone port, the built in speakers, the built in mic and the headphones' mic.

Firstly, check whether you are using an updated `apple-bce` version by running `sed -n "s/.*\(AppleT2.*\) -.*/\1/p" /proc/asound/cards`. If the output is `AppleT2xN` (where `N` is a number), then this guide can be followed. If it's just `AppleT2`, then either update the driver first or follow the [older version](https://github.com/t2linux/wiki/blob/00e882d0d5afb3102aedd02872426dc5fba789a5/docs/guides/audio-config.md) of this guide.
Firstly, check whether the `t2bce_audio` driver exposes the model-specific speaker layout by running `sed -n "s/.*\(AppleT2.*\) -.*/\1/p" /proc/asound/cards`. If the output is `AppleT2xN` (where `N` is a number), then this guide can be followed. If it is just `AppleT2`, update your T2 kernel and its t2bce driver stack first.

If there is no output at all you probably do not have T2 Mac support. Follow the instructions on [how to add support for T2 Macs](https://wiki.t2linux.org/guides/postinstall/).

Expand Down
6 changes: 4 additions & 2 deletions docs/guides/kernel.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kernel

This page explains how to compile a Linux kernel with patches for T2 hardware support and with apple-bce + apple-ibridge included. If you have issues, make sure you are running the commands here with `bash`.
This page explains how to compile a Linux kernel with patches for T2 hardware support and with t2bce included. If you have issues, make sure you are running the commands here with `bash`.

If your distro is not one of the distros with documentation on this Wiki, you may not need to compile a kernel yourself to get support for T2 hardware. Debian based systems can use the same kernel as described in the Ubuntu section, Arch based systems can use the same kernel as described in the Arch section, etc.

Expand Down Expand Up @@ -63,7 +63,9 @@ scripts/config --module CONFIG_BT_HCIBCM4377
scripts/config --module CONFIG_HID_APPLETB_BL
scripts/config --module CONFIG_HID_APPLETB_KBD
scripts/config --module CONFIG_DRM_APPLETBDRM
scripts/config --module CONFIG_APPLE_BCE
scripts/config --module CONFIG_T2BCE_CORE
scripts/config --module CONFIG_T2BCE_VHCI
scripts/config --module CONFIG_T2BCE_AUDIO
scripts/config --module CONFIG_APFS_FS
```

Expand Down
141 changes: 17 additions & 124 deletions docs/guides/postinstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ Using your bootloader, add the `intel_iommu=on iommu=pt pm_async=off` kernel par
Simply run the following:

```sh
echo apple-bce | sudo tee /etc/modules-load.d/t2.conf
echo t2bce_vhci | sudo tee /etc/modules-load.d/t2.conf
```

## Make modules load on early boot

Having the `apple-bce` module loaded early allows the use of the keyboard for decrypting encrypted volumes (LUKS).
Having the `t2bce_vhci` module and its dependencies loaded early allows the use of the keyboard for decrypting encrypted volumes (LUKS).
It is also useful when boot doesn't work and the keyboard is required for debugging.
To do this, you must ensure the `apple-bce` module *as well as its dependent modules* are included in the initial ramdisk.
You can get the list of dependent modules by running `modinfo -F depends apple-bce`
To do this, you must ensure `t2bce_vhci`, `t2bce_core`, and `t2bce_dma` are included in the initial ramdisk.
The steps to be followed vary depending upon the initramfs module loading mechanism used by your distro. Some examples are given as follows:

- On systems with `initramfs-tools` (all Debian-based distros):
Expand All @@ -66,9 +65,9 @@ The steps to be followed vary depending upon the initramfs module loading mechan
```sh
cat <<EOF >> /etc/initramfs-tools/modules
# Required modules for getting the built-in apple keyboard to work:
snd
snd_pcm
apple-bce
t2bce_dma
t2bce_core
t2bce_vhci
EOF
update-initramfs -u
```
Expand All @@ -80,24 +79,24 @@ The steps to be followed vary depending upon the initramfs module loading mechan
2. Ensure that the file has the following:

```sh
MODULES="apple-bce"
MODULES=(t2bce_dma t2bce_core t2bce_vhci)
```

3. Run `sudo mkinitcpio -P`.

- On systems with `dracut` (Commonly used on EndeavourOS and Fedora):

1. Run the following to create a dracut configuration file which loads the apple-bce module on early boot:
1. Run the following to create a dracut configuration file which loads the t2bce VHCI stack on early boot:

```sh
echo "force_drivers+=\" apple-bce \"" | sudo tee /etc/dracut.conf.d/t2linux-modules.conf
echo "force_drivers+=\" t2bce_dma t2bce_core t2bce_vhci \"" | sudo tee /etc/dracut.conf.d/t2linux-modules.conf
```

2. Run `sudo dracut --force` to regenerate the initramfs with this change.

- On systems with other initramfs/initrd generation systems:

In this case, refer to the documentation of the same and ensure the kernel module `apple-bce` is loaded early.
In this case, refer to its documentation and ensure `t2bce_dma`, `t2bce_core`, and `t2bce_vhci` are loaded early.

## Adding support for customisable Touch Bar

Expand Down Expand Up @@ -179,118 +178,12 @@ no-auto-default=t2_ncm
EOF
```

# Suspend Workaround
# Suspend

## Fedora and Arch based distros
Current T2 kernels use t2bce, which handles suspend and resume for the BCE,
VHCI, and audio stack internally. Do not unload the t2bce modules before
suspend. Force-unloading them tears down active BridgeOS queues and can leave
internal devices unavailable after resume.

Comment thread
AdityaGarg8 marked this conversation as resolved.
S3 suspend has been broken since macOS Sonoma, it has never been fixed, but this workaround will make deep suspend work. Currently this workaround works only on Arch based distros and Fedora.

1. Create and edit this file: `/etc/systemd/system/suspend-fix-t2.service`

2. Check your `modprobe` and `rmmod` location by running:

```bash
which modprobe
which rmmod
```

3. Taking the example as `/usr/bin` for location of `modprobe` and `rmmod`, copy the following to `/etc/systemd/system/suspend-fix-t2.service`. If the location is different, do the changes accordingly.

```service
[Unit]
Description=Disable and Re-Enable Apple BCE Module (and Wi-Fi)
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/rmmod -f apple-bce

ExecStop=/usr/bin/modprobe apple-bce
#ExecStop=/usr/bin/modprobe brcmfmac
#ExecStop=/usr/bin/modprobe brcmfmac_wcc

[Install]
WantedBy=sleep.target
```

4. Enable the service by running: `sudo systemctl enable suspend-fix-t2.service`

5. If you are facing issues with Wi-Fi on resume, uncomment the lines having `brcmfmac` and `brcmfmac_wcc` in the above file.

!!! note
Make sure you have `CONFIG_MODULE_FORCE_UNLOAD=y` in the kernel config.
To check, run: `zcat /proc/config.gz | grep "CONFIG_MODULE_FORCE_UNLOAD"` on Arch based distros, or `grep "CONFIG_MODULE_FORCE_UNLOAD" /boot/config-$(uname -r)` on Fedora.

## Gentoo/OpenRC

S3 suspend has been broken since macOS Sonoma, it has never been fixed, but this workaround will make deep suspend work on Gentoo Linux using OpenRC and elogind.

Prerequisites:

1. Make sure elogind is installed and running:

```bash
rc-update add elogind boot
rc-service elogind start
```

For T2 MacBooks, while unloading only the apple-bce module is sufficient for basic suspend functionality, additional module handling may be required depending on your model:

- All T2 models require the apple-bce module handling.
- For models with Touch Bar, a specific module sequence (apple_bce -> 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.
When migrating from apple-bce, remove any old suspend service or elogind hook
that unloads it before testing suspend with t2bce.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If the distribution you want to use has a guide [here](https://wiki.t2linux.org/
Support for hardware is cross distro besides patches to the distribution specific kernel.
The following repos contain kernel modules for said support:

- MacBook Bridge / T2 Linux Driver [https://github.com/t2linux/apple-bce-drv](https://github.com/t2linux/apple-bce-drv)
- T2 Buffer Copy Engine driver stack [https://github.com/deqrocks/t2bce](https://github.com/deqrocks/t2bce)
- Touch Bar and Ambient Light [https://github.com/t2linux/apple-ib-drv](https://github.com/t2linux/apple-ib-drv) (Upstreamed in kernel 6.15)

Instead of installing these modules manually, it is suggested to follow the [distro specific guides](https://wiki.t2linux.org/distributions/overview/) since they are pre-installed in our distro specific ISOs.
Expand Down
3 changes: 2 additions & 1 deletion docs/notable-contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ If there is someone missing that you think should be on this list, send a PR on
- mikroskeem (NixOS and founder of t2linux Discord community) [https://github.com/mikroskeem](https://github.com/mikroskeem)
- JPyke3 (Manjaro) [https://github.com/JPyke3](https://github.com/JPyke3)
- marcosfad (Ubuntu) [https://github.com/marcosfad](https://github.com/marcosfad)
- MCMrARM (MacBook Bridge / T2 Linux Driver) [https://github.com/MCMrARM](https://github.com/MCMrARM)
- MCMrARM (apple-bce driver) [https://github.com/MCMrARM](https://github.com/MCMrARM)
- André Eikmeyer (t2bce driver stack) [https://github.com/deqrocks](https://github.com/deqrocks)
- mikeeq (Fedora) [https://github.com/mikeeq](https://github.com/mikeeq)
- networkException (Wiki maintenance and `mbpfan` fork for T2) [https://github.com/networkException](https://github.com/networkException)
- Redecorating (Arch Linux, Wiki maintenance, Apple GMUX for T2 Macs, Magic Backlight driver and improved the Touch Bar driver) [https://github.com/Redecorating](https://github.com/Redecorating)
Expand Down
12 changes: 6 additions & 6 deletions docs/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -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||[t2bce](https://github.com/deqrocks/t2bce)|
|Trackpad|🟢 Working|🔴 No|Works, but isn't as great as on macOS (no force touch or palm rejection).|[t2bce](https://github.com/deqrocks/t2bce), [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)|
|Camera|🟢 Working|🔴 No||[t2bce](https://github.com/deqrocks/t2bce)|
|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)|
|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, while the internal USB connection is provided by t2bce.|[t2bce](https://github.com/deqrocks/t2bce), [tiny-dfr](https://github.com/AsahiLinux/tiny-dfr)|
|Suspend|🟡 Partially working|🟢 Yes|t2bce handles suspend and resume of the BCE, VHCI, and audio stack. Remaining suspend issues are model-dependent and may involve other hardware.|[#53](https://github.com/t2linux/T2-Ubuntu-Kernel/issues/53)|
|Audio|🟢 Working|🔴 No|The internal microphone has low input volume without DSP. This is a hardware characteristic and cannot be compensated for in an upstream kernel driver.|[t2bce](https://github.com/deqrocks/t2bce)|
|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).||
Expand Down
Loading