aarch64-laptops / build

Build an Linux OS based image
221 stars 47 forks source link

Support for Xiaomi Book S #88

Open TheCheshireMan opened 2 years ago

TheCheshireMan commented 2 years ago

Hi,

Any chance I could help with testing this 2-in-1 on linux? It runs on a Snapdragon 8cx gen 2. I have one in my possession and I would love to run linux on it. Application arm64 support on linux is so much better than Windows on ARM.

These are the specs, but I'm guessing the SoC is the only relevant one: https://www.mi.com/global/product/xiaomi-book-s-12-4/ CPU: Qualcomm Kryo™ 495, Octa-core CPU, up to 2.84GHz GPU: Qualcomm Adreno™ 680

If I wanted to run linux on it, where would I have to start? I have a lot of experience with installation and configuration on x86/x64 systems but this seems to be a whole different beast. Community support for this specific device also seems to be non-existent, I have yet to find another owner of this device anywhere...

qaz6750 commented 1 year ago

First, you need to extract your DSDT, and then modify a dts

TheCheshireMan commented 1 year ago

First, you need to extract your DSDT, and then modify a dts

Thanks for the pointers. Just extracted my DSDT.aml using this: https://dortania.github.io/Getting-Started-With-ACPI/Manual/dump.html#from-windows

How should I use it to modify the dts? Got any guide?

qaz6750 commented 1 year ago

First, you need to extract your DSDT, and then modify a dts

Thanks for the pointers. Just extracted my DSDT.aml using this: https://dortania.github.io/Getting-Started-With-ACPI/Manual/dump.html#from-windows

How should I use it to modify the dts? Got any guide?

First create a dts and add # include "sm8150. dtsi" to it. Then you can modify your dts by referring to ACPI and other devices

image

By the way, could you show me your dsdt

fnxln commented 1 year ago

i would like to help making linux into the xiaomi book s, i also have a unit i dumped my aml could you help make this happen?

https://drive.google.com/file/d/1h6_dQ_pw7fuHgTQZwwe5WTaVEQ3kDBBr/view?usp=share_link

tell me if need testing for the device

silkskier commented 1 year ago

I do have Book S as well and if it was possible I would like to help as well. Sadly despite having a little bit of experience in programming in C I don't know how can the kernel be modified for any particular laptop.

If anyone could give any hints or links to any resources where I could find how could it be done I would greatly appreciate the help.

fnxln commented 1 year ago

after months someone responded to the issue, and still the mantainer still has not maifested @silkskier and i @fnxln are here to test if @qaz6750 could help us make this happen

Wapitiii commented 1 year ago

Hey, i also own a Xiaomi Book S, i've looked into creating a device tree, but from what i've learned we would need uart access first, im not sure where we could get access on this device.

qaz6750 commented 1 year ago

Hey, i also own a Xiaomi Book S, i've looked into creating a device tree, but from what i've learned we would need uart access first, im not sure where we could get access on this device.

I'm not sure if efifb can be used to display kernel logs, but in any case, kernel logs are very important

silkskier commented 1 year ago

Hey, i also own a Xiaomi Book S, i've looked into creating a device tree, but from what i've learned we would need uart access first, im not sure where we could get access on this device.

I've tried doing something as well, but the Script for generating the OS image doesn't work with Ubuntu 22.04 due to changes in apt behavior. For Ubuntu 18 there is some kind of error due to one of repositories not having a release file, the same thing happens for Ubuntu 20.

For versions 22.04+ I don't think that repository will every work due to signifficant apt changes, which would make this repository require serious modifications. I currently do not realy understand all the things the scripts really do, but the best way should be creating a fully new repository based on that for creating Fedora ISOs (imo Fedora would be a better choice due to easiness of installing it from a OS image to a drive, not the installer .iso. For Ubuntu it's much more difficult, so this repository suggests keeping the os on SD card, which is significantly slower, than using built-in SSD.

Anyway currently stock grub now has no problems on Aarch64 laptops, and the kernel supports more ARM devices than ever. If someone decided to rebuilt something like that for newer Linux version update od GRUB definitely wouldn't be neccessary.

Also hopefully Snapdragon 8cx gen2 support comes to stock Linux kernel soon - currently 8cx gen3 is supported for quite a some time and gen1 is supported from Kernel version 6.1. I would expect one of the upcoming updates (hopefully 6.4 or 6.5) to bring gen2 support as well.

Kernel 6.3 released a few days ago supports Snapdragon 8 gen 2 (Android version), so official support could be comming really soon.

Wapitiii commented 1 year ago

Also hopefully Snapdragon 8cx gen2 support comes to stock Linux kernel soon - currently 8cx gen3 is supported for quite a some time and gen1 is supported from Kernel version 6.1. I would expect one of the upcoming updates (hopefully 6.4 or 6.5) to bring gen2 support as well.

Isn't the gen 2 just an overclocked gen 1? So it should be the same.

silkskier commented 1 year ago

Also hopefully Snapdragon 8cx gen2 support comes to stock Linux kernel soon - currently 8cx gen3 is supported for quite a some time and gen1 is supported from Kernel version 6.1. I would expect one of the upcoming updates (hopefully 6.4 or 6.5) to bring gen2 support as well.

Isn't the gen 2 just an overclocked gen 1? So it should be the same.

It's almost an overclocked gen1, eg. it should have the same instructions set as gen1, but for some weird reason stock Linux kernel (versions 6.1 +) does work fine on gen1 and ends up with black screen or infinite bootloader loop, while trying to load it.

https://git.linaro.org/landing-teams/working/qualcomm/kernel.git/log/?qt=grep&q=SC8180X

Due to both CPUs having the same instruction sets creating drivers for gen2 shouldn't be too demanding (but again I'm just a n00b, so I am not able to do even that).

Btw some people experienced a limited success running stock Linux kernel on Lenovo 5G laptop (here is one of the examples; https://superuser.com/questions/1757607/i-am-trying-to-install-linux-on-my-new-lenovo-5g ) on gen1 compatible Kernel, but it's still the only device. Other devices like Samsung Galaxy Book Go 5G are experiencing exactly the same issues as Book S, and Linux doesn't work on then at all.

Again I do have no idea why doesn't gen1 driver work on gen2 despite exactly the same instruction sets, but maybe someone with more knowledge than me will be able to answer that question.

bigsaltyfishes commented 7 months ago

Hey, i also own a Xiaomi Book S, i've looked into creating a device tree, but from what i've learned we would need uart access first, im not sure where we could get access on this device.

I'm not sure if efifb can be used to display kernel logs, but in any case, kernel logs are very important

efifb should be usable, using early version of dt from Surface Pro X is able to boot the kernel and logs are able to be successfully printed on the screen, but the kernel freezes late during systemd startup services (screen content will be cleared, kernel outputs a log of failed adreno kernel module initialization in the log before it freeze)