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 - 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.
The PS/2 interface saves power due to its interrupt-driven nature compared to USB which requires periodic polling, so it is a popular interface for laptops' internal keyboards and pointing devices
The major difference is that PS/2 is a de-facto standard up to the application layer/software interface, while the MacBook SPI protocol is unique to Apple.
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.
Then I think people need to step back and appreciate that this "basic functionality" is actually really expensive in terms of price, space, power and performance.
Would they really pay more for Apple hardware if it booted up with a full internal USB or a PS/2?
What if it made the laptop heavier? Shortened the battery life? These things are very important to me: I wouldn't buy a heavier Mac.
Could this be mitigated with custom ASICs? Or a new power switch and some extra power controllers (e.g. a soft switch to turn off the fallback 8042 and start using the faster more sensible SPI interface)? Perhaps, but someone has to pay for it.
Moaning about things that don't make sense to change -- that someone just doesn't like, just makes that someone unhappy.
PS/2 has not been implemented with a real 8042 for a very long time. Standard laptop ECs which are cheap and widely available have optimised dedicated hardware to handle the protocol. Speed is not a problem either, because this doesn't need to be a physical PS/2 interface with a separate keyboard on the end of it --- in the designs I've seen, the EC scans the key matrix itself and just provides a PS/2 software interface. It really doesn't matter what the physical interface on a laptop is, since the software interface is what's important here; Apple could've used something similar to PS/2 but increased the clock rate to whatever they needed, and it'd still look the same and be compatible to existing software.
USB is not a good idea from a power perspective since it is a polled bus and there's plenty of additional unneeded complexity throughout the whole stack, but PS/2 is interrupt-driven and extremely low-power.
In fact, it is a synchronous serial protocol just like SPI, so what appears to have happened with these MacBooks is that Apple basically reinvented PS/2 in their own "Think Different" way.
If you deliver a byte per interrupt to be compatible with PS/2 then your system has to wake up more frequently than a DMA/SPI interface.
> USB … is a polled bus
> PS/2 is interrupt-driven and low-power enough for me.
This is wrong.
USB and PS/2 both deliver an interrupt when there is data available.
USB can be configured to directly store the data in memory, so that in the ISR the operating system simply scans memory.
PS/2 on the other hand has to be polled inside the ISR, whether there is data available or not. Not a problem for a keyboard, but touchpads send a lot of data (of course, this is why everyone uses SPI for touchpads)
> It really doesn't matter what the physical interface on a laptop is, since the software interface is what's important here
This is a common, but fundamental misunderstanding of how software and hardware work.
Hardware is not mere programmable matter, it has wires and current, and those wires take up space, and that current draws down your battery.
A lot of laptop vendors have to include "compatibility chips" that take up space and draw down battery because they don't control the software, but if they did control the software they could make their users happier.
Nothing says Apple couldn't just add DMA capabilities to a PS/2 controller, sort of like how bus-master IDE works.
That's just DMA, but the USB controller itself has to physically poll the bus. (Excepting some features in USB 3.x, which I don't think I've seen any use of currently for keyboards or mouses.)
If I remember correctly, the polling is only necessary for writing commands to the controller+device, and not the usual reading of data. There are plenty of touchpads that use PS/2 as well, and they usually appear to be mouses until switched to a different protocol mode.
"compatibility chips" - such as?
The amount of processing required for a USB stack is far greater than for PS/2 and presumably Apple's custom SPI solution. I think the main point to take away from all this discussion is that although Apple could've taken an existing widespread and compatible interface with similar characteristics and enhanced it to fit their requirements, they didn't.
...and that obviously many users here are not "happier" because of it, but Apple doesn't care.
> That's just DMA, but the USB controller itself has to physically poll the bus.
Who cares? The USB controller requires a fraction of the power that the CPU does.
If I have to choose between a microcontroller polling for "interrupt endpoints" and the CPU, you know what I'm going to choose.
> If I remember correctly, the polling is only necessary for writing commands to the controller+device, and not the usual reading of data.
No. You must wait for inb(0x64) & 1 before reading from 0x60. Note this dance is actually quite long:
It's probably okay for a keyboard and a low-resolution mouse. Maybe. It's definitely not okay for a touchpad.
> There are plenty of touchpads that use PS/2 as well, and they usually appear to be mouses until switched to a different protocol mode.
With extra chips.
I think the main point to take away from all this discussion is that although Apple could've taken an existing widespread and compatible interface with similar characteristics and enhanced it to fit their requirements, they didn't because it was more expensive.
You might think some people want Apple laptops to be hacker friendly, and you might be right, but my point is that you should consider that some people would rather they be cheaper and lighter and more power efficient.
The code clearly shows that all the ISR does is read from the status port, and if there is data available, read it from the data port. It only does nothing in the unlikely case that no data is available (could be a spurious interrupt.) I have written code like this before. There is no waiting, no polling. Receive an interrupt, read a byte. Some devices will actually let you read multiple bytes (just keep reading until one of the bits in the status register goes off.)
You're claiming it would significantly increase cost to enhance an existing interface (as opposed to redesigning everything and the nontrivial NRE of that?), on a laptop that itself costs far more than the majority of others using a standard or slightly enhanced standard interface.
Ugh. Almost everybody uses SPI for touchpads these days, although they frequently also provide a PS/2 compatibility mode. Apple don't care about working with stock operating systems other than their own (the Bootcamp installer injects additional drivers for Windows), so they decided not to bother.
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?  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.
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
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.
For the X260, for example, it has these links:
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.
If you could 100% compartmentalize this, have people working on it independently, maybe you could minimize impact, but how can you justify that spending?
They know the open-source community is capable of working to fix problems like this.
The open-source community can do it. Look, we got Linux on the PS4. This isn't even hard by comparison.
It's about control. Apple doesn't want YOU to replace OSX, they want to do it themselves with something they control, not let you gain control.
However thanks to the razor thin margins and the desktops being replaced by laptops with docking stations, they are a dying breed.
Investing in Linux would not be a problem it just means that is becomes just a tiny bit harder to do whatever they want on the hardware side. I'm surprised they still maintain Bootcamp.
Apple prefers and has done a lot better with smaller, more focused teams.
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  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.
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 :)
It wouldn't be too much to assume that they support this keyboard controller as well.
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.
(By regulation, in some countries, like the UK)
It's also not uncommon in the "lower ranks". I just bought a 800 € ultrabook with a 256 GB Samsung PM961 SSD (NVMe, 2.8 / 1.1 GB/s) and the Skylake i7 for example.
For more info: http://www.linuxatemyram.com/play.html
> 512GB SSD with transfer speeds of 1400MB/s and 16GB DDR4 RAM
This is a 2015 model.
The "staingate" name is odd, it's definitely not staining, the laminate just wipes right off with little effort.
I use a microfiber cloth to remove dust from the MacBook Pro display. Never have used a chemical once, there is no need if you are dusting a display.
I'd take a video and show you how you can scrape off the laminate with quite literally anything, but I have nothing to prove to you. Besides, as another commenter has pointed out, Apple is apparently replacing these screens if you can handle to be away from your work machine for the repair time.
It's build quality.
I bought it brand new knowing about Staingate and purposefully treated the screen with kid gloves, yet here we are.
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. :-)
I followed this guy's blog for some further configuration: https://alexcabal.com/get-a-working-touchpad-on-a-14-razer-b...
My main problem was that battery life was pretty abysmal under Linux. With Windows, I would get 4-5 hours under light usage, but under Ubuntu I would pretty much only get ~2-2.5 hours, even without doing much on it. Stressing the CPU/GPU made it die even faster. But that thing isn't really known for its battery life anyways.
Unfortunately I don't have Ubuntu installed on it anymore because I couldn't get Windows and Ubuntu to happily coexist side-by-side. Windows (10) always gave me a boot failure when Ubuntu was installed next to it.
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.
I haven't had a blue screen of death or lockup on the various Windows laptops I've been forced to use for work since some time in the mid 2000s. My desktop machine runs Ubuntu and I have not had any stability issues over several versions.
When I replace my MBP it will be with a laptop running some flavor of Linux.
I never was much of a apple fan but this notebook was so good investment. I wish i would get something equaly good again. Unfortunately all that unrepairable glued bullshit is just sad.
My 18 yr old cousin drives a 1988 Volvo with holes in the floor and a missing second gear, and he's the cool one in his group. Because he has the most inconvenient car. That's cool in his group.
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...
Are you insinuating that was the case here? Source please, I'd be interested to read about that.
This should really only affect Windows systems as far as I know -- Windows is running an executable stored in the firmware at boot (a rather dubious feature, in my opinion, but it's intended as an anti-theft measure). Lenovo used that feature to try to circumvent removal of their crapware when someone reinstalls the OS.
I'm not insinuating anything. All I know is that Lenovo broke our collective trust before, thinking they can get away with it.
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.
Sierra has disabled the "install from any source" option (although you can re-enable it with some terminal magic). How long until they disable the identified developers option too and leave a system like the iphone?
Apple is never going to completely lock down the Mac because it can't be a development platform if it is locked down. Besides, why would they even want to?
I would bring up a libertarian argument to counter this view, but unfortunately I don't politically lean that way do it wouldn't be authentic. Somebody definitely should make that point, though.
Like Richard Stallman?
Never. That would literally kill the platform. And nothing Apple has done has indicated that they even want to go this route. For example, against all expectations, they haven't been expanding the set of sandbox exemptions for apps, which means there are still large classes of apps that cannot be distributed on the App Store as they need functionality that isn't available in the sandbox.
Removing the "disable Gatekeeper" option from the UI does not indicate that Apple wants to force everybody on the App Store, it means that Apple wants everybody to codesign their apps. But, as you already mentioned, you can easily re-enable it from the CLI, and anyone who isn't capable of finding out how to do that is almost certainly not qualified to judge the security implications of making that change.
Also one of Sierra's new features is adding support for non-MAS apps to use iCloud features. If they were planning to freeze out non-MAS apps, why would they do that?
The ethical problem on macOS is that Apple is imposing artificial technical barriers to push people to pay Apple what amounts to "protection" money.
On iOS, there is no reasonable way to bypass the app store for the vast majority of users.
The next time you see something you don't understand, your automatic reaction shouldn't be "those greedy bastards", it should be to actually educate yourself as to why it's being done. You may find that in a lot of cases there are actually really good reasons for it. And even if you decide that you don't agree with the reasons, that doesn't make it appropriate to accuse someone of being greedy or doing "evil" things (e.g. artificial technology barriers to extract money), and it's rather offensive for you to do that.
It doesn't matter how much it costs. Even if it only costs $0.01 a year it would offer the same level of protection.
The only thing the fee does is limit the number of developer certificates to one per bank account.
Obviously, the $99/year isn't making Apple a lot of money. But what it is doing is creating a culture of acceptance around Apple-as-gatekeeper. The iOS app store is most certainly making Apple a non-trivial amount of money (yes I know its a small percentage of their total at the moment.)
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.
The alternative to the App Store isn't selling through a huge publisher who takes a huge cut, it's selling directly and keeping almost all of the money.
Second, Apple most definitely does "impede" the installation of apps downloaded independently by requiring you to perform an obscure dance to execute them.
Even for unsigned apps, I don't thing two clicks instead of one is all that obscure.
They did in fact participate in PRISM, sorry to get you so worked up.
The idea that a constrained team spent the time to intentionally 'break' some 'standard' functionality to prohibit linux from working is laughable as well.
The NSA talks about them in internal documents, that they have absolutely zero incentive to lie on, that Apple is a part of PRISM. Why would the NSA lie about that on an internal document.
Don't you think there would be documents saying "We tried to get Apple to cooperate, but they didn't. Until they do, these are the steps, techniques, and hacks we will use against their technology." I don't remember seeing any such documents.
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.
That shows fairly malicious intent on behalf of Lenovo. They just can't be trusted, at least not after a few years with a clean record.
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.