-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2015 Macbook testing #9
Comments
@theishshah interesting; so it was registering some keystrokes? Last I heard about the 2015 model the SPI driver wouldn't bind properly |
Yeah I'm not sure it seems very sporadic. It is possible that it was interpreting input from an external usb device or something, i'm not sure |
Under a stock linux kernel (4.11.0-rc6) with Intel LPSS modules disabled, the keyboard works again with this module on the 2015 model. However, there are a few issues. Typing is kind of slow/laggy, which could be due to systemd, but it seems unlikely. Also there are issues when typing too fast, which may be due to rollover previously mentioned. Also, trackpad doesn't work at all. It appears the data read related to trackpad is correct, but multitouch isn't properly enabled, as there's only one finger's worth of data. |
Update: the typing lag was due to the clock speed being set low. Bumped it up from 400kHz to the 8MHz and now typing is nice and smooth. Key-rollover issues still occur, of course. I've got the trackpad working with the rel_x and rel_y parameters passed from the device, however I'm getting no multitouch data. |
@Maximus- interesting you say about bumping up the speed; the multitouch initialization might have to do with the issue mentioned by @roadrunner2 here. Alternatively, the initialization packet might be difference on the 2015 model. That would need to be decoded from Windows and added to the driver. |
I'm trying to find those packets in the OS X kexts, and I've checked AppleHSSPIHIDDriver, AppleHSSPISupport, AppleIntelLpssDmac, and AppleIntelLpssGspi; I can't find any trace of them, but they may just be stored a bit differently in the binaries. Downloading the windows drivers now. Also some things I'm not entirely clear on: |
@Maximus- Try the following patch to see if that fixes your mt-initialization (I'll be pushing the full proper patches in a few days): |
@roadrunner2 Those patches work. Multitouch is properly enabled. :-) I have some patches to fix the key rollover issues I'll be posting soon. Good work! Also attached is my DSDT. (Had to add txt extension to make github happy.) |
@Maximus- Thanks for the DSDT - looks like the relevant parts are the same as for the newer MacBook(Pro)'s, so that good. |
@Maximus- If you have a moment, could you per chance try out #14? In particular to verify caps-lock led now works (and of course that initialization and speed still good) |
@roadrunner2 Tested it out. Everything seems to be still be working on the 2015 12" Macbook. Caps lock key included :) |
@Maximus- Thanks! |
It's alive, it's ALIVE! I can't believe the 2015 12" 8,1 machine I'd put away in a closet for two years (awaiting all of your incredible recent efforts) is now functional. I press the letter 'A' on the keyboard and an 'A' appears on screen - insane! Likewise the track-pad, simply awesome! I'd nearly given up hope... I'm sincerely grateful and would be more than happy to assist any further 'polishing' efforts by submitting verbose logs etc (please just let me know). Further, if there's a way to buy you guys some beers over the Internet, I'm more than happy to. I haven't used this machine in angst yet but my only observation is a slight hover over the track-pad (without touching it) is being picked up and acted on. I'm not sure if this will present an annoyance in the future with the thumbs and hand-rests during typing or if it's mechanical and not a software issue etc. As others have suggested, if there's any way to avoid the DSDT modification and a means to keep up with kernel changes, that'd be the icing on the cake. Again, thank you sincerely to everyone who's contributed! John |
@john-morton the linux ACPI devs have proposed a fix to avoid the DSDT modification, which I've been working on (https://www.spinics.net/lists/linux-spi/msg06968.html). |
@Maximus- yeah, I've been following all of threads and aware of this (and looking forward to seeing what might potentially eventuate). Fingers crossed! ;) |
@Maximus- Interesting to hear you're working on something, because so am I 😃 Specifically, I am close to having something working in the applespi driver, where essentially I detect that there's no spi-device, call _DSM to get the info, and then explicitly create an spi-device from that info. While this isn't the better and more comprehensive solution in the core as discussed in the link, it would/will allow folks to use the driver right now until the core has support for this setup. I'd be curious to know what exactly you're doing, and if we should be coordinating or merging or something. |
@john-morton, @Maximus- see #29 for a solution for now (pending the better solution in the core). |
Not strictly a bug related comment, I know, and sorry for that, but I came here looking for a way to start using linux on my macbook 12" 2015 properly, and I'm not sure on how to proceed with this solution. Any quick link to a guide or step-by-step read for noobs on how to compile and load this drivers/modules on an already installed debian distro (dual boot)? I'm still learning, and using an external keyboard every day it's a bit frustrating |
@sergioabril
then
after booting it should work if not try to run inside the cloned git repo
it should work without a reboot now (except if one of the commands gave you an error). If not there |
@choelzl I managed to make and load "applespi" after some hours learning a bit more of linux kernel and modules, and then added the "intel_lpss_pci" module aswell (note: I used modprobe, and also added them to /etc/modules just in case, since I've nothing like 'mkinitcpio.conf' anywhere). However, I have no clue of what to do with "spi_pxa2xx_platform"; it doesn't exist as a module anywhere, and can't load it using modprobe. (I guess I should find the source, maybe on my linux-source folder, and compile it somehow?) I guess all this is way over my linux knowledge for now... I'll keep on investigating. But thank you again for trying 👍 (P.S. No, didn't get my keyboard working) |
@sergioabril what kernel and distro do you run ? mkinitcpio is used for arch, in some cases you might look for initramfs in your kernel (/etc/initramfs/initramfs.conf would be the file for example where you add the modules in that case). |
@sergioabril The
If you see Regarding where to add the modules for the ramdisk: assuming Debian uses initramfs-tools/mkinitramfs like Ubuntu does, then you'll need to add the modules to |
@choelzl I'm using kernel 4.9.0-Kali4-amd64 (Debian 4.9.25-1kali1) I tried what @roadrunner2 said and the message I got was "CONFIG_SPI_PXA2XX is not set", so I decided to build just the module (after trying to rebuild the hole kernel, I thought it twice). Apparently, now I have the three modules built and loaded, and all of them appear when I type The only message the dmesg throws related to these three modules, is Where should I be looking for errors or possible problems? P.S: I also tried adding |
@sergioabril Does the applespi driver attach it self to the device ? Does your dmesg give any hint about what applespi is doing ? ("dmesg | grep applespi") I run on ArchLinux 4.11.4 without any trouble installing, just adding the modules to mkinitcpio.conf and installing applespi and it worked pretty much (the only problem is after every kernel update I have to manualy reinstall the driver) |
@choelzl no, it's not there; for some reason, Lucky you with ArchLinux! (Although I might have the same problems on ArchLinux too; I'm probably building it the wrong way). Thanks anyway. |
@sergioabril I'm using debian (kali linux is based on debian) and it works just fine. |
@sergioabril The Next, verify that the ACPI device exists: what does
show? (that directory should exist, and the driver in there should point to The fact that you see absolutely no messages from applespi indicates that somehow the applespi driver is not being attached to the APP000D device. You can also try (re)loading the module with extra debugging turned on:
but it's unlikely to show anything either. |
I never ended up getting to the bottom of this, but I noticed that when I cloned a stock kernel from github.com/torvalds/linux (and only enabled USB-related drivers), this driver worked entirely fine. The moment I enabled any Intel-Lpss related options, the reads would be all zeros. Even disabling the Intel-Lpss options, and doing a The only time any of this worked was when I compiled a fresh kernel with only the few things I needed, and it never seemed to work from blacklisting modules while in archlinux. I haven't tested this lately, as some of apple's newest apfs stuff seems to have messed with refind and my dual booting. |
WOOOOOT!!! applespi_working_debug.txt I've included the debug details incase they are of interest. If you need me to test anything else, please ask. I suggest you claim the bounty that has grown at the link below, because I certainly think you've earned it! Well done & thanks :D |
@Maximus- Thanks for the response. So that makes sense: it turns out that building the kernel with |
@denverslair This is the first I'm hearing about As to the bounty, thanks, but I think that would belong to @cb22. |
If I don't include By including the |
A quick update/summary for MacBook8,1 (2015). The patch to fix the missing spi master device has been accepted, so I expect it to be in kernel 14.4. Until then you need to configure and compile your kernel with Note: none of this applies to MacBook's after 2015 or MacBookPro's. |
@denverslair Hmm, I don't know what's going on there - not too familiar with the whole irq management stuff. Does anybody else have this issue on MacBook8,1? |
@roadrunner2 yes, just installed it on my MacBook8,1 using the Archlinux Macbook Kernel . Compling it with LPSS disabled alone did not work. but after i added irqpoll to kernel boot it worked |
I am aware that using a third-party compiled kernel is highly insecure, but can any contributor of this repo provide a compiled kernel with that CONFIG_X86_INTEL_LPSS=n option? Especially because I have no idea how to compile the Linux kernel on Mac. I would need the .deb files, alternatively, an explanation would work as well. Well, fifth edit. Hope that edits don't cause emails to followers. |
@gerd2002 What distro are you using? Since you mention debian package, it sounds like Debian or Ubuntu? In any case you want to boot Linux with an external usb keyboard attached, install the distro, and then build and install the kernel. Assuming you're using Ubuntu, these instructions explain how to build your own kernel. But if you at least specify what distro you're using, maybe somebody has some built kernel packages for it. |
I am actually using Ubuntu, and I got it working using the latest mainline kernel that can be found here (and the irqpoll flag): http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/ |
What's the summary of the last 112 comments wrt kernel config requirements? CONFIG_SPI_PXA2XX is required, and CONFIG_X86_INTEL_LPSS=y breaks MacBook8,1? |
@gerd2002 Excellent! I didn't realize Ubuntu was providing kernels built from the very latest code. But be warned: since this isn't even rc1 yet (the merge window for 4.14 is still open), let alone a stable release, there could well be issues. @rfc6919 For MacBook8,1 (2015) the requirements are:
In short: when distros start providing 4.14 kernels then you should be able to use those kernels without any changes (still need to build/load this |
Cool, thanks. Debian currently sets CONFIG_SPI_PXA2XX=n but https://bugs.debian.org/872004 should fix that shortly. |
@roadrunner2 indeed, i am getting a lot of "Report system error" messages on startup, and the facetime camera driver refuses to work at all, but it was more comfortable than to rebuild the kernel. |
So today I installed 4.14-rc5 today, and it still works like a charm. My only problem is that suspend doesn't work at all. Any ideas? I needed to disable suspend, because otherwise my computer freezes when waking up/suspending (don't know which of both) |
I installed Ubuntu 17.04 on my Macbook 12 Retina 8,1 (2015) yesterday and managed to get applespi working. To do this, I recompiled the current kernel's source with CONFIG_X86_INTEL_LPSS=n and added this to /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT='nosplash irqpoll intremap=nosid' However, I've got two problems: 1. It doesn't work when I boot up, so I can't enter the LUKS full disk encryption password without an external keyboard. I notice that the applespi module tries to load but it says it's tainted:
But loads later on after entering in the password:
2. I can suspend and resume, but when I resume applespi no longer works. I think there is already an issue for this. Is this a work in progress? My full dmesg output can be found here: https://gist.github.com/rquast/998f8f32e01f07945caf43454d7fcc1c This is a great project. Thanks for all the hard work! |
|
@roadrunner2 thanks for the tips. I dropped the intremap=nosid. I've configured it correctly the first time with the modules for both initramfs's modules and /etc/modules which is why I get the applespi output: [ 2.717250] applespi: No spi-master device found for device APP000D - waiting for it to be registered I dropped to an initramfs shell during boot, did an rmmod/modprobe on both the applespi and spi_pxa2xx_platform but keep getting the message "No spi-master device...". Strangely, I don't have a problem once it gets out of initramfs. With regard to the resume, to clarify, I meant that the resume works, but applespi stops working on resume. |
Looking at someone else's dmesg, I notice that they have the serial port register in initramfs where mine doesn't. Theirs: https://github.com/Dunedan/mbp-2016-linux/blob/master/MacBookPro14%2C1/dmesg - mine https://gist.github.com/rquast/998f8f32e01f07945caf43454d7fcc1c Their output in initramfs shows this: Mine registers later on after initramfs: [ 52.199749] 0000:00:15.5: ttyS4 at MMIO 0xc1819000 (irq = 21, base_baud = 2764800) is a 16550A It also turns out that irqpoll makes no difference if it is enabled or not on my system, so I have removed it also for now. |
Is there any way of compiling the kernel on macOS and then installing it on Linux? |
@gerd2002 You can build the kernel inside a Linux VM (Virtual machine). |
@tudorbarascu I guess that is what I am going to do then. |
I'm struggling with the driver on a MacBook8,1 (12" early 2015). I've recompiled my kernel : CONFIG_X86_INTEL_LPSS is not setand gilles@unicorn: here's the output on dmesg : [ 2.325105] applespi: loading out-of-tree module taints kernel. neither the keyboard nor the trackpad are recognized or responsive... Any idea what I can try? |
@chroi Thanks for the dmesg output. Well, that error is certainly odd: the _DSM on your system is returning an integer instead of a struct. Did you modify your dsdt in any way? Can you provide your dsdt please? |
Thanks for the quick reply ! I didn't know what DSDT was... but apparently ElementaryOS is messing with it in its default config. I had a "acpi_osi=" kernel option in my boot loader config. I don't know why they did that. Removing it fixed the problem. I have a working touchpad and keyboard. Thank you very much! |
Ah, forgot about |
It seems that the driver is primarily non-functional on the 2015model. The trackpad is essentially broken and (possibly random, need more testing) very few keystrokes are registering.
The text was updated successfully, but these errors were encountered: