Translation(s): none
MacBookPro7,1
MacBook Pro 13" mid-2010
Contents
- Install Debian
-
Hardware
- CPU / Core 2 Duo P8600
- GPU / Nvidia Geforce 320M
- Apple ClickPad
- Apple Keyboard
- SATA / Nvidia MCP89
- SATA / AHCI Mode
- Gigabit Ethernet / Broadcom BCM5764M
- WiFi / Broadcom BCM432x
- Wi-Fi BCM4322 [14e4:432b] (rev 01)
- Bluetooth / Broadcom BCM2046
- Audio / Nvidia MCP89
- Power Management
- Firewire / Agere Systems FW643 (1394b)
- Apple iSight
- Apple IR Receiver
- Apple SD Card Reader
- System Summary
Install Debian
Runs on Bullseye installing in default EFI mode with latest Apple firmware. If you want to update EFI firmware, upgrade to macOS High Sierra and repartition the APFS container to allow space for your Linux partitions afterwards as free space or as a HFS+ partition to be deleted during the Debian installer partitioning process. Be aware partitioning utilities and grub on Linux may not identify APFS partitions properly.
Hardware
CPU / Core 2 Duo P8600
See #cpuinfo for more details.
Occasionally only one out of the two cores is activated. Apparently adding the following to the kernel command line resolves this issue (unconfirmed):
acpi_apic_instance=2
GPU / Nvidia Geforce 320M
The GPU is an NVAF integrated graphics core in the MCP89 chipset.
nouveau driver (open source)
- Works for 2D and 3D out of the box.
- Automatic power management is missing.
- On Bullseye, a minor adjustment to GRUB's config is necessary to enable suspending and hibernating (see below)
proprietary nvidia driver
- NO LONGER MAINTAINED.
- Unsupported by the 5.10 kernel; unavailable in Bullseye.
- Requires setting PCIe registers to work around Apple's EFI firmware quirks. See Black screen fix (EFI mode) below.
- Backlight control may require nvidiabl kernel modules to be built.
2D
- KMS works.
- No xorg.conf needed for X
3D
- Supported as of Linux 2.6.37
- Mesa's nouveau_dri driver works, but with occasional rendering errors.
External display
- Mini Display Port connector works as of linux 3.2
Fix Suspending and Hibernating on Bullseye
A kernel option enabled in recent kernels causes suspension and hibernation to become dysfunctional when using the open source nouveau driver (which is the only driver available for this hardware as of Bullseye). The working solution is to disable this kernel option in the GRUB config: simply add "init_on_alloc=0" to the space-separated list of options in GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub:
$ vi /etc/default/grub ... GRUB_CMDLINE_LINUX_DEFAULT="quiet splash init_on_alloc=0 intel_iommu=off" ...
Note that your system may have values other than 'quiet' and 'splash' in this list. Simply append the change to the end (with a preceeding space). After saving this change, be sure to run update-grub2 so that the changes are applied to /boot/grub/grub.cfg. This fix works for the default 5.10 kernel in Bullseye. See Bug#989705 for details.
The kernel parameter "intel_iommu=off" fixes a broken wifi connection on kernel version since "5.10.0-15-amd64", due to a b43-phy0 kernel module error: "b43-phy0 ERROR: Fatal DMA error".
Backlight control
- nv_backlight (nouveau) works in recent kernels. apple_bl works, but nv_backlight is preferred by gnome-settings-daemon.
- nvidia may allow backlight control after adding a registry flag to the configuration file.
#> cat /etc/X11/xorg.conf.d/20-nvidia.conf Section "Device" Identifier "My GPU" Driver "nvidia" Option "RegistryDwords" "EnableBrightnessControl=1" EndSection
nvidia backlight did not function with nvidia-legacy-340xx-driver on Buster. nvidiabl dkms modules needed to be built to restore backlight adjustment within Gnome 3 and keyboard control. See https://github.com/yorickvP/nvidiabl.
Black screen fix (EFI mode)
According to a post on askubuntu.com, the black screen when starting X11 while using the proprietary nvidia driver is not a driver issue. When booting in EFI mode (while handing over to grub), Apple's firmware does not actually activate the VGA card as PCI-E bus master. We can fix this setting up two PCI-E registers: one that enables bus-mastering on the video card and the other one enabling VGA support on the PCI-E bridge of the video card.
- Determine the PCIe IDs for the graphics card and the PCI-E bridge that it is connected to
#> lshw -businfo -class bridge -class display .. pci@0000:00:17.0 bridge MCP89 PCI Express Bridge pci@0000:04:00.0 display MCP89 [GeForce 320M]
- Create a GRUB script for setting the PCI-E registers during boot and update GRUB configuration
#> vi /etc/grub.d/01_enable_vga.conf cat << EOF setpci -s "00:17.0" 3e.b=8 setpci -s "04:00.0" 04.b=7 EOF #> chmod 755 /etc/grub.d/01_enable_vga.conf #> update-grub
- After rebooting, the register values should have been set accordingly, which can be check as follows
#> setpci -s "00:17.0" 3e.b 08 #> setpci -s "04:00.0" 04.b 07
- Using the proprietary nvidia driver now, there should be no more black screen when starting X11.
Note: The Mac Mini 4.1 basically uses the same hardware, but there's no black screen when using the proprietary nvidia driver in EFI mode.
Apple ClickPad
Multi-touch gestures like the drag two-finger drag gesture are supported in the current xserver-xorg-input-synaptics package (>1.6.1).
If you would like your touchpad to behave like the natural scrolling mode in Mac OS X Lion, you have to add the next line to your ~/.Xmodmap
pointer = 1 2 3 5 4 7 6 8 9 10 11 12
Apple Touchpad
?MacBookPro3,1 touchpad behavior might be smoother with the kernel boot option:
appletouch.threshold=3
possibly adding it to the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/defaults/grub
For older versions you can check PageFragmentClickPadOld
Apple Keyboard
Configuration
You can set up the keyboard layout with this command:
$ sudo dpkg-reconfigure keyboard-configuration
This will change the config file /etc/default/keyboard into something like this:
XKBMODEL="apple_laptop" XKBLAYOUT="us" XKBVARIANT="mac" XKBOPTIONS="terminate:ctrl_alt_bksp"
… or another example:
XKBMODEL="pc105" XKBLAYOUT="fr" XKBVARIANT="mac" XKBOPTIONS="lv3:rwin_switch"
Default behaviour
'fn'+'Enter' -> Insert
'fn'+'Backspace' -> Delete
'fn'+'Up' -> PageUp
'fn'+'Down' -> PageDown
'fn'+'Left' -> Home
'fn'+'Right' -> End
'Clear' -> NumLock
Function key behaviour
The hid_apple module has a parameter called 'fnmode' to change the behaviour of the 'fn'-key
There's three settings for fnmode:
- 0 = disabled: Disable the 'fn' key. Pressing 'fn' has no effect
- 1 = fkeyslast: Enable the 'fn' key. Pressing 'F1-F12' keys will act as special keys. Pressing 'fn'+'F1-F12' will behave like 'F1-F12'.
- 2 = fkeysfirst: Enable the 'fn' key. Pressing 'F1-F12' keys will behave like the real 'F1-F12'. Pressing 'fn'+'F8' will act as the special key (play/pause in this case).
There's several ways to set this parameter:
using sysfs, for example:
$ echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
as a module parameter (won't work if you compile hid_apple in your kernel):
$ echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf $ sudo modprobe --dry-run hid_apple
if this throws no error you can
$ sudo update-initramfs -u
on the kernel command line: edit /etc/default/grub, and add the following to the GRUB_CMDLINE_LINUX_DEFAULT variable:
hid_apple.fnmode=2
Swapped keys on international keyboards
The hid_apple module also has a parameter called 'iso_layout'
- 0 means international layout, so on an 'English International' keyboard the '§±'-key will be top left, and the '`~'-key will be next to left shift
- 1 swaps it around
There's several ways to set this parameter:
using sysfs, for example:
$ echo 0 | sudo tee /sys/module/hid_apple/parameters/iso_layout
as a module parameter (won't work if you compile hid_apple in your kernel):
$ echo options hid_apple iso_layout=0 | sudo tee -a /etc/modprobe.d/hid_apple.conf $ sudo modprobe --dry-run hid_apple
if this throws no error you can
$ sudo update-initramfs -u
on the kernel command line: edit /etc/default/grub, and add the following to the GRUB_CMDLINE_LINUX_DEFAULT variable:
hid_apple.iso_layout=0
See also
See also AppleKeyboard on Ubuntu's wiki.
SATA / Nvidia MCP89
The firmware switches the SATA controller in two different modes depending on how the system was booted. In CSM/BIOS mode the sata_generic driver is used; in EFI mode the ahci driver is used.
SATA / AHCI Mode
Many SATA controllers have two modes of operation: IDE mode (using the ata_generic or the ata_piix kernel modules for example), and AHCI mode (using the ahci module). Apple determines the mode of operation on boot based on whether the system is booted in EFI mode or BIOS compatibility mode (see the whole section on EFI/BIOS for more detail).
When you use BIOS mode the SATA controller will be switched to IDE mode. If you want to set the controller in AHCI mode while using BIOS compatibility before the kernel boots up, you can do it using GRUB2. The reason why you might want to do this, is because the AHCI mode and module ensures better performance under load, and is generally more stable.
The fix is to just add a setpci call on your GRUB configuration. To be safe you can test it by going into command line mode in GRUB, and doing something like this:
> lspci (check for the ID for IDE mode, in my case 8086:2828) > setpci -d 8086:2828 90.b=40 > lspci (The 2828 ID is now gone, replaced by 8086:2829, AHCI/SATA mode)
You can add this to your GRUB configuration, and avoid losing it on upgrades, by adding a script like this to /etc/grub.d/:
#!/bin/sh set -e ## Enable SATA (AHCI) mode on macbook 3,1 echo "setpci -d 8086:2828 90.b=40"
For more info see these blog posts:
Gigabit Ethernet / Broadcom BCM5764M
Works our of the box with the tg3 driver.
WiFi / Broadcom BCM432x
Installing the driver
The Broadcom BCM4321 and BCM4322 are supported by the b43 driver as of Linux 2.6.38. Later kernels improve the speed and stability of the aforementioned “N-PHY” hardware considerably (thank you, Rafał Miłecki).
To confirm you have such hardware you can refer to http://wireless.kernel.org/en/users/Drivers/b43#Device_firmware_installation
Installing the firmware
Ensure you have “contrib” archive area set up in your /etc/apt/sources.list, for example:
deb http://ftp.us.debian.org/debian wheezy main contrib non-free
Next (after an “apt-get update” of course) install the firmware-b43-installer package:
$ sudo apt-get install firmware-b43-installer
The hardware will be fully functional the next time the b43 driver is loaded (after reboot or by explicitly unloading/loading the driver).
Alternative driver
This hardware is also supported by the proprietary wl driver.
Known issues
BCM4321: The wl driver offers many more options than b43, this is specially useful for some advanced wireless scanning and performance data. The main difference, however, is that the b43 driver does not know how to do proper power-saving with this card. The wl driver does a much better job. This is noticeable in the temperature of the card, usually a difference of 10-15°C. In favor of the b43 driver, it is much faster to scan and join wireless networks.
See also
Wi-Fi BCM4322 [14e4:432b] (rev 01)
Proprietary wl driver appears more reliable and faster than b43 on MacBookPro 7,1 with BCM4322 [14e4:432b] (rev 01). With either driver, Wi-Fi fails to scan and find networks upon boot on Buster. Scan functionality is restored by putting the computer to sleep and waking it up again.
Bluetooth / Broadcom BCM2046
Works out of the box with the btusb driver.
Audio / Nvidia MCP89
Works out of the box with the snd-hda-intel driver.
Some remarks though:
- speakers are quiet by default: opening up surround speakers using alsamixer helps
- however, only one of the surround speakers is active for me, there's no way to activate left surround channel
- S/PDIF (optical) is always active after sleep or reboot
Power Management
Suspend to ram works out of the box.
Firewire / Agere Systems FW643 (1394b)
Works out of the box.
Apple iSight
Works out of the box with the uvcvideo driver.
Apple IR Receiver
Untested. See also:
Apple SD Card Reader
Works out of the box with the usb-storage driver.
System Summary
cpuinfo
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz stepping : 10 microcode : 0xa07 cpu MHz : 798.000 cache size : 3072 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts tpr_shadow vnmi flexpriority bogomips : 4778.22 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz stepping : 10 microcode : 0xa07 cpu MHz : 2394.000 cache size : 3072 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts tpr_shadow vnmi flexpriority bogomips : 4778.22 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management:
lspci
00:00.0 Host bridge [0600]: nVidia Corporation MCP89 HOST Bridge [10de:0d60] (rev a1) 00:00.1 RAM memory [0500]: nVidia Corporation MCP89 Memory Controller [10de:0d68] (rev a1) 00:01.0 RAM memory [0500]: nVidia Corporation Device [10de:0d6d] (rev a1) 00:01.1 RAM memory [0500]: nVidia Corporation Device [10de:0d6e] (rev a1) 00:01.2 RAM memory [0500]: nVidia Corporation Device [10de:0d6f] (rev a1) 00:01.3 RAM memory [0500]: nVidia Corporation Device [10de:0d70] (rev a1) 00:02.0 RAM memory [0500]: nVidia Corporation Device [10de:0d71] (rev a1) 00:02.1 RAM memory [0500]: nVidia Corporation Device [10de:0d72] (rev a1) 00:03.0 ISA bridge [0601]: nVidia Corporation MCP89 LPC Bridge [10de:0d80] (rev a2) 00:03.1 RAM memory [0500]: nVidia Corporation MCP89 Memory Controller [10de:0d7b] (rev a1) 00:03.2 SMBus [0c05]: nVidia Corporation MCP89 SMBus [10de:0d79] (rev a1) 00:03.3 RAM memory [0500]: nVidia Corporation MCP89 Memory Controller [10de:0d69] (rev a1) 00:03.4 Co-processor [0b40]: nVidia Corporation MCP89 Co-Processor [10de:0d7a] (rev a1) 00:04.0 USB controller [0c03]: nVidia Corporation MCP89 OHCI USB 1.1 Controller [10de:0d9c] (rev a1) 00:04.1 USB controller [0c03]: nVidia Corporation MCP89 EHCI USB 2.0 Controller [10de:0d9d] (rev a2) 00:06.0 USB controller [0c03]: nVidia Corporation MCP89 OHCI USB 1.1 Controller [10de:0d9c] (rev a1) 00:06.1 USB controller [0c03]: nVidia Corporation MCP89 EHCI USB 2.0 Controller [10de:0d9d] (rev a2) 00:08.0 Audio device [0403]: nVidia Corporation MCP89 High Definition Audio [10de:0d94] (rev a2) 00:0a.0 SATA controller [0106]: nVidia Corporation MCP89 SATA Controller (AHCI mode) [10de:0d88] (rev a2) 00:0b.0 RAM memory [0500]: nVidia Corporation Device [10de:0d75] (rev a1) 00:0e.0 PCI bridge [0604]: nVidia Corporation Device [10de:0d9a] (rev a1) 00:15.0 PCI bridge [0604]: nVidia Corporation Device [10de:0d9b] (rev a1) 00:16.0 PCI bridge [0604]: nVidia Corporation Device [10de:0d9b] (rev a1) 00:17.0 PCI bridge [0604]: nVidia Corporation MCP89 PCI Express Bridge [10de:0d76] (rev a1) 01:00.0 FireWire (IEEE 1394) [0c00]: Agere Systems FW643 PCI Express 1394b Controller (PHY/Link) [11c1:5901] (rev 08) 02:00.0 Network controller [0280]: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] (rev 01) 03:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5764M Gigabit Ethernet PCIe [14e4:1684] (rev 10) 04:00.0 VGA compatible controller [0300]: nVidia Corporation Device [10de:08a0] (rev a2)
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 002: ID 05ac:8507 Apple, Inc. Built-in iSight Bus 002 Device 002: ID 05ac:8403 Apple, Inc. Internal Memory Card Reader Bus 004 Device 002: ID 05ac:0237 Apple, Inc. Internal Keyboard/Trackpad (ISO) Bus 004 Device 003: ID 05ac:8242 Apple, Inc. IR Receiver [built-in] Bus 004 Device 004: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth) Bus 004 Device 005: ID 05ac:8213 Apple, Inc. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 EHCI Host Controller Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 EHCI Host Controller Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 OHCI Host Controller Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 OHCI Host Controller Bus 001 Device 002: ID 05ac:8507 Apple, Inc. Built-in iSight bDeviceClass 239 Miscellaneous Device bDeviceProtocol 1 Interface Association iProduct 2 Built-in iSight (Bus Powered) bDeviceClass 239 Miscellaneous Device bDeviceProtocol 1 Interface Association (Bus Powered) Bus 002 Device 002: ID 05ac:8403 Apple, Inc. Internal Memory Card Reader bDeviceClass 0 (Defined at Interface level) bDeviceProtocol 0 iProduct 4 Card Reader (Bus Powered) bDeviceClass 0 (Defined at Interface level) bDeviceProtocol 0 (Bus Powered) Bus 004 Device 002: ID 05ac:0237 Apple, Inc. Internal Keyboard/Trackpad (ISO) bDeviceClass 0 (Defined at Interface level) bDeviceProtocol 0 iProduct 2 Apple Internal Keyboard / Trackpad (Bus Powered) (Bus Powered) Bus 004 Device 003: ID 05ac:8242 Apple, Inc. IR Receiver [built-in] bDeviceClass 0 (Defined at Interface level) bDeviceProtocol 0 iProduct 2 IR Receiver (Bus Powered) (Bus Powered) Bus 004 Device 004: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth) bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 BRCM2046 Hub Bus 004 Device 005: ID 05ac:8213 Apple, Inc. bDeviceClass 255 Vendor Specific Class bDeviceProtocol 1 iProduct 2 Bluetooth USB Host Controller