Skip to content

Commit b222849

Browse files
committed
Merge remote-tracking branch 'origin/master' into dell-xps-9550-nvidia
2 parents 6484d28 + 3657e7c commit b222849

File tree

14 files changed

+308
-16
lines changed

14 files changed

+308
-16
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ There is also experimental flake support. In your `/etc/nixos/flake.nix` add the
5353
You can fetch the git repository directly:
5454

5555
```nix
56-
imports = [
56+
imports = [
5757
"${builtins.fetchGit { url = "https://github.com/NixOS/nixos-hardware.git"; }}/lenovo/thinkpad/x220"
5858
];
5959
```
6060

61-
Unlike the channel, this will update the git repository on a rebuild. However,
61+
Unlike the channel, this will update the git repository on a rebuild. However,
6262
you can easily pin to a particular revision if you desire more stability.
6363

6464
## List of Profiles
@@ -116,6 +116,7 @@ See code for all available configurations.
116116
| Lenovo ThinkPad T480s | `<nixos-hardware/lenovo/thinkpad/t480s>` |
117117
| Lenovo ThinkPad T490 | `<nixos-hardware/lenovo/thinkpad/t490>` |
118118
| Lenovo ThinkPad T495 | `<nixos-hardware/lenovo/thinkpad/t495>` |
119+
| Lenovo ThinkPad X113 Yoga | `<nixos-hardware/lenovo/thinkpad/x13-yoga>` |
119120
| Lenovo ThinkPad X140e | `<nixos-hardware/lenovo/thinkpad/x140e>` |
120121
| Lenovo ThinkPad X220 | `<nixos-hardware/lenovo/thinkpad/x220>` |
121122
| Lenovo ThinkPad X230 | `<nixos-hardware/lenovo/thinkpad/x230>` |
@@ -156,6 +157,7 @@ See code for all available configurations.
156157
[Inverse Path USB armory]: inversepath/usbarmory
157158
[Lenovo ThinkPad X1 (6th Gen)]: lenovo/thinkpad/x1/6th-gen
158159
[Lenovo ThinkPad X1 (7th Gen)]: lenovo/thinkpad/x1/7th-gen
160+
[Lenovo ThinkPad X13 Yoga]: lenovo/thinkpad/x13-yoga
159161
[Lenovo ThinkPad X260]: lenovo/thinkpad/x260
160162
[Microsoft Surface Pro 3]: microsoft/surface-pro/3
161163
[Raspberry Pi 2]: raspberry-pi/2

flake.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
apple-macbook-air-3 = import ./apple/macbook-air/3;
99
apple-macbook-air-4 = import apple/macbook-air/4;
1010
apple-macbook-air-6 = import apple/macbook-air/6;
11-
apple-macbook-air-10-1 = import ./apple/macbook-pro/10-1;
12-
apple-macbook-air-12-1 = import ./apple/macbook-pro/12-1;
11+
apple-macbook-pro-10-1 = import ./apple/macbook-pro/10-1;
12+
apple-macbook-pro-12-1 = import ./apple/macbook-pro/12-1;
1313
beagleboard-pocketbeagle = import ./beagleboard/pocketbeagle;
1414
dell-g3-3779 = import ./dell/g3/3779;
1515
dell-latitude-3480 = import ./dell/latitude/3480;
@@ -61,6 +61,8 @@
6161
lenovo-thinkpad-x1-6th-gen = import ./lenovo/thinkpad/x1/6th-gen;
6262
lenovo-thinkpad-x1-7th-gen = import ./lenovo/thinkpad/x1/7th-gen;
6363
lenovo-thinkpad-x1-extreme = import ./lenovo/thinkpad/x1-extreme;
64+
lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13-yoga;
65+
microsoft-surface = import ./microsoft/surface;
6466
microsoft-surface-pro-3 = import ./microsoft/surface-pro/3;
6567
pcengines-apu = import ./pcengines/apu;
6668
raspberry-pi-2 = import ./raspberry-pi/2;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{ config, lib, ... }: {
2+
imports = [
3+
../.
4+
../../../common/cpu/intel
5+
../../../common/pc/laptop/acpi_call.nix
6+
../../../common/pc/laptop/ssd
7+
];
8+
9+
# automatic screen orientation
10+
hardware.sensor.iio.enable = true;
11+
12+
services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable;
13+
}
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{ lib, ... }:
2-
32
{
4-
# to use the type cover in the initrd
5-
boot.kernelModules = [ "hid-microsoft" ];
6-
7-
# TODO: reverse compat
8-
networking.wireless.enable = lib.mkDefault true;
3+
imports = [ ../../surface ];
94
}

microsoft/surface/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Derivatives for Microsoft Surface notebooks
2+
3+
These derivatives use the patches from the [linux-surface repo](https://github.com/linux-surface/linux-surface/tree/master/patches).
4+
5+
## Kernel
6+
7+
The kernel needs several patches to make it work correctly with some of the hardware on various
8+
Surface models, e.g. keyboard/trackpad, camera, wifi.
9+
10+
Not all hardware is fully supported, but the
11+
[linux-surface feature matrix](https://github.com/linux-surface/linux-surface/wiki/Supported-Devices-and-Features#feature-matrix)
12+
provides details on which devices are supported on which types of machine.
13+
14+
The kernel-specific derivations are under the `kernel/` sub-directory.
15+
In order to simplify maintenance of the Nix code, only the most-recent kernel patch-set is expected
16+
to be maintained in this repo.
17+
18+
_*NOTE:*_Some built-in Kernel config items need to be set, that aren't set by default:
19+
- https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing
20+
21+
## Firmware, Drivers and Support Tools
22+
23+
### WiFi
24+
25+
For the Surface Go, please see the "Issues" sections below.
26+
27+
### IPTS
28+
29+
IPTS is used on most of the Surface range, except for Surface Go and Surface Laptop 3 (AMD version).
30+
31+
Older kernels used specialised firmware which used a method that's no longer supported by the
32+
more-recent kernels.
33+
34+
Newer kernels use the kernel-space `intel-precise-touch` driver and user-space `ipstd` daemon.
35+
36+
The `iptsd` daemon works with the `intel-precise-touch` driver to convert raw touch data from the
37+
kernel-space driver into events for the HID / input sub-system.
38+
39+
- https://github.com/linux-surface/iptsd
40+
- https://github.com/linux-surface/intel-precise-touch
41+
- _*NOTE:*_ The patches from this repo are included in the above kernel patches, already.
42+
43+
### DTX, `surface-control`
44+
45+
*TODO*
46+
47+
# ToDo's Not Done
48+
49+
See: [TODO.org](./TODO.org)
50+
51+
# Issues
52+
53+
## TLP daemon
54+
55+
TLP is known to cause problems on Surface unless correctly configured.
56+
See: https://github.com/linux-surface/linux-surface/blob/master/README.md
57+
58+
## Wifi Firmware for Surface Go
59+
60+
On the Surface Go, the standard firmware from the official Linux Firmware repo has issues with the
61+
`ath10k` QCA6174 Wifi device.
62+
You will see messages like "Can't ping firmware" *TODO - Copy messages from console*
63+
64+
The most effective fix to-date is to remove the `board-2.bin` file or replace it with a copy of the
65+
`board.bin` file.
66+
67+
References:
68+
- https://github.com/jakeday/linux-surface/issues/441
69+
- https://www.reddit.com/r/SurfaceLinux/comments/e8quqg/surface_go_official_wifi_fix/
70+
- https://hackmd.io/@dasgeek/ryA5i5Dor
71+
- https://github.com/thebitstick/surfacego-wifi
72+
- https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/ath10k
73+
- https://wireless.wiki.kernel.org/en/users/drivers/ath10k/firmware

microsoft/surface/TODO.org

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
* Kernel Patching
2+
** DONE Create derivative to patch kernel 5.10.2
3+
- Latest from linux-surface
4+
- [X] Download github.com/linux-surface/linux-surface kernel patches
5+
- [X] Build kernel using downloaded patches
6+
** TODO Create a function for selecting preferred kernel
7+
** DONE Fix how Keyboard & Trackpad are not being enabled on SL3
8+
- https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing
9+
* Firmware
10+
** DONE Remove old firmware binaries
11+
- Looks like the ath10k files aren't needed, any more
12+
** DONE Create derivative for `ipts` firmware
13+
- [X] Download github.com/linux-surface/surface-ipts-firmware firmware
14+
- [X] Install the binaries
15+
** DONE Remove `ipts` firmware derivative
16+
- This is only needed on the 4.19 kernel
17+
** TODO Investigate problem with ath10k wifi firmware on Surface Go
18+
*** TODO README entry explaining problem(s) with nonfree firmware on Surface Go
19+
*** TODO Create derivative for `ath10k` firmware on Surface Go
20+
- [X] Download github.com/kvalo/ath10k-firmware ?
21+
- [X] Download kernel.org linux-firmware?
22+
- [ ] Download `board.bin` from Killer Networks?
23+
- [ ] Install ath10k firmware fix for Surface Go
24+
- `board-2.bin` needs to be removed / replaced with `board.bin`
25+
* Support Tools
26+
** TODO Incorporate @hpfr's function(s) from this commit:
27+
- https://github.com/hpfr/system/commit/03fa1b0a83f8a336e812910d0d50f5247a8a630c
28+
** TODO Create derivative for `iptsd` touch-screen daemon
29+
- [ ] Download
30+
- [ ] Install binary
31+
- [ ] Enable via systemd
32+
** TODO Create derivative to patch and rebuild libwacom
33+
- github.com/linux-surface/libwacom-surface
34+
- The plan is to do this in a separate PR against `nixpkgs` instead of `nixos-hardware`
35+
** TODO Create derivative to install `surface-control`
36+
- Download github.com/linux-surface/surface-control
37+
** TODO Create derivative to install `surface-dtx-daemon`
38+
- Download github.com/linux-surface/surface-dtx-daemon

microsoft/surface/default.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{ config, lib, pkgs, ... }:
2+
{
3+
imports = [
4+
./kernel
5+
./firmware
6+
./hardware_configuration.nix
7+
];
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{ config, lib, pkgs, ... }:
2+
{
3+
hardware.enableAllFirmware = true;
4+
hardware.firmware = [
5+
];
6+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{ config, lib, pkgs, ... }:
2+
{
3+
boot.extraModprobeConfig = lib.mkDefault ''
4+
options i915 enable_fbc=1 enable_rc6=1 modeset=1
5+
options snd_hda_intel power_save=1
6+
options snd_ac97_codec power_save=1
7+
options iwlwifi power_save=Y
8+
options iwldvm force_cam=N
9+
options ath10k_core skip_otp=Y
10+
'';
11+
12+
boot.kernelParams = [ "mem_sleep_default=deep" ];
13+
14+
# NOTE: Check the README before enabling TLP:
15+
services.tlp.enable = lib.mkDefault false;
16+
17+
hardware.sensor.iio.enable = lib.mkDefault true;
18+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{ config, lib, pkgs, ... }:
2+
3+
{
4+
boot.kernelPackages = pkgs.callPackage ./linux-5.10.2 {};
5+
}

0 commit comments

Comments
 (0)