Compare commits

..
Author SHA1 Message Date
Jörg Thalheim ce98bebf0f Merge pull request #1029 from xeniarose/framework-amd-kmod
framework: refactor kmod for improved AMD support
2025-01-20 08:25:41 +01:00
Jörg Thalheim e7ac747157 Merge pull request #1319 from LucasFA/omen-15-ce002ns
omen/15-ce002ns: Init
2025-01-20 08:25:17 +01:00
Jörg Thalheim c3e369baa6 Merge pull request #1317 from miangraham/gpd-pocket-4-init
gpd/pocket-4: init
2025-01-20 08:23:00 +01:00
Nicky Mouha cb3173dc5c include Dell Latitude 549 in flake.nix (#1316) 2025-01-19 18:07:52 +01:00
Jörg Thalheim f8d5f4ea3e Merge pull request #1322 from Weathercold/redmibook-16-pro-2024
xiaomi/redmibook/16-pro-2024: init
2025-01-19 18:05:03 +01:00
Weathercold abe22227d7 xiaomi/redmibook/16-pro-2024: init 2025-01-19 14:25:00 +00:00
M. Ian Graham 3883dfe5ee gpd/pocket-4: init 2025-01-17 10:11:37 +09:00
LucasFA b31613ae10 omen/15-ce002ns: Init 2025-01-16 14:33:54 +00:00
xenia 4c0d42b582 framework: refactor kmod for improved AMD support
Changes several aspects of framework-laptop-kmod support:
- default value has been changed to true when NixOS >= 24.05 and
  linux kernel >=6.10, and false otherwise
- adds required patch for framework AMD enablement when kernel <6.10
- add README section describing usage
2024-12-01 23:04:16 -05:00
11 changed files with 127 additions and 11 deletions

No files matched your search

+3
View File
@@ -125,6 +125,7 @@ See code for all available configurations.
| [Dell Inspiron 7460](dell/inspiron/7460) | `<nixos-hardware/dell/inspiron/7460>` |
| [Dell Latitude 3340](dell/latitude/3340) | `<nixos-hardware/dell/latitude/3340>` |
| [Dell Latitude 3480](dell/latitude/3480) | `<nixos-hardware/dell/latitude/3480>` |
| [Dell Latitude 5490](dell/latitude/5490) | `<nixos-hardware/dell/latitude/5490>` |
| [Dell Latitude 5520](dell/latitude/5520) | `<nixos-hardware/dell/latitude/5520>` |
| [Dell Latitude 7280](dell/latitude/7280) | `<nixos-hardware/dell/latitude/7280>` |
| [Dell Latitude 7390](dell/latitude/7390) | `<nixos-hardware/dell/latitude/7390>` |
@@ -180,6 +181,7 @@ See code for all available configurations.
| [GPD MicroPC](gpd/micropc) | `<nixos-hardware/gpd/micropc>` |
| [GPD P2 Max](gpd/p2-max) | `<nixos-hardware/gpd/p2-max>` |
| [GPD Pocket 3](gpd/pocket-3) | `<nixos-hardware/gpd/pocket-3>` |
| [GPD Pocket 4](gpd/pocket-4) | `<nixos-hardware/gpd/pocket-4>` |
| [GPD WIN 2](gpd/win-2) | `<nixos-hardware/gpd/win-2>` |
| [GPD WIN Max 2 2023](gpd/win-max-2/2023) | `<nixos-hardware/gpd/win-max-2/2023>` |
| [GPD WIN Mini 2024](gpd/win-mini/2024) | `<nixos-hardware/gpd/win-mini/2024>` |
@@ -319,6 +321,7 @@ See code for all available configurations.
| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `<nixos-hardware/hardkernel/odroid-hc4>` |
| [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `<nixos-hardware/hardkernel/odroid-h3>` |
| [Omen 14-fb0798ng](omen/14-fb0798ng) | `<nixos-hardware/omen/14-fb0798ng>` |
| [Omen 15-ce002ns](omen/15-ce002ns) | `<nixos-hardware/omen/15-ce002ns>` |
| [Omen 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` |
| [Omen 16-n0005ne](omen/16-n0005ne) | `<nixos-hardware/omen/16-n0005ne>` |
| [Omen 16-n0280nd](/omen/16-n0280nd) | `<nixos-hardware/omen/16-n0280nd>` |
+1 -1
View File
@@ -12,7 +12,7 @@
boot = {
# Kernel Panic on suspend fix, taken from ArchLinux wiki.
kernelParams = "acpi_enforce_resources=lax i915.enable_dc=0";
kernelParams = [ "acpi_enforce_resources=lax" "i915.enable_dc=0" ];
# Audio Mute LED
extraModprobeConfig = ''
options snd-hda-intel model=mute-led-gpio
+3
View File
@@ -64,6 +64,7 @@
dell-inspiron-7460 = import ./dell/inspiron/7460;
dell-latitude-3340 = import ./dell/latitude/3340;
dell-latitude-3480 = import ./dell/latitude/3480;
dell-latitude-5490 = import ./dell/latitude/5490;
dell-latitude-5520 = import ./dell/latitude/5520;
dell-latitude-7280 = import ./dell/latitude/7280;
dell-latitude-7390 = import ./dell/latitude/7390;
@@ -121,6 +122,7 @@
gpd-micropc = import ./gpd/micropc;
gpd-p2-max = import ./gpd/p2-max;
gpd-pocket-3 = import ./gpd/pocket-3;
gpd-pocket-4 = import ./gpd/pocket-4;
gpd-win-2 = import ./gpd/win-2;
gpd-win-max-2-2023 = import ./gpd/win-max-2/2023;
gpd-win-mini-2024 = import ./gpd/win-mini/2024;
@@ -268,6 +270,7 @@
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
omen-14-fb0798ng = import ./omen/14-fb0798ng;
omen-15-ce002ns = import ./omen/15-ce002ns;
omen-15-en0010ca = import ./omen/15-en0010ca;
omen-16-n0005ne = import ./omen/16-n0005ne;
omen-16-n0280nd = import ./omen/16-n0280nd;
+11
View File
@@ -51,6 +51,17 @@ For the Framework 13 laptops, there are common configuration modules available u
including some modules specific to AMD- or Intel-based laptops. By preference, there will already be a specialised
module for your model's configuration. Otherwise, it can be added alongside the existing modules.
## OS integration
`hardware.framework.enableKmod` enables the [community-created Framework kernel
module](https://github.com/DHowett/framework-laptop-kmod) which exposes EC functionality like battery charge limit,
privacy switches, and system LEDs as standard driver interfaces. This enables, for example, configuring the charge limit
using the KDE settings GUI. The option is enabled by default when NixOS `>= 24.05` and linux kernel version `>= 6.10`.
On AMD Framework 13 and 16, before kernel 6.10, additional kernel patches are required for the kernel module to function
properly. Manually setting `hardware.framework.enableKmod = true` will apply the patches, requiring a kernel
recompilation.
## Support Tools
### fw-ectool
+34 -9
View File
@@ -1,17 +1,42 @@
{ config, lib, ... }:
{
options.hardware.framework.enableKmod = lib.mkEnableOption
{ config, lib, pkgs, ... }:
let
kernel_version_compatible = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
in {
options.hardware.framework.enableKmod = (lib.mkEnableOption
"Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs."
// {
# Enable by default if on new enough version of NixOS
default = (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05");
) // {
# enable by default on NixOS >= 24.05 and kernel >= 6.10
default = lib.and
(lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05")
kernel_version_compatible;
};
config = lib.mkIf config.hardware.framework.enableKmod {
boot.extraModulePackages = with config.boot.kernelPackages; [
config.boot = lib.mkIf config.hardware.framework.enableKmod {
extraModulePackages = with config.boot.kernelPackages; [
framework-laptop-kmod
];
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
boot.kernelModules = [ "cros_ec" "cros_ec_lpcs" ];
kernelModules = [ "cros_ec" "cros_ec_lpcs" ];
# add required patch if enabled on kernel <6.10
kernelPatches = lib.mkIf (!kernel_version_compatible) [
rec {
name = "platform/chrome: cros_ec_lpc: add support for AMD Framework Laptops";
msgid = "20240403004713.130365-1-dustin@howett.net";
version = "3";
hash = "sha256-aQSyys8CMzlj9EdNhg8vtp76fg1qEwUVeJL0E+8w5HU=";
patch = pkgs.runCommandLocal "patch-${msgid}" {
nativeBuildInputs = with pkgs; [ b4 git cacert ];
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
outputHash = hash;
} ''
export HOME="$TMP"
PYTHONHASHSEED=0 ${pkgs.b4}/bin/b4 -n am -C -T -v ${version} -o- "${msgid}" > "$out"
'';
}
];
};
}
+29
View File
@@ -0,0 +1,29 @@
{ lib, pkgs, ... }:
let inherit (lib) mkDefault;
in
{
imports = [
../../common/pc/laptop
../../common/pc/laptop/ssd
../../common/cpu/amd
../../common/cpu/amd/pstate.nix
../../common/gpu/amd
../../common/hidpi.nix
];
boot.kernelParams = [
# The GPD Pocket 4 uses a tablet LTPS display, that is mounted rotated 90° counter-clockwise
"fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up"
];
fonts.fontconfig = {
subpixel.rgba = "vbgr"; # Pixel order for rotated screen
# The display has √(2560² + 1600²) px / 8.8in ≃ 343 dpi
# Per the documentation, antialiasing, hinting, etc. have no visible effect at such high pixel densities anyhow.
hinting.enable = mkDefault false;
};
# More HiDPI settings
services.xserver.dpi = 343;
}
+31
View File
@@ -0,0 +1,31 @@
# HP Omen 15-ce002ns
Profile for the following laptop: https://support.hp.com/us-en/document/c05552952
```bash
$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:5910] (rev 05)
00:01.0 PCI bridge [0604]: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 05)
00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 05)
00:14.0 USB controller [0c03]: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller [8086:a12f] (rev 31)
00:14.2 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem [8086:a131] (rev 31)
00:15.0 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #0 [8086:a160] (rev 31)
00:16.0 Communication controller [0780]: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 [8086:a13a] (rev 31)
00:17.0 SATA controller [0106]: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] [8086:a103] (rev 31)
00:1c.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 [8086:a110] (rev f1)
00:1c.4 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #5 [8086:a114] (rev f1)
00:1c.5 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #6 [8086:a115] (rev f1)
00:1c.6 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #7 [8086:a116] (rev f1)
00:1d.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #9 [8086:a118] (rev f1)
00:1f.0 ISA bridge [0601]: Intel Corporation HM175 Chipset LPC/eSPI Controller [8086:a152] (rev 31)
00:1f.2 Memory controller [0580]: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller [8086:a121] (rev 31)
00:1f.3 Audio device [0403]: Intel Corporation CM238 HD Audio Controller [8086:a171] (rev 31)
00:1f.4 SMBus [0c05]: Intel Corporation 100 Series/C230 Series Chipset Family SMBus [8086:a123] (rev 31)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106BM [GeForce GTX 1060 Mobile 6GB] [10de:1c60] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1)
3b:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 16)
3c:00.0 Network controller [0280]: Intel Corporation Wireless 7265 [8086:095a] (rev 61)
3d:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader [10ec:522a] (rev 01)
3e:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961/SM963 [144d:a804]
```
+11
View File
@@ -0,0 +1,11 @@
{ lib, pkgs, ... }:
{
imports = [
../../common/cpu/intel/kaby-lake
../../common/gpu/nvidia/pascal
../../common/pc/laptop
../../common/pc/laptop/ssd
../../common/pc/laptop/hdd
];
}
File renamed without changes.
+3
View File
@@ -1,5 +1,8 @@
# Xiaomi Redmibook 16 Pro (2024)
Note that the boot fix requires building the kernel. As such, you might run out
of space during nixos-rebuild if you mount tmpfs on `/tmp`.
## Tested Hardware
```shellsession
+1 -1
View File
@@ -1,7 +1,7 @@
{ lib, ... }:
{
imports = [
../../common/fix-boot
../../fix-boot-quirk.nix
../../../common/cpu/intel
../../../common/pc/laptop
../../../common/pc/laptop/ssd