Skip to content
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

Add basic support for 6th-gen X1 #60

Merged
merged 12 commits into from Jul 30, 2018
Merged

Add basic support for 6th-gen X1 #60

merged 12 commits into from Jul 30, 2018

Conversation

azazel75
Copy link
Contributor

Hello,

this is a PR to support X1, as with the same name there are multiple "generations" and at least the last generation comes with tree display flavors, I chose to make nested directories to differentiate between those.

@lukateras lukateras self-assigned this May 31, 2018
@azazel75
Copy link
Contributor Author

I've just added better configuration of tlp

@azazel75
Copy link
Contributor Author

uhumm.... way too much logging, what happened with the tests?

@azazel75
Copy link
Contributor Author

azazel75 commented Jun 4, 2018

@yegortimoshenko I think I'm done

@Mic92
Copy link
Member

Mic92 commented Jun 29, 2018

Still interested in reviewing this? @yegortimoshenko

# "mem_sleep_default=deep"
# ];
# boot.initrd.prepend = [
# "/boot/acpi_override"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be "${./path/to/acpi_override}" since nix will prepend this to initird

@azazel75 did you manage to get suspend working?

once i apply this patch and uncomment above 2 lines i still don't see S3 supported in acpi.

dmesg| grep -i "acpi: (supports"
[    0.188263] ACPI: (supports S0 S4 S5)

I also updated the script to generate patch to use sed since applying patch is broken with BIOS >= 1.24

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @garbas,
I can patch the line you commented, it's the same thing... in your case the absolute path is calculated by nix, I suppose!? (I'm a newbie)

About the patch, I had also to manually patch the "disassembled" code because the patch binary falied to apply some (final) hunks... I don't know which version my BIOS is at but I spawned up Windows just three weeks ago and let it apply an upgrade to the BIOS using the installed Lenovo software. I was worried that it may break the ACPI S3 stuff but it still works after that. Are you sure that the kernel patches the table on startup? My early kernel logs tell me that:

$ dmesg  | grep DSDT
[    0.000000] ACPI: DSDT ACPI table found in initrd [kernel/firmware/acpi/dsdt.aml][0x2338b]
[    0.000000] ACPI: Table Upgrade: override [DSDT-LENOVO-SKL     ]
[    0.000000] ACPI: DSDT 0x000000004FFC0000 Physical table override, new table: 0x000000004DF1E000
[    0.000000] ACPI: DSDT 0x000000004DF1E000 02338B (v02 LENOVO SKL      00000001 INTL 20180313)
[...]
$ dmesg | grep -i "acpi: (supports"
[    0.132924] ACPI: (supports S0 S3 S4 S5)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @garbas, I just checked my bios updates booting in Windows. It has upgraded my BIOS to 1.25 and S3 is still working

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azazel75 i forgot to send you the link to the changes of the script i did -> fiji-flo/x1carbon2018s3#1

Looks like suspend works for you.

regarding the "/boot/acpi_override", during the build you can not access /boot but with "${/boot/acpi_override}" nix will prepend it to the file to /nix/store and then it can append it to initrd (https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/kernel/make-initrd.sh#L40).

being said that i'm still missing something since i dont see any override for the DSDT. need to fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must say that I've hadn't any problem evaluating my configuration with "/boot/acpi_override", why do you say that you can not access /boot?
Yes I saw the line in make-initrd.sh and with /boot/acpi_override as $PREP it should work. In fact, mine works flawlessly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azazel75 hmm, that is weird. it complained not to have permissions to open that file for me.

Here is my config: https://github.com/garbas/dotfiles/blob/master/nixos/grayworm.nix.
I'm running on nixos-unstable channel.

@garbas garbas mentioned this pull request Jul 17, 2018
@garbas
Copy link
Member

garbas commented Jul 17, 2018

@azazel75 did you see #62 ? is there something to be included from that pull request? maybe at least as a section that is commented.

also I loved that you provided links where you got suggestions for configuration from, it makes it much easier to review/use.

@azazel75
Copy link
Contributor Author

azazel75 commented Jul 17, 2018 via email

@Mic92
Copy link
Member

Mic92 commented Jul 21, 2018

I suppose this is good to merge?

@azazel75
Copy link
Contributor Author

The powersave setup in tlp's extraConfig is actually useful, I've enabled it

@Mic92 Mic92 merged commit b4303dc into NixOS:master Jul 30, 2018
@Mic92
Copy link
Member

Mic92 commented Jul 30, 2018

I suppose it should be also added to the table in the README.

@azazel75
Copy link
Contributor Author

Thanks @Mic92: for the README see #69

azazel75 added a commit to azazel75/nixos-hardware that referenced this pull request Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants