-
Notifications
You must be signed in to change notification settings - Fork 0
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
Status #27
Comments
https://twitter.com/Sonicadvance1/status/1199894673013137408 |
Might be worth asking the kernel contributors with Microsoft/Qualcomm emails for help.
|
Hello @Sonicadvance1 how did you get the system to the internal storage? Install image on a USB pen drive, or did you write image/system to the internal storage directly? I'm just trying to get TW aarch64 image booting from a pen drive, so far it's not being recognized when I choose to boot from USB drive in the Surface/UEFI menu. I did buy a usb c reader for the internal drive, but unfortunately it seems to be broken, so I'm stuck with pendrive. I must say that the option to easily swap disks and have one installation WIP is a big plus in otherwise hostile environment :-) |
My experience with booting a USB install image: I've tried to boot from The advanced recovery options, however that messed up the underlying windows installation and generally always took longer as it asks me for a bitlocker recovery key. Bitlocker drive encryption can be turned off from Windows. Control Panel -> System and Security -> BitLocker Drive Encryption -> Turn off Bitlocker (Triggers disk decryption on background). If you go to Surface UEFI - > Boot Configuration and simply swipe left, then the entire cycle takes few seconds. My setup is a usb-c connected dell docking station with 1GB SandDisk USB-3.0 flash drive with latest openSUSE TW aarch64 image connected to the docking station. I'm using usb based mouse+keyboard connected to the dock and they both work well in the Surface UEFI area. I didn't get the usb pen drive with aarch64 openSUSE TW booting via docking station, but I suppose it's because the was simply not recognized. Next step is to try usb-c pendrive directly connected to the surface device. That will have to wait until mid of next week as shops are closed on Sunday and I'll be travelling Monday/Tuesday. So current goal is to get grub2 screen, next goal is to get kernel loaded. |
Just for keeping track of progress So default openSUSE Tumbleweed aarch64 image on a usb-c flash disk plugged directly to surface boots (Volume Up+ power button -> Surface UEFI -> Boot from USB) for about 3 seconds and freezes on following |
I'm now trying to build openSUSE Tumbleweed minimal CD with a kernel patch from Ryan My 5.8 based-branch where I'll add individual changes from Ryan and hopefully later some more |
Does it help? |
Has there been any improvement to device functionality since the Dec post last year? |
Leaving this as a reference: Patches to support the embedded controller in Surface devices are about to be upstreamed: https://lkml.org/lkml/2020/9/23/535 This should help to get the keyboard cover working (if not more). |
|
My information for the comment above comes from #7 (comment). If that still holds true, i.e. if the Surface Serial Hub (SSH/MSHW0084) device still is not present, the SAM modules won't load. SSH is basically the interface to the EC. Also it's a UART, if that matters (essentially handled via the Also if anyone has access to an acpidump/DSDT, can you post one to https://github.com/linux-surface/acpidumps (see here for more details)? I'd love to have a look at it, although I'm not sure I can do much about it if the UART device doesn't show up. Regarding there being no keyboard "device": Are you sure it's connected via SAM (if so, how?). If it is, we'll have to figure out what interface it's using. Likely the updated HID interface, but we'll have to confirm that and manually add the device. Also we'll need to figure out how detachment is handled (i.e. are there any GPIOs that signal this?) and if we have to take care of that ourselves (which is quite likely). Edit: Feel free to report back at linux-surface/surface-aggregator-module#53. |
You can take it here: https://github.com/aarch64-laptops/build/tree/master/misc/microsoft-surface-prox |
Thanks. According to the DSDT the underlying UART has HID Also, depending on the kernel version (and if you decide to use ACPI) you may need to back-port torvalds@33364d6 (required for the SSH device to be created) and torvalds@6d232b2 (required for the SAN device to behave properly). |
Same here. Downloaded the latest iso from the OpenSuse build server. |
Uhm, same here, stuck at:
I've tried with a modified kernel using this patch: but it still stuck there. I'm using a Surface Pro X SQ2 and I'm manually booting the kernel via GRUB (any tip on how to speed up the kernel trial and errors would be great!) |
I would also like to point out that @lkocman 's iso image (OpenSUSE ISO) has the exact same problem: stuck at I'm not sure if there might be a huge difference between SQ1 and SQ2 that may require a different patch... 🤔 Can someone with a SPX SQ1 check if the above mentioned iso gets stuck as well? Here is a mega.co.nz mirror of that image, since it is built every night: SHA256:
|
Status update: after applying the patch again, it doesn't get stuck anymore at the efi_exit_boot_services anymore. The kernel panics though and thus the device restarts as soon as the kernel loads (the penguins are visible for a couple of ms) |
Okay, so for some strange reason the b1fc9ae patch doesn't work, but mine (with the debugging information) denysvitali/surface-pro-x-linux@4494427 does. Could it be maybe related to some delay that we have to add? In any case, I can't seem to get past a quick three penguins screen (that is shown very distorted for < 20ms) and a reboot that happens after the penguins disappear and after ~ 6 seconds have elapsed. I feel like the kernel is booting but the display is not correctly initialized. I'm now trying to force the screen to not take over and keep the fbcon. No luck with |
Sorry to jump in if you've already tried this, but do you by chance get more context with |
Thanks Josh for your help! This indeed has helped me understand better what happens. The kernel starts (duh!) but anything past the earlyprintk is basically hidden. I think that the display might get initialized and thus the console output is hidden since I can clearly see the display becoming black for 5 seconds. Then the device reboots. I guess that underneath the kernel does indeed start, but then it panics somewhere. Without a tty it is really difficult to see what's going on: maybe a look at the DT might help me somehow |
Okay, silly me, I wasn't using any dtb when booting 🤦♂️ It now kind of works (no reboot) and the penguins are shown correctly, with a nice kernel log output on screen that unfortunately gets stuck after a while. My setup:
On the 64 GB SD Card I keep an iso of Ubuntu 20.04 Server for aarch64, and since iso images aren't that easy to edit, I use an external USB drive to quickly put new kernel images and other useful files that I later on load with GRUB using the partition name (in my case My GRUB entry is:
|
I've tried the ACPI way (extracting the ACPI tables from Windows and using them when compiling the kernel), but unfortunately I don't get anything more than a boot that is stuck at the EFI messages |
@mirh suggested me that this patch might be helpful: https://gitlab.freedesktop.org/drm/msm/-/commit/aded8c7c2b72f846a07a2c736b8e75bb8cf50a87 I'll look into it ASAP Nevermind, that patch is already in the kernel I'm using, therefore it is not needed and doesn't fix the boot problem :( |
There's not much in the way of information for this project on the web, might be a good idea to post in r/surfacelinux or r/surfaceprox to drum up support. I'd love to see a full linux kernel released for my SPX in the next year. |
I've had some time to look at the SPX again and tried to figure out why some GRUB versions work and some don't. Upstream v2.06 works out of the box and the issues seem to be caused by some Fedora/RHEL patches (which are likely in some form also used by other distributions). I've written down the details in linux-surface/grub#1 and I might set up a GitHub build for a basic GRUB image at some point, so that we have a more or less reproducible way to get a working bootloader. |
Did anyone get recent kernels working with a DT? I've tried to update to https://github.com/andersson/kernel/tree/wip/sc8180x-next-20220502, but I'm running into a black screen. My guess is that it's trying to do some graphics hand-off that fails. Any idea how I can prevent this and get some standard (efifb?) terminal? |
Okay, turns out that's an issue with the panel, GPU, or SMMU. Disabling And with that sorted, I've been able to get a working DT again. This time also with proper PCI and NVME support (although I still have some questions about that... and I'm not 100% sure if it's fully reliable yet). The two USB-C ports also work, but the surface connect port needs some more work. I also haven't implemented SAM support just yet (so no keyboard/touchpad etc.) but that's next on my list. You can find the kernel at https://github.com/linux-surface/kernel/tree/spx/next-20220502. I've also posted a minimal-ish config at https://github.com/qzed/aarch64-kernel-configs/blob/main/spx-5.18.0-base.config. Just note that I've disabled a ton of stuff that I don't need (and enabled some debugging options), so you'll probably need to enable a couple of things to make it work for your setup (e.g. if you use an USB ethernet adapter that's not based on the RTL8152/RTL8153 chips). |
SAM clients work (so we again have keyboard/touchpad and battery info support). Bluetooth works as well. However, I'm running into the same issues as before with regards to wifi. Trying to use the non-modem firmware results in
Trying to use the modem-enabled firmware results in
followed by a CPU stall, presumably on the CPU trying to initialize and recover the remoteproc. |
Okay, WiFi still doesn't work but I managed to get the HID-over-SPI touchscreen working with the driver form the Surface Duo 2. Not that it's of much use without proper GPU/display panel support... I'll try to figure out that next before going back to WiFi. I've also added bindings for the ambient light sensor, although I think that should be a TCS3430 instead of an APDS9960. The interface seems to be similar and the reported intensity values react proportional to light, but it's very insensitive and you have to directly shine a flashlight onto it for it to report anything. Trying different intensity scales and integration times (via the sysfs interface) also doesn't behave like I'd expect. But that's a problem for another time I guess... display first. |
Time for another update: The GPU is working... sort of, at least I think it is. But the display only shows a black screen. The backlight is also working and can be controlled. I think it might be related to the problem I've described in #27 (comment). Regarding the GPU, it looks like the "Microsoft SQ2 Adreno 690" is probably an overclocked Adreno 680. Apparently there's supposed to be a Qualcomm Adreno 690 (based on the 660 whereas the 680 is based on the 640), which had me confused for a bit. It turns out that as soon as you write the chip-ID for the 690 to the respective register, the GPU firmware refuses to boot, but when I write 680 to that it works. As MS called it 690, I've initially created a driver entry for that and with that ID (assuming I could just arbitrarily choose that). Took me way too long to figure this out, but the chip-ID written to the register is derived from that one, so naturally nothing from that entry worked (regardless of firmware I've tried). Regarding firmware: The Windows driver has some firmware embedded, which I've extracted and posted here: https://github.com/linux-surface/aarch64-firmware. Generally, the GPU works with the 680 firmware from that repo and the 640/630 firmware from the official firmware repo. There are two sets of firmware in the Windows driver, one resembling the 660 firmware (which I've named 690 due to that) and one resembling the 640 firmware (which I've named 680). I've also rebased onto the latest linux-next branch: https://github.com/linux-surface/kernel/tree/spx/next-20220527. |
Thanks to a ton of help from @andersson and @robclark (and the aarch64-laptops IRC in general), we now have a GPU-driven display. Things are still a bit wonky (e.g. the occasional lock-up during boot), but we're slowly making progress towards a somewhat usable state. I'll try to have another go at WiFi next and then maybe try a more usable (i.e. non-minimalistic) kernel config and proper install on the internal nvme drive. (Note: Battery stats work but the upowerd service didn't want to start for some reason... so no battery widget yet. Might be config related as running |
Very brief update: I've got WiFi working, but it requires some fiddling with firmware. I'll try to write this up a bit better once I've figured out how to best package everything for a somewhat easy setup. In essence, you need the firmware structure posted here, with the jsn files from here (thanks to @andersson for those). The mbn files can be obtained from Windows. Then essentially follow these steps. For the board-2.bin step, you need to deviate a bit and create a json with |
Oh, and what I forgot: You'll also need to edit the rmtfs.service to use local files instead of looking for partitions. Normally, there are partitions with modem stuff on them, but the Pro X doesn't seem to have those on the NVME SSD. It looks like they might be on some (Q)SPI flash chip instead. So in the service, drop the Also: Keep an eye on the services and their output when starting them the first time and make sure they're all running correctly. |
Alright, I've added a bunch of repositories and prepared some Arch packages to hopefully make things a bit easier. Most importantly, I've created a repo for tracking the current status via issues at https://github.com/linux-surface/surface-pro-x and a project to manage them at https://github.com/orgs/linux-surface/projects/1. I still need to add some issues and update the actual status issue, but I've already created a wiki in this repo with instructions on how to get the wifi, bluetooth, and gpu working. The wiki should be editable, so if you have any improvements, feel free to add them. To help with firmware, I've added a script to https://github.com/linux-surface/aarch64-firmware. |
Another small update: I've added and updated more issues for tracking the current status and stuff that needs to be done, and added a small very basic section with some stuff regarding installation at https://github.com/linux-surface/surface-pro-x/wiki/Basic-Setup. Feel free to edit and extend that if you think you can improve something. I've also added a basic fragment config at https://github.com/qzed/aarch64-kernel-configs/blob/main/fragments/spx.config. You should be able to use this with the I've been running an install on the NVME for a bit now and there don't seem to be any major issues with that, apart from the occasional (black-screens) hick-ups during boot. Lastly, I've tried to set up secure boot, but that likely won't work for the foreseeable future. The main problem is not device related, but rather that there doesn't seem to be any MS/UEFI-CA signed shim around for AArch64... so unless we get one, there won't be any secure boot on the Pro X. And PreLoader also doesn't seem to be an option since the only link to that that I can find is to some blog with a signed x64 version... |
Re secureboot: Turns out opensuse has a signed shim for aarch64, but we probably lack the grub patches to make that work with shim (at least, it doesn't want to run any other efi files like mokmanager). And those seem to be the Fedora patches that break boot... so we should probably figure that out first. |
Two new items on the list of supported things: First, the USBs for the Surface Connect port now work, meaning if you have a Surface Dock, you can use that for USB and ethernet. Display-ports don't work yet (neither on the Surface Connect port nor on the USB-C ports). Second, I've implemented a very basic real-time clock. The SPX doesn't seem to use the one provided by Qualcomm (that returns a wrong date and can't be set), but one via SAM (the EC). The driver doesn't support wake alarms yet, but you now at least get the correct time even if you boot without NTP / ethernet. Bonus: You don't need to do any shenanigans like setting Windows to use UTC for the RTC or Linux to use local-time, as SAM provides two interfaces: One local-time interface adjusted for the timezone (ACPI TAD / ACPI000E-like) and another interface providing the raw UNIX timestamp in UTC. Windows uses the local-time interface while the Linux implementation uses the raw UNIX timestamp. So both get what they prefer. Also, setting/updating the time via one interface correctly updates the other. |
Do you have a PayPal link to which we can send donations? Your contribution to the project is amazing. Thanks for everything you're doing ❤️ |
Thanks for considering! But please keep in mind that I don't rely on that money and that I'm doing this regardless of any donations. There are definitely people who need that more than me (and also charities...). But if you still insist: https://paypal.me/maximilianluz |
I've tried to have a look at suspend. Seems only s2idle might be supported by this platform, but that is currently broken. Most of the times it doesn't wake up, sometimes it does but with broken PCIe and USB, and I've had only one lucky attempt where USB-serial came back and I was able to get a log. I've posted that at https://gist.github.com/qzed/2288c651a017fcc016b524d3bac5a43e#file-dmesg-log. And since trying to debug this is a bit frustrating, I've distracted myself by writing a thermal sensor driver for the Surface Aggregator Module. So we now should have support for all thermal sensors on the device. |
Couple new things:
|
I've updated the wiki a bit (in particular https://github.com/linux-surface/surface-pro-x/wiki/Basic-Setup). Could still use some improvements and details, so feel free to edit that. |
@qzed, is there anything improved in mainline kernel 5.19 that has helped this port? |
@kasperk81 A bunch of @andersson's patches have been merged. As far as I can tell, the "Major ARM update" mentioned in the article is work that's been going on over multiple kernel releases, and the base Qualcomm stuff has been present for a while (in part at least thanks to Chrome Books, I guess). The display port/GPU stuff has seen some changes with the introduction of the DP AUX bus (which I think was introduced in 5.19, but might have been a bit earlier), which has helped quite a bit (essentially making generic eDP displays easier to support). Apart from that, I don't think anything major has happened. |
The pen works reasonably well off the main IPTSd branch now with a small tweak (documented in the wiki). Also, we can now access EFI variables from the kernel (and via efivarfs from user-space). So no more EFI-shell required for adding a boot entry. |
@qzed Do you know the specific kernel commits that make EFI variables start working on the device? |
@shawnguo2 I've prepped them for upstreaming at https://github.com/linux-surface/kernel/tree/s/spx/qcom-tee-uefisec/v1. There's currently still some oddity on the c630 and linux-next which I want to figure out before sending them off (and also whether they should go to drivers/firmware or drivers/soc/qcom, but that can also be discussed on the mailing list). The specific commits you want are linux-surface/kernel@58b9ca2...e2a0193 plus some DT binding like linux-surface/kernel@859bab7. |
@qzed Thanks for the pointers and such great work! |
Device Status
Booting with ACPI:
Booting with Device Tree:
The text was updated successfully, but these errors were encountered: