From 9a355718299ce74c324b5ccc0d4943159b51cf41 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sun, 7 Feb 2021 00:55:27 +1300 Subject: [PATCH 01/21] Interim version of trying to update Surface Go Wifi in-place - Can't seem to d/l the K1535 board firmware directly from Killer Networking? --- microsoft/surface/firmware/ath10k.nix | 29 ++++++++++++++++++++++++++ microsoft/surface/firmware/default.nix | 2 ++ microsoft/surface/repos.nix | 21 ++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 microsoft/surface/firmware/ath10k.nix diff --git a/microsoft/surface/firmware/ath10k.nix b/microsoft/surface/firmware/ath10k.nix new file mode 100644 index 0000000..3cbd8a0 --- /dev/null +++ b/microsoft/surface/firmware/ath10k.nix @@ -0,0 +1,29 @@ +{stdenv, pkgs, firmwareLinuxNonfree, ...}: +let + repos = (pkgs.callPackage ../repos.nix {}); +in + +firmwareLinuxNonfree.overrideAttrs (old: rec { + pname = "microsoft-surface-go-firmware-linux-nonfree"; + srcs = [ + firmwareLinuxNonfree.src + repos.ath10k-firmware + ]; + + sourceRoot = firmwareLinuxNonfree.src; + priority = 1; + + dontMakeSourcesWritable = true; + postInstall = '' + # rm -v $out/lib/firmware/ath10k/{hw2.1,hw3.0}/board.bin + # rm -v $out/lib/firmware/ath10k/{hw2.1,hw3.0}/board2.bin + + # cp $srcs[1] $out/lib/firmware/ath10k/hw2.1/ + # cp $srcs[1] $out/lib/firmware/ath10k/hw3.0/ + + #TODO: + pwd + echo src = $src, srcs = $srcs + exit 1 + ''; +}) diff --git a/microsoft/surface/firmware/default.nix b/microsoft/surface/firmware/default.nix index 67f2ce2..ea24877 100644 --- a/microsoft/surface/firmware/default.nix +++ b/microsoft/surface/firmware/default.nix @@ -2,5 +2,7 @@ { hardware.enableAllFirmware = true; hardware.firmware = [ + # TODO: Wrap with an option: + (pkgs.callPackage ./ath10k.nix {}) ]; } diff --git a/microsoft/surface/repos.nix b/microsoft/surface/repos.nix index 8642416..dbbbd75 100644 --- a/microsoft/surface/repos.nix +++ b/microsoft/surface/repos.nix @@ -1,8 +1,27 @@ -{ lib, pkgs, fetchgit }: +{ lib, pkgs, fetchgit, fetchurl }: { linux-surface = fetchgit { url="https://github.com/linux-surface/linux-surface.git"; rev="25ab2cf75e5eda5ab9739db1907300010c06dacf"; sha256="0h8624d7ix1p6ysw9bllmnnwnv164z8xkx56zj3vdczn91vmqcf9"; }; + + linux-kernel-firmware = fetchgit { + url="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"; + rev="060ad8b3d505e2ff8878d11a81da3532b983cd45"; + sha256="0n93xc3vzx7gy96lpkypw7ay201x7whirxm00c0zhq6zmq2zs12v"; + }; + + ath10k-firmware = fetchgit { + url="https://github.com/kvalo/ath10k-firmware"; + rev="84b47062aab31d67156e0a3ef593a6999a12864b"; + sha256="0l8wfj8z4jbb31nzqkaxisby0n6061ix01c5di9bq66iby59j8py"; + }; + + surface-go-ath10k-firmware = fetchurl { + url="https://support.killernetworking.com/K1535_Debian/board.bin"; + # url="https://www.killernetworking.com/support/K1535_Debian/board.bin"; + sha256="0l8wfj8z4jbb31nzqkaxisby0n6061ix01c5di9bq66iby59j8py"; + }; + } From 080c44106f423c06d2018725dee647a6781a0190 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sun, 7 Feb 2021 13:31:26 +1300 Subject: [PATCH 02/21] A temporary hack to install the Surface Go firmware --- microsoft/surface/firmware/ath10k.nix | 19 +++++++++--------- .../firmware/ath10k/K1535_Debian/board.bin | Bin 0 -> 8124 bytes 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 microsoft/surface/firmware/ath10k/K1535_Debian/board.bin diff --git a/microsoft/surface/firmware/ath10k.nix b/microsoft/surface/firmware/ath10k.nix index 3cbd8a0..db23507 100644 --- a/microsoft/surface/firmware/ath10k.nix +++ b/microsoft/surface/firmware/ath10k.nix @@ -1,13 +1,15 @@ {stdenv, pkgs, firmwareLinuxNonfree, ...}: let repos = (pkgs.callPackage ../repos.nix {}); + ath10k = ./ath10k; + # ath10k = repos.ath10k-firmware; in firmwareLinuxNonfree.overrideAttrs (old: rec { pname = "microsoft-surface-go-firmware-linux-nonfree"; srcs = [ firmwareLinuxNonfree.src - repos.ath10k-firmware + ath10k ]; sourceRoot = firmwareLinuxNonfree.src; @@ -15,15 +17,12 @@ firmwareLinuxNonfree.overrideAttrs (old: rec { dontMakeSourcesWritable = true; postInstall = '' - # rm -v $out/lib/firmware/ath10k/{hw2.1,hw3.0}/board.bin - # rm -v $out/lib/firmware/ath10k/{hw2.1,hw3.0}/board2.bin + # Delete the non-working firmware: + rm -v $out/lib/firmware/ath10k/QCA6174/{hw2.1,hw3.0}/board.bin + rm -v $out/lib/firmware/ath10k/QCA6174/{hw2.1,hw3.0}/board-2.bin - # cp $srcs[1] $out/lib/firmware/ath10k/hw2.1/ - # cp $srcs[1] $out/lib/firmware/ath10k/hw3.0/ - - #TODO: - pwd - echo src = $src, srcs = $srcs - exit 1 + # Install the Surface Go Wifi firmware: + cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw2.1/ + cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw3.0/ ''; }) diff --git a/microsoft/surface/firmware/ath10k/K1535_Debian/board.bin b/microsoft/surface/firmware/ath10k/K1535_Debian/board.bin new file mode 100644 index 0000000000000000000000000000000000000000..ed0b7f778ee5544e266a79207e34ead8865ac0e8 GIT binary patch literal 8124 zcmeHMeQZ-z6u-A!*ek;JI>&f}uDgW=9x_NrS=X*DYwOqwbaMiO4Y~~(ALY}6u#Va> zOvJb`M+J2qAEOLZf(22*sF8>|kjYlqhcNsC70E&r>mR`4KX~u!UI!C~hQ(ysb9?SN z_x#SsedjgJz3IpC;I;q)Vfkm^aeygpO&9=rfTwt}1W+i33QhwcJHwz*PBxU*9s;vq3lrQ|2Eh z20}s&6d%a|_4xV- zAkG(WTO5bAuAjE1-N^)u<~+EGCH1dg?=k!%Eiy6^+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^1(jnw53Mxuc^*oMifU@A4D*^!Jfza!FP@HJVn@d5 zGfdNFWXY8(wMIuOm@Nycj(%{wnU~pxOR5jQ|H&6K7jCP6_w(Dgd)v)<7HgI3$WdNq z&%pt&y>XcMldDZ{J0H)>2jzEao%oiH=b+?n?D*mypx$=k8TbSw=Y>_Cc$`~1iK{a( z2PKK_p&mS7@9(z|$~W*kfPb*u9`Er+UUsy7-P+OmP3!ry7n;9q{_0G7Q~Q@KjqQzR zzi2(}J9X~VrEe~_es|%k<~E=2bVnQJmgZCKzB4D=d}kWkd`%|@en&!2@Gu={sFy)z z^B6#526Zy%!T)mAJqo~qx+M7hW&frie~Wd@dTd9`3qu3^29{$uU5o9;utR49Ji%w& zCuzp)WA}?;A~iW85zEOD@(4LuM Date: Sun, 7 Feb 2021 15:49:02 +1300 Subject: [PATCH 03/21] Fix the output hash for the additional source --- microsoft/surface/firmware/ath10k.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/firmware/ath10k.nix b/microsoft/surface/firmware/ath10k.nix index db23507..1409b92 100644 --- a/microsoft/surface/firmware/ath10k.nix +++ b/microsoft/surface/firmware/ath10k.nix @@ -4,14 +4,12 @@ let ath10k = ./ath10k; # ath10k = repos.ath10k-firmware; in - firmwareLinuxNonfree.overrideAttrs (old: rec { pname = "microsoft-surface-go-firmware-linux-nonfree"; srcs = [ firmwareLinuxNonfree.src ath10k ]; - sourceRoot = firmwareLinuxNonfree.src; priority = 1; @@ -25,4 +23,6 @@ firmwareLinuxNonfree.overrideAttrs (old: rec { cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw2.1/ cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw3.0/ ''; + + outputHash = "1nc56qii96dfvxnv3ad3lxz2rzyqcbldk0h9rbm3l2pgamkvj8dw"; }) From 08076a7b73bc37d3d04234cc5caed4dc75a19340 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sun, 7 Feb 2021 15:49:46 +1300 Subject: [PATCH 04/21] Add initial metadata attribute for the additional source --- microsoft/surface/firmware/ath10k.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/firmware/ath10k.nix b/microsoft/surface/firmware/ath10k.nix index 1409b92..1a98600 100644 --- a/microsoft/surface/firmware/ath10k.nix +++ b/microsoft/surface/firmware/ath10k.nix @@ -1,4 +1,4 @@ -{stdenv, pkgs, firmwareLinuxNonfree, ...}: +{stdenv, lib, pkgs, firmwareLinuxNonfree, ...}: let repos = (pkgs.callPackage ../repos.nix {}); ath10k = ./ath10k; @@ -11,7 +11,6 @@ firmwareLinuxNonfree.overrideAttrs (old: rec { ath10k ]; sourceRoot = firmwareLinuxNonfree.src; - priority = 1; dontMakeSourcesWritable = true; postInstall = '' @@ -25,4 +24,10 @@ firmwareLinuxNonfree.overrideAttrs (old: rec { ''; outputHash = "1nc56qii96dfvxnv3ad3lxz2rzyqcbldk0h9rbm3l2pgamkvj8dw"; + + meta = with lib; { + description = "Standard binary firmware collection, adjusted with the Surface Go WiFi firmware"; + platforms = platforms.linux; + priority = 5; + }; }) From 72002dabdc4296a341d405cb3712a8b9739b5982 Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 9 Feb 2021 17:17:27 +1300 Subject: [PATCH 05/21] Update README.md --- microsoft/surface/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/microsoft/surface/README.md b/microsoft/surface/README.md index d67a91e..02880cf 100644 --- a/microsoft/surface/README.md +++ b/microsoft/surface/README.md @@ -64,6 +64,8 @@ You will see messages like "Can't ping firmware" *TODO - Copy messages from cons The most effective fix to-date is to remove the `board-2.bin` file or replace it with a copy of the `board.bin` file. +For more details, see: https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wifi-firmware + References: - https://github.com/jakeday/linux-surface/issues/441 - https://www.reddit.com/r/SurfaceLinux/comments/e8quqg/surface_go_official_wifi_fix/ From be2f416029549d1c7a6f9e3ed2838590ffd2d476 Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 9 Feb 2021 17:19:58 +1300 Subject: [PATCH 06/21] Update TODO.org --- microsoft/surface/TODO.org | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/microsoft/surface/TODO.org b/microsoft/surface/TODO.org index 7db7ea4..0a1f56f 100644 --- a/microsoft/surface/TODO.org +++ b/microsoft/surface/TODO.org @@ -14,14 +14,26 @@ - [X] Install the binaries ** DONE Remove `ipts` firmware derivative - This is only needed on the 4.19 kernel -** TODO Investigate problem with ath10k wifi firmware on Surface Go -*** TODO README entry explaining problem(s) with nonfree firmware on Surface Go -*** TODO Create derivative for `ath10k` firmware on Surface Go +** DOING Investigate problem with ath10k wifi firmware on Surface Go +:LOGBOOK: +- State "DOING" from "TODO" [2021-02-09 Tue 17:19] +:END: +*** DONE README entry explaining problem(s) with nonfree firmware on Surface Go +:LOGBOOK: +- State "DONE" from "TODO" [2021-02-09 Tue 17:17] +:END: +*** DOING Create derivative for `ath10k` firmware on Surface Go +:LOGBOOK: +- State "DOING" from "TODO" [2021-02-09 Tue 17:18] +:END: - [X] Download github.com/kvalo/ath10k-firmware ? - [X] Download kernel.org linux-firmware? - - [ ] Download `board.bin` from Killer Networks? - - [ ] Install ath10k firmware fix for Surface Go + - [X] Download `board.bin` from Killer Networks? + - [X] Install ath10k firmware fix for Surface Go - `board-2.bin` needs to be removed / replaced with `board.bin` + - [ ] Add a config option for enabling the Surface Go Firmware + - [ ] Replace the vendorised `board.bin` with a `fetchurl` + - Getting HTTP 406 when using `fetchurl` or `nix-prefetch-url` that has to be diagnosed * Support Tools ** TODO Incorporate @hpfr's function(s) from this commit: - https://github.com/hpfr/system/commit/03fa1b0a83f8a336e812910d0d50f5247a8a630c From 56f4b2df003a9e2a778a0f354fef4e7473240c2c Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 23 Feb 2021 08:28:27 +1300 Subject: [PATCH 07/21] Add MS Surface Range to the README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 12a25e0..01004a4 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ See code for all available configurations. | [Lenovo ThinkPad X1 (6th Gen)][] | `` | | [Lenovo ThinkPad X1 (7th Gen)][] | `` | | Lenovo ThinkPad X1 Extreme Gen 2 | `` | +| [Microsoft Surface Range][] | `` | | [Microsoft Surface Pro 3][] | `` | | PC Engines APU | `` | | [Raspberry Pi 2][] | `` | From a9b2d0e3f1136a4c05decbb3c2aa7a7cfb08256b Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 23 Feb 2021 12:40:08 +1300 Subject: [PATCH 08/21] Update to a clearer directory-structure --- microsoft/surface/default.nix | 2 +- microsoft/surface/firmware/default.nix | 8 -------- .../ath10k/K1535_Debian/board.bin | Bin .../{ => surface-go/ath10k}/ath10k.nix | 8 ++++---- .../firmware/surface-go/ath10k/default.nix | 18 ++++++++++++++++++ 5 files changed, 23 insertions(+), 13 deletions(-) delete mode 100644 microsoft/surface/firmware/default.nix rename microsoft/surface/firmware/{ => surface-go}/ath10k/K1535_Debian/board.bin (100%) rename microsoft/surface/firmware/{ => surface-go/ath10k}/ath10k.nix (75%) create mode 100644 microsoft/surface/firmware/surface-go/ath10k/default.nix diff --git a/microsoft/surface/default.nix b/microsoft/surface/default.nix index 7a49d08..05d78de 100644 --- a/microsoft/surface/default.nix +++ b/microsoft/surface/default.nix @@ -2,7 +2,7 @@ { imports = [ ./kernel - ./firmware ./hardware_configuration.nix + ./firmware/surface-go/ath10k ]; } diff --git a/microsoft/surface/firmware/default.nix b/microsoft/surface/firmware/default.nix deleted file mode 100644 index ea24877..0000000 --- a/microsoft/surface/firmware/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - hardware.enableAllFirmware = true; - hardware.firmware = [ - # TODO: Wrap with an option: - (pkgs.callPackage ./ath10k.nix {}) - ]; -} diff --git a/microsoft/surface/firmware/ath10k/K1535_Debian/board.bin b/microsoft/surface/firmware/surface-go/ath10k/K1535_Debian/board.bin similarity index 100% rename from microsoft/surface/firmware/ath10k/K1535_Debian/board.bin rename to microsoft/surface/firmware/surface-go/ath10k/K1535_Debian/board.bin diff --git a/microsoft/surface/firmware/ath10k.nix b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix similarity index 75% rename from microsoft/surface/firmware/ath10k.nix rename to microsoft/surface/firmware/surface-go/ath10k/ath10k.nix index 1a98600..33ba320 100644 --- a/microsoft/surface/firmware/ath10k.nix +++ b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix @@ -1,8 +1,8 @@ {stdenv, lib, pkgs, firmwareLinuxNonfree, ...}: let repos = (pkgs.callPackage ../repos.nix {}); - ath10k = ./ath10k; - # ath10k = repos.ath10k-firmware; + killernetworking_firmware = ./K1535_Debian; + # killernetworking_firmware = repos.ath10k-firmware; in firmwareLinuxNonfree.overrideAttrs (old: rec { pname = "microsoft-surface-go-firmware-linux-nonfree"; @@ -19,8 +19,8 @@ firmwareLinuxNonfree.overrideAttrs (old: rec { rm -v $out/lib/firmware/ath10k/QCA6174/{hw2.1,hw3.0}/board-2.bin # Install the Surface Go Wifi firmware: - cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw2.1/ - cp ${ath10k}/K1535_Debian/board.bin $out/lib/firmware/ath10k/QCA6174/hw3.0/ + cp ${killernetworking_firmware}/board.bin $out/lib/firmware/ath10k/QCA6174/hw2.1/ + cp ${killernetworking_firmware}/board.bin $out/lib/firmware/ath10k/QCA6174/hw3.0/ ''; outputHash = "1nc56qii96dfvxnv3ad3lxz2rzyqcbldk0h9rbm3l2pgamkvj8dw"; diff --git a/microsoft/surface/firmware/surface-go/ath10k/default.nix b/microsoft/surface/firmware/surface-go/ath10k/default.nix new file mode 100644 index 0000000..bc52187 --- /dev/null +++ b/microsoft/surface/firmware/surface-go/ath10k/default.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.hardware.microsoft-surface.firmware.surface-go-ath10k; +in +{ + options = { + hardware.microsoft-surface.firmware.surface-go-ath10k = { + enable = lib.mkEnableOption ''Use the "board.bin" firmware for ath10k-based WiFi on Surface Go.''; + }; + }; + + config = lib.mkIf cfg.enable { + hardware.enableAllFirmware = true; + hardware.firmware = [ + (pkgs.callPackage ./ath10k.nix {}) + ]; + }; +} From eb2721b3f1280f488675db38544a22c974bbae39 Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 23 Feb 2021 17:48:50 +1300 Subject: [PATCH 09/21] A few more details about using K1535 WiFi firmware --- microsoft/surface/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/microsoft/surface/README.md b/microsoft/surface/README.md index 02880cf..9d3848d 100644 --- a/microsoft/surface/README.md +++ b/microsoft/surface/README.md @@ -59,13 +59,17 @@ See: https://github.com/linux-surface/linux-surface/blob/master/README.md On the Surface Go, the standard firmware from the official Linux Firmware repo has issues with the `ath10k` QCA6174 Wifi device. -You will see messages like "Can't ping firmware" *TODO - Copy messages from console* +You will see messages like "Can't ping firmware". The most effective fix to-date is to remove the `board-2.bin` file or replace it with a copy of the `board.bin` file. For more details, see: https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wifi-firmware +Note that there was an attempt to get this firmware incorporated into the aggregate `board-2.bin`, +but (as of this writing) the request appears to have been ignored: +- https://github.com/linux-surface/linux-surface/issues/41 + References: - https://github.com/jakeday/linux-surface/issues/441 - https://www.reddit.com/r/SurfaceLinux/comments/e8quqg/surface_go_official_wifi_fix/ From f8c3b6e50e09844f08a36416c191caa2f0d70a9f Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 23 Feb 2021 17:59:34 +1300 Subject: [PATCH 10/21] Move a modprobe option for Surface Go Wifi device (ath10k) into that specific derivative --- microsoft/surface/firmware/surface-go/ath10k/default.nix | 4 ++++ microsoft/surface/hardware_configuration.nix | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/microsoft/surface/firmware/surface-go/ath10k/default.nix b/microsoft/surface/firmware/surface-go/ath10k/default.nix index bc52187..44f2bfd 100644 --- a/microsoft/surface/firmware/surface-go/ath10k/default.nix +++ b/microsoft/surface/firmware/surface-go/ath10k/default.nix @@ -14,5 +14,9 @@ in hardware.firmware = [ (pkgs.callPackage ./ath10k.nix {}) ]; + + boot.extraModprobeConfig = lib.mkDefault '' + options ath10k_core skip_otp=Y + ''; }; } diff --git a/microsoft/surface/hardware_configuration.nix b/microsoft/surface/hardware_configuration.nix index 2053b01..ba06b30 100644 --- a/microsoft/surface/hardware_configuration.nix +++ b/microsoft/surface/hardware_configuration.nix @@ -6,7 +6,6 @@ options snd_ac97_codec power_save=1 options iwlwifi power_save=Y options iwldvm force_cam=N - options ath10k_core skip_otp=Y ''; boot.kernelParams = [ "mem_sleep_default=deep" ]; From 4bbf1562380b9d5f638dd099dd6705d73d3ca482 Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 23 Feb 2021 18:06:06 +1300 Subject: [PATCH 11/21] Update README --- microsoft/surface/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/microsoft/surface/README.md b/microsoft/surface/README.md index 9d3848d..ff44b85 100644 --- a/microsoft/surface/README.md +++ b/microsoft/surface/README.md @@ -64,9 +64,16 @@ You will see messages like "Can't ping firmware". The most effective fix to-date is to remove the `board-2.bin` file or replace it with a copy of the `board.bin` file. +The derivative in `firmware/surface-go/ath10k/` can configure this, if you set the option +`config.hardware.microsoft-surface.firmware.surface-go-ath10k.enable` to `true`. + +Note that this is slightly destructive, as it deletes all the `board.bin` and `board-2.bin` files +for the `ath10k` QCA6174 device, and replaces them with KillerNetworking's version. +This is the only way (currently) to force the driver to use the new firmware. + For more details, see: https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wifi-firmware -Note that there was an attempt to get this firmware incorporated into the aggregate `board-2.bin`, +There was an attempt to get this firmware incorporated into the aggregate `board-2.bin`, but (as of this writing) the request appears to have been ignored: - https://github.com/linux-surface/linux-surface/issues/41 From e901e80233ced1b9820f241bb5b02f2ce96621c6 Mon Sep 17 00:00:00 2001 From: mexisme Date: Wed, 24 Feb 2021 08:44:04 +1300 Subject: [PATCH 12/21] Remove obsolete repo ref --- microsoft/surface/repos.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/microsoft/surface/repos.nix b/microsoft/surface/repos.nix index dbbbd75..dc1030e 100644 --- a/microsoft/surface/repos.nix +++ b/microsoft/surface/repos.nix @@ -6,12 +6,6 @@ sha256="0h8624d7ix1p6ysw9bllmnnwnv164z8xkx56zj3vdczn91vmqcf9"; }; - linux-kernel-firmware = fetchgit { - url="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"; - rev="060ad8b3d505e2ff8878d11a81da3532b983cd45"; - sha256="0n93xc3vzx7gy96lpkypw7ay201x7whirxm00c0zhq6zmq2zs12v"; - }; - ath10k-firmware = fetchgit { url="https://github.com/kvalo/ath10k-firmware"; rev="84b47062aab31d67156e0a3ef593a6999a12864b"; From 311c6bf0efc0c97babd7d31ba3af068082151a09 Mon Sep 17 00:00:00 2001 From: mexisme Date: Wed, 24 Feb 2021 08:46:33 +1300 Subject: [PATCH 13/21] Ref to backup repo for Surface Go firmware --- microsoft/surface/repos.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/microsoft/surface/repos.nix b/microsoft/surface/repos.nix index dc1030e..7f1a434 100644 --- a/microsoft/surface/repos.nix +++ b/microsoft/surface/repos.nix @@ -12,10 +12,15 @@ sha256="0l8wfj8z4jbb31nzqkaxisby0n6061ix01c5di9bq66iby59j8py"; }; - surface-go-ath10k-firmware = fetchurl { + surface-go-ath10k-firmware_upstream = fetchurl { url="https://support.killernetworking.com/K1535_Debian/board.bin"; # url="https://www.killernetworking.com/support/K1535_Debian/board.bin"; sha256="0l8wfj8z4jbb31nzqkaxisby0n6061ix01c5di9bq66iby59j8py"; }; + surface-go-ath10k-firmware_backup = fetchgit { + url="git@github.com:mexisme/linux-surface_ath10k-firmware.git"; + rev="74e5409e699383d6ca2bc4da4a8433d16f3850b1"; + sha256="169vgvxpgad9anmchs22fj5qm6ahzjfdnwhd8pc280q705vx6pjk"; + }; } From 9e7cd653f9c6db4f2ba461a1f24a584ee252fb4b Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 27 Feb 2021 22:28:08 +1300 Subject: [PATCH 14/21] Fix repo source for K1535 --- microsoft/surface/firmware/surface-go/ath10k/ath10k.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix index 33ba320..4c136fd 100644 --- a/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix +++ b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix @@ -8,7 +8,7 @@ firmwareLinuxNonfree.overrideAttrs (old: rec { pname = "microsoft-surface-go-firmware-linux-nonfree"; srcs = [ firmwareLinuxNonfree.src - ath10k + killernetworking_firmware ]; sourceRoot = firmwareLinuxNonfree.src; From 4f6aad61b6fa0b4bc0cb1ed52e9534b8d73a4b0b Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 27 Feb 2021 22:41:53 +1300 Subject: [PATCH 15/21] Update linux-surface/linux-surface Rev & SHA256 --- microsoft/surface/repos.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/repos.nix b/microsoft/surface/repos.nix index 7f1a434..ba819a7 100644 --- a/microsoft/surface/repos.nix +++ b/microsoft/surface/repos.nix @@ -2,8 +2,8 @@ { linux-surface = fetchgit { url="https://github.com/linux-surface/linux-surface.git"; - rev="25ab2cf75e5eda5ab9739db1907300010c06dacf"; - sha256="0h8624d7ix1p6ysw9bllmnnwnv164z8xkx56zj3vdczn91vmqcf9"; + rev="2b6d2db5bfc7b678c37badc80e0a223bf89b5ef7"; + sha256="03qlwxijznmk043zcpwl1yc56zhrlwdaw8k1cymb8zrxfpgw0r14"; }; ath10k-firmware = fetchgit { From e274b742e11e768e76ae3e1d05bff431008c0386 Mon Sep 17 00:00:00 2001 From: mexisme Date: Fri, 5 Mar 2021 08:33:27 +1300 Subject: [PATCH 16/21] Use the ath10k QCA6174 K1535 firmware backup repo, instead --- microsoft/surface/firmware/surface-go/ath10k/ath10k.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix index 4c136fd..6b4b76d 100644 --- a/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix +++ b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix @@ -1,8 +1,8 @@ {stdenv, lib, pkgs, firmwareLinuxNonfree, ...}: let repos = (pkgs.callPackage ../repos.nix {}); - killernetworking_firmware = ./K1535_Debian; - # killernetworking_firmware = repos.ath10k-firmware; + # killernetworking_firmware = ./K1535_Debian; + killernetworking_firmware = repos.ath10k-firmware + "/K1535_Debian"; in firmwareLinuxNonfree.overrideAttrs (old: rec { pname = "microsoft-surface-go-firmware-linux-nonfree"; From 6972d78ffb443d8b413b0b19bea2f64feffcce69 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 11:07:43 +1300 Subject: [PATCH 17/21] Remove (obsolete) Surface Go QCA6174 K1535 firmware binary --- .../surface-go/ath10k/K1535_Debian/board.bin | Bin 8124 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 microsoft/surface/firmware/surface-go/ath10k/K1535_Debian/board.bin diff --git a/microsoft/surface/firmware/surface-go/ath10k/K1535_Debian/board.bin b/microsoft/surface/firmware/surface-go/ath10k/K1535_Debian/board.bin deleted file mode 100644 index ed0b7f778ee5544e266a79207e34ead8865ac0e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8124 zcmeHMeQZ-z6u-A!*ek;JI>&f}uD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D2i6kMOHD(qTmD%fF zdaw56Uecn$kx_BXn30c7G36JPmDFynuQ}xDZe93Lv4lw&$!aq5i%Lpgt$w}c7zc%m zBjTbHhO;TASw*(e%9nPy_wVTr0ly6y!bnE3T0=p>^Ui%+kGenQAi*Dl#nDL0s?&1| zo^x#5y0hjWSDl2lg^>%WT@ApkD7)IO4$QsR)w|t$gH`xyAsOmGr~{!6ggOxFz<<62 z=GoRN&xei8_miWLRMHnmM_>0^1(jnw53Mxuc^*oMifU@A4D*^!Jfza!FP@HJVn@d5 zGfdNFWXY8(wMIuOm@Nycj(%{wnU~pxOR5jQ|H&6K7jCP6_w(Dgd)v)<7HgI3$WdNq z&%pt&y>XcMldDZ{J0H)>2jzEao%oiH=b+?n?D*mypx$=k8TbSw=Y>_Cc$`~1iK{a( z2PKK_p&mS7@9(z|$~W*kfPb*u9`Er+UUsy7-P+OmP3!ry7n;9q{_0G7Q~Q@KjqQzR zzi2(}J9X~VrEe~_es|%k<~E=2bVnQJmgZCKzB4D=d}kWkd`%|@en&!2@Gu={sFy)z z^B6#526Zy%!T)mAJqo~qx+M7hW&frie~Wd@dTd9`3qu3^29{$uU5o9;utR49Ji%w& zCuzp)WA}?;A~iW85zEOD@(4LuM Date: Sat, 6 Mar 2021 11:23:05 +1300 Subject: [PATCH 18/21] Relative path of repos not updated correctly --- microsoft/surface/firmware/surface-go/ath10k/ath10k.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix index 6b4b76d..909131d 100644 --- a/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix +++ b/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix @@ -1,6 +1,6 @@ {stdenv, lib, pkgs, firmwareLinuxNonfree, ...}: let - repos = (pkgs.callPackage ../repos.nix {}); + repos = (pkgs.callPackage ../../../repos.nix {}); # killernetworking_firmware = ./K1535_Debian; killernetworking_firmware = repos.ath10k-firmware + "/K1535_Debian"; in From 98d19435d0059fa187237b0a7c1d57fd44a2f320 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 15:29:13 +1300 Subject: [PATCH 19/21] Rename cfg option from "enable" --> "replace" - Allows for @qzed's kernel patch: https://github.com/linux-surface/kernel/commit/22ef83836c4aa89e9eb98de9b47ed24b6c2a1d45 --- microsoft/surface/README.md | 14 +++++++++----- microsoft/surface/TODO.org | 9 +++++---- .../ath10k/{ath10k.nix => ath10k-replace.nix} | 0 .../surface/firmware/surface-go/ath10k/default.nix | 6 +++--- 4 files changed, 17 insertions(+), 12 deletions(-) rename microsoft/surface/firmware/surface-go/ath10k/{ath10k.nix => ath10k-replace.nix} (100%) diff --git a/microsoft/surface/README.md b/microsoft/surface/README.md index ff44b85..c4fe226 100644 --- a/microsoft/surface/README.md +++ b/microsoft/surface/README.md @@ -15,7 +15,7 @@ The kernel-specific derivations are under the `kernel/` sub-directory. In order to simplify maintenance of the Nix code, only the most-recent kernel patch-set is expected to be maintained in this repo. -_*NOTE:*_Some built-in Kernel config items need to be set, that aren't set by default: +_*NOTE:*_ Some built-in Kernel config items need to be set, that aren't set by default: - https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing ## Firmware, Drivers and Support Tools @@ -65,15 +65,19 @@ The most effective fix to-date is to remove the `board-2.bin` file or replace it `board.bin` file. The derivative in `firmware/surface-go/ath10k/` can configure this, if you set the option -`config.hardware.microsoft-surface.firmware.surface-go-ath10k.enable` to `true`. +`config.hardware.microsoft-surface.firmware.surface-go-ath10k.replace` to `true`. -Note that this is slightly destructive, as it deletes all the `board.bin` and `board-2.bin` files -for the `ath10k` QCA6174 device, and replaces them with KillerNetworking's version. +_*NOTE:*_ This is destructive, as it deletes all the `board.bin` and `board-2.bin` files for the +`ath10k` QCA6174 device, and replaces them with KillerNetworking's version. This is the only way (currently) to force the driver to use the new firmware. For more details, see: https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wifi-firmware -There was an attempt to get this firmware incorporated into the aggregate `board-2.bin`, +_*NOTE:*_ There's some work to patch the kernel to make it easier to override which firmware file +to use for QCA6174, which would obviate this more-destructuve approach: +- https://github.com/linux-surface/kernel/commit/22ef83836c4aa89e9eb98de9b47ed24b6c2a1d45 + +_*NOTE:*_ There was an attempt to get this firmware incorporated into the aggregate `board-2.bin`, but (as of this writing) the request appears to have been ignored: - https://github.com/linux-surface/linux-surface/issues/41 diff --git a/microsoft/surface/TODO.org b/microsoft/surface/TODO.org index 0a1f56f..488613f 100644 --- a/microsoft/surface/TODO.org +++ b/microsoft/surface/TODO.org @@ -14,15 +14,16 @@ - [X] Install the binaries ** DONE Remove `ipts` firmware derivative - This is only needed on the 4.19 kernel -** DOING Investigate problem with ath10k wifi firmware on Surface Go +** DONE Investigate problem with ath10k wifi firmware on Surface Go :LOGBOOK: - State "DOING" from "TODO" [2021-02-09 Tue 17:19] +- State "DONE" from "DOING" [2021-03-06 Sat 15:27] :END: *** DONE README entry explaining problem(s) with nonfree firmware on Surface Go :LOGBOOK: - State "DONE" from "TODO" [2021-02-09 Tue 17:17] :END: -*** DOING Create derivative for `ath10k` firmware on Surface Go +*** DONE Create derivative for `ath10k` firmware on Surface Go :LOGBOOK: - State "DOING" from "TODO" [2021-02-09 Tue 17:18] :END: @@ -31,8 +32,8 @@ - [X] Download `board.bin` from Killer Networks? - [X] Install ath10k firmware fix for Surface Go - `board-2.bin` needs to be removed / replaced with `board.bin` - - [ ] Add a config option for enabling the Surface Go Firmware - - [ ] Replace the vendorised `board.bin` with a `fetchurl` + - [X] Add a config option for enabling the Surface Go Firmware + - [-] Replace the vendorised `board.bin` with a `fetchurl` - Getting HTTP 406 when using `fetchurl` or `nix-prefetch-url` that has to be diagnosed * Support Tools ** TODO Incorporate @hpfr's function(s) from this commit: diff --git a/microsoft/surface/firmware/surface-go/ath10k/ath10k.nix b/microsoft/surface/firmware/surface-go/ath10k/ath10k-replace.nix similarity index 100% rename from microsoft/surface/firmware/surface-go/ath10k/ath10k.nix rename to microsoft/surface/firmware/surface-go/ath10k/ath10k-replace.nix diff --git a/microsoft/surface/firmware/surface-go/ath10k/default.nix b/microsoft/surface/firmware/surface-go/ath10k/default.nix index 44f2bfd..b23fe2e 100644 --- a/microsoft/surface/firmware/surface-go/ath10k/default.nix +++ b/microsoft/surface/firmware/surface-go/ath10k/default.nix @@ -5,14 +5,14 @@ in { options = { hardware.microsoft-surface.firmware.surface-go-ath10k = { - enable = lib.mkEnableOption ''Use the "board.bin" firmware for ath10k-based WiFi on Surface Go.''; + replace = lib.mkEnableOption ''Use the "board.bin" firmware for ath10k-based WiFi on Surface Go.''; }; }; - config = lib.mkIf cfg.enable { + config = lib.mkIf cfg.replace { hardware.enableAllFirmware = true; hardware.firmware = [ - (pkgs.callPackage ./ath10k.nix {}) + (pkgs.callPackage ./ath10k-replace.nix {}) ]; boot.extraModprobeConfig = lib.mkDefault '' From 523d8efb5d826e2d21a9637eaf04fb0abbdb9980 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 22:24:34 +1300 Subject: [PATCH 20/21] Should have used HTTP instead of SSH --- microsoft/surface/repos.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft/surface/repos.nix b/microsoft/surface/repos.nix index a1b434f..eb558be 100644 --- a/microsoft/surface/repos.nix +++ b/microsoft/surface/repos.nix @@ -19,7 +19,7 @@ }; surface-go-ath10k-firmware_backup = fetchgit { - url="git@github.com:mexisme/linux-surface_ath10k-firmware.git"; + url="https://github.com/mexisme/linux-surface_ath10k-firmware.git"; rev="74e5409e699383d6ca2bc4da4a8433d16f3850b1"; sha256="169vgvxpgad9anmchs22fj5qm6ahzjfdnwhd8pc280q705vx6pjk"; }; From bfbb77e8f1a20cacbdd12f3de3f618f1bb2eda09 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 22:48:50 +1300 Subject: [PATCH 21/21] Use fetchFromGitHub instead of fetchgit --- microsoft/surface/repos.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/microsoft/surface/repos.nix b/microsoft/surface/repos.nix index eb558be..466f6f2 100644 --- a/microsoft/surface/repos.nix +++ b/microsoft/surface/repos.nix @@ -1,13 +1,15 @@ -{ lib, pkgs, fetchgit, fetchurl }: +{ lib, pkgs, fetchFromGitHub, fetchurl }: { - linux-surface = fetchgit { - url="https://github.com/linux-surface/linux-surface.git"; + linux-surface = fetchFromGitHub { + owner="linux-surface"; + repo="linux-surface"; rev="f8fab978a480a4ed57e9ebb6928683b2e443c1c5"; sha256="0zwybprwjckpapxm6gxzh6hwdd1w91g5sjxn6z52zlvvjpkmw959"; }; - ath10k-firmware = fetchgit { - url="https://github.com/kvalo/ath10k-firmware"; + ath10k-firmware = fetchFromGitHub { + owner="kvalo"; + repo="ath10k-firmware"; rev="84b47062aab31d67156e0a3ef593a6999a12864b"; sha256="0l8wfj8z4jbb31nzqkaxisby0n6061ix01c5di9bq66iby59j8py"; }; @@ -18,8 +20,9 @@ sha256="0l8wfj8z4jbb31nzqkaxisby0n6061ix01c5di9bq66iby59j8py"; }; - surface-go-ath10k-firmware_backup = fetchgit { - url="https://github.com/mexisme/linux-surface_ath10k-firmware.git"; + surface-go-ath10k-firmware_backup = fetchFromGitHub { + owner="mexisme"; + repo="linux-surface_ath10k-firmware"; rev="74e5409e699383d6ca2bc4da4a8433d16f3850b1"; sha256="169vgvxpgad9anmchs22fj5qm6ahzjfdnwhd8pc280q705vx6pjk"; };