|
2 | 2 |
|
3 | 3 | let |
4 | 4 | cfg = config.smind.hw.framework-laptop; |
5 | | - kernelVersion = config.boot.kernelPackages.kernel.version; |
6 | | - isKernel612 = lib.versionAtLeast kernelVersion "6.12" && lib.versionOlder kernelVersion "6.13"; |
7 | 5 | frameworkToolExecutable = lib.getExe' pkgs.framework-tool "framework_tool"; |
8 | 6 | macLikeModifiersRemapCommands = '' |
9 | 7 | # Framework Laptop 13 keyboard table and scan code examples: |
|
40 | 38 | Framework Laptop 13 initrd key remap for mac-like modifiers. |
41 | 39 | Applies an EC-level swap so Command/Option/Control behave like macOS-style modifiers before userspace starts |
42 | 40 | ''; |
43 | | - |
44 | | - kernelPatches = { |
45 | | - vpe-dpm0.enable = lib.mkEnableOption '' |
46 | | - amdgpu VPE Strix Point DPM0 fix. |
47 | | - Adds IP_VERSION(6, 1, 0) to the DPM0 power-down check in amdgpu_vpe.c |
48 | | - '' // { default = cfg.enable; }; |
49 | | - |
50 | | - ath12k-pairwise-key.enable = lib.mkEnableOption '' |
51 | | - ath12k WCN7850 pairwise key ordering fix (kernel 6.12 only). |
52 | | - Backport of upstream commit 66e865f9dc78 — WCN7850 firmware requires PTK before GTK. |
53 | | - https://bugzilla.kernel.org/show_bug.cgi?id=218733 |
54 | | - '' // { default = cfg.enable && isKernel612; }; |
55 | | - }; |
56 | 41 | }; |
57 | 42 |
|
58 | 43 | config = lib.mkIf cfg.enable (lib.mkMerge [ |
|
133 | 118 | }; |
134 | 119 | }) |
135 | 120 |
|
136 | | - # --- Kernel patches --- |
137 | | - |
138 | | - (lib.mkIf cfg.kernelPatches.vpe-dpm0.enable { |
139 | | - boot.kernelPatches = [ |
140 | | - { |
141 | | - name = "amdgpu-vpe-strix-point-dpm0-fix"; |
142 | | - patch = pkgs.writeText "vpe-strix-point.patch" '' |
143 | | - --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c |
144 | | - +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c |
145 | | - @@ -325,6 +325,8 @@ static bool vpe_need_dpm0_at_power_down(struct amdgpu_device *adev) |
146 | | - { |
147 | | - switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) { |
148 | | - + case IP_VERSION(6, 1, 0): |
149 | | - + return true; /* Strix Point needs DPM0 check regardless of PMFW version */ |
150 | | - case IP_VERSION(6, 1, 1): |
151 | | - return adev->pm.fw_version < 0x0a640500; |
152 | | - default: |
153 | | - ''; |
154 | | - } |
155 | | - ]; |
156 | | - }) |
157 | | - |
158 | | - (lib.mkIf cfg.kernelPatches.ath12k-pairwise-key.enable { |
159 | | - boot.kernelPatches = [ |
160 | | - { |
161 | | - # Backport of upstream commit 66e865f9dc78 ("wifi: ath12k: install pairwise key first") |
162 | | - # WCN7850 firmware requires PTK before GTK; without this fix the EAPOL handshake |
163 | | - # fails in a loop (PREV_AUTH_NOT_VALID deauth). Not backported to 6.12 LTS upstream. |
164 | | - name = "ath12k-wcn7850-install-pairwise-key-first"; |
165 | | - patch = ./patches/ath12k-pairwise-key-6.12.patch; |
166 | | - } |
167 | | - ]; |
168 | | - }) |
169 | 121 | ]); |
170 | 122 | } |
0 commit comments