428 points · by danjoc · 10y ago · 278 comments
1) The input devices are on SPI, not USB. Apple's ACPI tables don't provide the GPIO mappings for these things via the standard mechanisms, so the chipset driver won't bind. You then still need another driver for the SPI controller, and there's an out of tree one at https://github.com/cb22/macbook12-spi-driver/ . Longer term, the kernel needs to be able to parse Apple's ACPI tables and that driver needs merging.
2) Apple's NVME hardware uses the wrong PCI device class, possibly because it's not entirely NVME compatible (trying to read 64 bits of mmio register space in one go will fail, for instance). Linux has a specific entry for the older Apple NVME devices, and that may need to be broadened.
3) Having source ID checking enabled when doing IRQ remapping results in the system hanging on boot. It's unclear what the underlying problem is.
Windows works fine because Apple provide drivers for (1) and (2). (3) is unclear - Windows may be setting up interrupt remapping differently, or it may never enable source ID verification. These issues are far from unusual when dealing with Apple hardware ((1) was true for the new Macbook, (2) has been true since Apple introduced NVME, (3) is the kind of weirdness that we've seen on Apple hardware ever since they went Intel), and this particular set of breakage is unsurprising.
I spend some time while I was at Red Hat trying to keep Apple hardware working (https://mjg59.dreamwidth.org/12037.html is an example of what we had to do), but I don't know that anybody's really working terribly hard on it these days.
Things like this make me wonder if Apple is deliberately going for proprietariness as a sort of vendor-lock-in, because I can't see any other compelling reasons for coming up with a completely different interface for such basic and existing devices. USB and PS/2 are standardised to the point that hardware and software for them are widely available and cheap. They're also extensible, so one does not have to reinvent everything to add additional features.
I still remember when the first "Intel Macbooks" came out with nearly identical hardware to a PC laptop of the same era, i.e. keyboard and trackpad looked like standard PS/2 devices. Later models of PCs and Macs started using USB internally (which is in some ways more complex, since the existing PS/2 interface was provided by the EC via LPC whereas USB may require an additional controller and definitely requires routing additional signals between it and one of the USB ports on the chipset), but at least they would still work relatively standardly.
Personally, I'm all for new features but implemented in backwards-compatible or relatively standard ways. Apple doesn't seem to be a fan of that.
I don't know enough about the implementation to speak to why they made this choice, but for what it's worth, SPI is a standard[1] - and a quite old one. I suspect, were we to follow this down the rabbit hole, that we'd find it's related to power management.
1. https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bu...
You argument in this case is very similar to defending use of custom TCP protocol for web browsing. While TCP is standard, there is nothing standard about it to browse the web, we have HTTP for that
PS/2 is too slow for the volume of data coming out of a modern touchpad. USB is a lot more hardware, though that is small in the context of a CPU. It may just be that with I2C running around the motherboard for all the miscellaneous devices it just makes sense to use that.
It's not like USB which defines device classes and the higher-level layers of the stack, or PS/2 where e.g. all PS/2 keyboards or mice are expected to have an identical basic set of functionality and behaviour. There are certainly proprietary "vendor-specific" extensions to those, but e.g. it's almost a given that if you plug in a USB keyboard, all the standard QWERTY keys should work effortlessly; and while there may be extensions like displays and touchbars that require specific drivers, the core functionality doesn't change.
If I understand correctly, what Apple did here is invent their own protocol for the keyboard which is completely different from what any PC or earlier Macs have, thus the lack of any functionality from Linux. And given how crucial a keyboard is to being able to do anything with the computer, it's no wonder this has caused much consternation.
I think many people are used to the idea that even if the OS does not provide drivers for specific devices, basic functionality like keyboard, mouse, and video (even if it's something like a VGA 640x480 16 colours mode) should still be present --- partly to enable "bootstrapping" into more functionality by installing and troubleshooting the drivers.
My recollection was that the transition to using USB as an internal protocol came slightly before the PPC->Intel transition, and that the first several generations of X86 Mac laptops used USB internally for trackpads and keyboards. You sure there were ever any using PS/2? Seems unlikely.
1. What's the __1e6 alignment? [0] I've never heard of that.
2. How is the driver author going about writing that driver? Some of the comments seem to allude to analyzing what the Windows driver is doing. Do you think they're disassembling the Windows driver and trying to re-implement a Linux compatible driver in C? I don't see how anyone could implement a driver like this off the bat without some data sheet or existing code to look at.
Edit: thanks to people pointing out it's __le16, not __1e6. I need to change my font; even now I can barely tell the 1 and l apart.
[0] https://github.com/cb22/macbook12-spi-driver/blob/master/app...
Little endian 16 bit
As for the driver itself, the spi interfaces are not too hard to understand. It's unlikely anyone is disassembling anything.
The normal way to figure out the packets the touchpad uses are to look at the datasheets/etc you can find on whoever made the touchpad.
In this case, it's a bcm5974, and if you look at that driver, you'll see the packet format is the same.
Otherwise, you write a packet dumper and start pushing things
[0] https://github.com/cb22/macbook12-spi-driver/pull/1#issuecom...
[1] https://github.com/cb22/macbook12-spi-driver/issues/3#issuec...
As I've posted before, I am so happy now the Macbook Pro is out because we desperately need help on this issue.
Any of the problems that you usually hear are typically on their non-Thinkpad lines.
No, not on Thinkpads.
Fedora, given its leading edge nature, will have better hardware support than RHEL as the latest firmware will always come first to the former.
The ThinkPads are an semi-independent division within Lenovo.
The real question is if Apple missed providing drivers or if it is deliberate.
The keyboard and mouse are connected by SPI, etc.
These are not super-proprietary things,it's just that a bit more work than wanted in linux.
Linux also "lies" and claims to be Darwin, which causes the wrong ACPI thing to happen sometimes.
This is pretty common (ie linux used to claim to be windows sometimes, too), but in this case, it gets exactly the wrong answer.
(edit: Looks like mjg59 came along and gave a more detailed answer, you should lookat that)
The is no public outcry for the Acer Cloudbook I bought which tolerates Linux about as well as these new MacBooks.† Acer provides no drivers or other help. I don't see any reason to expect Apple to go beyond Acer to support unintended operating systems.‡
␄
† It has trackpad driver problems, EFI mysteries, and a broken APIC (from Linux's viewpoint). With a couple hours hacking about you can get Debian installed, but each new kernel release is a crap shoot that can end in an unbootable machine for some as yet undiagnosed malady. Recent kernels result in it instantly deciding it has overheated and must power down immediately.
‡ I also don't see Acer submitting patches to my operating system, though that would be shocking.
A simple announcement as in "We're working on it. Expect Linux drivers in 6-12 months." would suffice to calm the waves.
When I upgraded my iPhone to iOS 8 (in 2014), it stopped connecting via bluetooth with my car (2011 Subaru, FWIW). Apple told me it was a Subaru problem. I reiterated that the problem was caused by my upgrading iOS, and that nothing changed in my car. They said to get a firmware upgrade for my car.
So incompatibility can be symmetric, but for people with an expectation based on prior compatibility, the party that whose update triggers the issue will be seen (fairly or not) as the cause.
E.g. if you sell an office suite and it doesn't support DOC and XLS files, it's your fault and users will call you for it. It's not Microsoft's job to go make sure Word and Excel work with your office suite.
It is not comedians' job to respect other's religious beliefs.
It is not democracy's job to please everyone.
What was your point again?
It took Dell months of effort by a dedicated team [1] to get all the features of a subset of Dell XPS13 laptops working under Linux. I'm actually considering buying one as a Linux machine, and I already own a Macbook.
To think that an Apple laptop would in any way make a good or even workable Linux machine is laughably naive.
Everything just works with a stock kernel. Only minor caveat is that the wireless card has bad range. But also in Mac OS, so not sure this is a driver fault. Easy to fix, I use an external Atheros from Alfa which has incredible range and is great for pen-testing.
Apart from that, the only annoyance is that the battery does not emit ACPI discharge events. But very few laptops do this, apart from some ThinkPads. (I would love to know which do! These are really useful to set up udev sleep rules instead of polling the battery on a tiling window manager & no-desktop-environment setup, but it is a feature rarely documented.)
I would definitely call my MacBook Pro a good (and workable) Linux machine.
I've also used Windows on a MBP for several months. It's not perfect either, there are minor quirks with that too. MBPs really only work perfectly under OS X for obvious reasons, but it's not usually not implausible to use other OSes on a MacBook if you want to do that.
- https://plus.google.com/+MagnusHoff/posts/Bnor8DQkKZ4
- https://plus.google.com/+MagnusHoff/posts/b23xMvSk3Hg
- https://plus.google.com/+MagnusHoff/posts/1fUQWHPujX3
- https://plus.google.com/+MagnusHoff/posts/eLtER7D8feX
- https://plus.google.com/+MagnusHoff/posts/7JHdmgZHwy8
- https://plus.google.com/+MagnusHoff/posts/2wJnwgZt2md
Additionally, the SD card slot won't work with ultra high speed SD cards, so I have had to cap the sdhci driver to high speed.
So; Yes, there are some hiccups, but I am a happy camper :)
If we want to signal to the market that we want laptop with linux we need to support this kind of initiative. The fact that linux just work without any changes is great.
It is the only computer I own that runs GNU/Linux on the metal instead of a VM.
I no longer care for long weekends trying to get something to work.
Linus Torvalds, for one, used a Macbook Air with Linux up until a couple of years ago, which he praised as the right way to do laptops (he now uses a Chromebook IIRC).
(He also used a Mac Pro G5 in the mid-00s, again with Linux, and he wrote his autobiography around 2003-4 on an iBook with OS X).
If you're going to run Ubuntu, why not get a Lenovo for much less and with notably better legitimately "Pro" specs?
I haven't used the new one, but the 2015 models were among the best hardware on the market - regardless of what OS was installed.
Personally, I don't care so much about "build quality" in terms of materials used. If the hardware works I'm happy, and the Thinkpad is fine to me.
This is a 2015 model.
Terrible keyboard, terrible cords, glued battery (really???), display which can't forget previous image (crystallization or w/e it's called), terrible mic. Macbooks are not that good.
In saying that, you're absolutely right about things like the poor quality cables, idiotic glued batteries, and parts that can't be easily replaced. Even i.e. keyboards - I've replaced Thinkpad keyboards before when they have worn out, simply because the new keyboard feels a lot nicer than a cleaned up abused one.
Really? I'd imagine there must be a decent repair guy who can simply replace (or just remove) that audio port?
Only a few years ago with their IPS upgrades on i.e. X220s, X230s, suffered from numerous issues (poor gamut, image retention).
I think Apple generally puts more watt-hours in their systems as well, but don't quote me on that. :-)
everyone who argues that and then try to prove their point ends up comparing budget pcs. so tiring.
also my company is full of 2012 and 2013 macbook pros that crash and burn with several hardware video card build issues that for some reason it was never able/willing to return.
Is there a secure enclave chip in Lenovo? Do you really trust their firmware?
Moreover, Apple is far from the cleanly ethical choice you seem to think it is. It blocks or impedes the installation of software that it has unilaterally decided is against its interests + takes a ludicrous percentage of revenue via the App Store.
And would not matter if you were installing Linux per this thread...
What software are you thinking of? Apple maintains editorial control over what's in the App Store, but I can't think of any case where Apple has blocked software distributed outside the app store. The closest I can think of is the fact that the default settings of the computer require apps to be codesigned with an Apple certificate, but Apple doesn't maintain editorial control over who gets certificates, anyone with a developer account can get one (and of course you can even bypass this requirement with right click -> Open, or by changing the security settings on the computer).
> takes a ludicrous percentage of revenue via the App Store
The App Store is completely optional. All software that's published on it can be distributed outside of it. And I don't see how the percentage Apple takes from their completely optional App Store is even remotely connected with ethics.
Do you know what it was before the Apple App store came along? You were handing over about 70-80%, and that was if you could convince a publisher to take your app, which was a very hard sell.
Then Apple came along offering EVERYONE the ability to publish apps, and at a very reasonable cost.
I'm no Apple fan boy, but those Lenovos are not IBM Thinkpads anymore.
Are you saying the quality is down? I can't agree with that, I have kept buying Thinkpads and my X1 Carbon (2nd gen) is fantastic.
Though I do agree that there are better laptops for cheaper.
AFAICT people buy Apple laptops to run macOS; for that you have pretty little choice.
But I've been installing Linux on my work macs for a while, this kind of lag is totally expected.
I saw that Dell no longer sells Linux pre-installed on its XPS machines.
What are some good alternatives?
If I were to buy a laptop to run Ubuntu on today I'd go for their Lemur.
Disclaimer: I work for Canonical.
EDIT: Dell seems to sell their XPS 13 with Ubuntu still? Not sure what you meant: http://www.dell.com/us/business/p/xps-13-9360-laptop/pd?newt...
The high-resolution screen story of these laptops is somehow underwhelming. OTOH a matte screen by default is priceless; I can withstand a full HD 14" screen pretty well. Especially because X has much better font anti-aliasing for smaller fonts than OSX, so my Emacs and terminal windows look more readable even with lower DPI.
A Thinkpad series T is not sleek, but I don't care. I care about the ability to cram a lot of battery power into it, though.
Since I want to run linux though, my question is: is there a specific (older) version of the MacBook Pro that I should consider?
I literally had money set aside to buy a new MBP, but I don't see myself being an Apple customer again anytime soon.
edit: I just don't get this place sometimes. Did I piss off some Apple fans?
I feel like mid-summer next year we're going to start seeing signs of a new Pixel for the Andromeda merging of Android/ChromeOS.
Even on Linux I usually develop inside a VM with a stable OS (CentOS, Ubuntu LTS) that's older than the host environment (current Ubuntu or Fedora).
Vmware fusion actually works pretty damn well but I hate having the extra layer and hearing the fans all the time.
This will probably only work if you take the time to write your own .xinitrc. I'm really sorry about that, but I haven't had an opportunity to find a better solution. Perhaps someone else can further assist you.
I had this exact same problem with an Asus and a Lenovo while running Cinnamon. Try a different GUI and I think you'll be satisfied. Cinnamon is nice, but it still uses far more resources than most other popular Linux GUIs and doesn't run well on certain systems.
i don't understand why you'd want a $4000 MacBook to run only linux. there are so many other options for native installs.
For that amount of money you could get 2 Chromebooks ($179 each), build two decent gaming PCs ($900 each), and rent 5 Digital Ocean VPSs ($5 per month) for two years.
I'm not sure what you're trying to say.
What turns me off OS X is the lack of a good package manager with up to date packages. Has this changed?
- More commercial software available (photoshop, etc).
- OS X is required if you need to run xcode
- Easier to upgrade to the next version of the OS, without having to do a full reinstall
- Better binary compatibility. (Pretty minor issue).
>What turns me off OS X is the lack of a good package manager with up to date packages. Has this changed?
You need to fully reinstall your Linux install every upgrade?
That might be a symptom of Ubuntu usage, but many other distros handle upgrades gracefully. Arch is an example of this.
Homebrew is dope, but it's still a bolted-on package manager. I also hate hate hate that Apple have removed the ability to theme the OSX UI (RIP Flavours). If I'm going to stare at my dev screen all day it should look how I want it to.
Until the new equivalent of Flavours[1] is available, theming OSX is dead in the water.