Compare commits

..
Author SHA1 Message Date
K900 f9a55f8d23 common/pc: only enable xf86-input-libinput when X is enabled 2024-04-10 17:04:36 +03:00
AndreandJörg Thalheim 805adee81c Add Lenovo legion 16ARHA7 (#906)
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-04-10 10:52:19 +02:00
Jörg Thalheim 05aa46a1f3 Merge pull request #905 from stigtsp/surface-kernel-bump-9
surface: linux 6.6.13 -> 6.6.25
2024-04-09 22:46:47 +02:00
Jörg Thalheim 1e3b3a35b7 Merge pull request #902 from skeuchel/milkv-pioneer
milkv/pioneer: init
2024-04-08 10:48:28 +02:00
Jörg Thalheim 218ab789fd milkv/pioneer: fix u-root cross-compilation
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
2024-04-08 06:34:49 +02:00
Stig Palmquist 41e6854df7 surface: linux 6.6.13 -> 6.6.25 2024-04-06 17:49:02 +02:00
yuannan f3b959627b removed edid 2024-04-05 13:47:45 +00:00
yuannan a7825c5b9a 15ach6h 2024-04-05 13:47:45 +00:00
Benedikt Ritter a3746a14c1 feat: add dell latitude 7280 module 2024-04-05 13:41:45 +00:00
deirn e1cbffcf3a ga401: use mkDefault for dynamicBoost 2024-04-05 13:36:28 +00:00
Steven Keuchel f4a07223a3 milkv/pioneer: init 2024-04-05 13:35:18 +00:00
Raito Bezarius cac934beb3 fix(pine64/star64): resolve conflicting definition for Linux 5.15
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-04-05 15:30:34 +02:00
Ryan Lahfa 400688fb2c Merge pull request #898 from matdibu/master
protectli vp4670
2024-04-05 06:18:38 -07:00
Matei Dibu adcd458b55 protectli/vp4670: init 2024-03-25 19:40:30 +02:00
Matei Dibu 823a82200c common/cpu/intel/comet-lake: init 2024-03-25 12:24:34 +02:00
Jörg Thalheim 9a763a7acc Merge pull request #880 from jalseth/x13-amd
Add Thinkpad X13 Gen1 AMD variant
2024-03-25 08:45:45 +01:00
Nire BryceandJörg Thalheim 474549f841 gigabyte b550: suspend fix (#884)
fixes b550 suspend bug by setting up systemd services that disable GPP0 and GPP8 in /proc/acpi/wakeup

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-03-25 08:40:22 +01:00
Jörg Thalheim 7559df1e4a Merge pull request #892 from piousdeer/yes-edid
16ach6h: re-enable edid for internal display only
2024-03-24 11:04:31 +01:00
mergify[bot] 3ba071c120 Merge branch 'master' into yes-edid 2024-03-18 17:43:36 +00:00
kevinlmadison 1e679b9a99 Update readme 2024-03-18 17:42:08 +00:00
kevinlmadison 5bf55b8532 Add msi-b350-tomahawk module to flake 2024-03-18 17:42:08 +00:00
kevinlmadison 1568f005e1 add support for MSI B350 TOMAHAWK Motherboard 2024-03-18 17:42:08 +00:00
piousdeer b081de56df 16ach6h: re-enable edid for internal display only 2024-03-18 22:30:49 +07:00
Jörg Thalheim 968952f950 Merge pull request #890 from yaoshiu/no-edid
fix: comment out the edid module for legion-16ach6h
2024-03-16 21:46:44 +01:00
Fay Ash 74967732a5 fix: comment out the edid module for legion-16ach6h
It seems to break extra monitor modes
2024-03-16 00:48:04 +08:00
dependabot[bot] ad2fd7b978 build(deps): bump cachix/install-nix-action from 25 to 26
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 25 to 26.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v25...v26)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 02:13:45 +00:00
James Alseth 19e5d3c9d9 Add Thinkpad X13 Gen1 AMD variant 2024-03-04 08:54:30 -08:00
koalp 59e37017b9 Add msi B550 a pro motherboard 2024-03-02 20:16:23 +00:00
Bit 33a97b5814 add w520 to readme 2024-02-28 19:19:50 +00:00
Bit Borealis ce93797a42 add w520 ( copy of t520 ) 2024-02-28 19:19:50 +00:00
Vinetos 01467901ec dell-xps-15-9570: init 2024-02-28 08:59:50 +00:00
Ganga Ram f12e5fd7ec nxp imx8mp-evk/imx8mq-evk documentation
Signed-off-by: Ganga Ram <Ganga.Ram@tii.ae>
2024-02-28 08:54:14 +00:00
Ganga Ram 53e2a96a9e nxp imx8m quad evaluation platform support
Signed-off-by: Ganga Ram <Ganga.Ram@tii.ae>
2024-02-28 08:54:14 +00:00
Ganga Ram 5c2a5c00a0 nxp imx8mp-evk platform support
Signed-off-by: Ganga Ram <Ganga.Ram@tii.ae>
2024-02-28 08:54:14 +00:00
Jörg Thalheim a597c4ad63 Merge pull request #875 from gangaram-tii/pr/icicle-kit-doc
microchip icicle-kit README update
2024-02-28 09:46:51 +01:00
Ganga Ram 55b794ba77 microchip icicle-kit README update
Signed-off-by: Ganga Ram <Ganga.Ram@tii.ae>
2024-02-27 16:17:03 +04:00
Ashwin Belbase 3f7d0bca00 Add links to FA507RM 2024-02-22 09:39:13 +00:00
Ashwin Belbase 27cca741bf Add files for Asus TUF A15 (FA507RM) 2024-02-22 09:39:13 +00:00
V7 3610be0dca Import Intel GPU module 2024-02-22 09:33:01 +00:00
Luflosi 106d3fec43 framework AMD 7040: work around white screen / flickering issue on newer kernels
Fixes #817.

Updating the kernel if it is too old is already done by `common/cpu/amd/raphael/igpu.nix`, so I removed the redundant code.
2024-02-16 13:49:10 +00:00
Luflosi a377fb23dc cpu/amd/igpu: change condition to check actually used kernel version
Change condition to check actually used kernel version instead of which kernel version is the default.
Without this change, if a user changes the kernel version to a newer version, the kernel parameter will not actually be added.
2024-02-16 13:49:10 +00:00
Ganga Ram f1b2f71c86 Update repository path for nxp/imx
Signed-off-by: Ganga Ram <Ganga.Ram@tii.ae>
2024-02-13 16:36:44 +00:00
Cryolitia 2b68ccd747 gpd-win-max-2-2023: enable iio subsystem 2024-02-13 10:56:22 +00:00
Cryolitia c1db24a14b gpd-win-max-2-2023: init BMI260 driver 2024-02-13 10:56:22 +00:00
Cryolitia d1117dcf09 gpd-win-man-2-2023: init README 2024-02-13 10:56:22 +00:00
Cryolitia 61d602f428 gpd-win-max-2-2023: remove udev rule disabling PCI wakeup
fixed in linux kernel mainline and backported
https://github.com/torvalds/linux/commit/805c74eac8cb306dc69b87b6b066ab4da77ceaf1
2024-02-13 10:56:22 +00:00
queer-bird 7220f26a7c Missed a curly bracket 2024-02-13 10:50:48 +00:00
queer-bird 8be74baad0 Fix audio interference in headphone jack on Thinkpad x1 Nano Gen 1 2024-02-13 10:50:48 +00:00
mexisme 6e5cc385fc Extract AMD-GPU from Nvidia, to make it easier to choose either 2024-02-06 09:25:57 +00:00
mexisme 5a8ed531f9 Initial config. for Lenovo Yoga Slim 7 Pro-X (14ARH7)
- Add entry to README.md and flake.nix
2024-02-06 09:25:57 +00:00
mexisme 06e919ac07 Update README.md and flake.nix 2024-02-06 09:20:31 +00:00
mexisme b5c4fb6b89 Add a config for Asus Zephyrus GA402X* (2023) series
- Disable power-saving for the keyboard on the Asus Zephyrus GA402X series (2023)
- Add more-aggressive roaming rules for Asus Mediatek cards when using IWD
  - Add note about potentially needing more-aggressive roaming rules for Asus Mediatek cards when using WPA-Supplicant
  - Make enabling the higher scanning optional
- Split-up the AMD-GPU and Nvidia configs
- Add switch for AMD-GPU recovery mode
- Add switch for AMD-GPU sg_display (Scatter/Gather) mode
- Add switch for AMD-GPU PSR support
2024-02-06 09:20:31 +00:00
Samuel Cobb fc8d1ebb82 Rename Omen model 2024-02-06 09:11:04 +00:00
Jörg Thalheim 83e571bb29 Merge pull request #851 from mexisme/microsoft/surface/kernel-6.6
Rewrite the microsoft/surface `linuxPackage` function to make it simpler to use
2024-02-02 07:49:42 +07:00
mergify[bot] 76cea60f68 Merge branch 'master' into microsoft/surface/kernel-6.6 2024-02-02 00:47:25 +00:00
4JX cc65e27670 Better default for amdgpuBusId 2024-02-01 10:14:09 +00:00
4JX ed01236ece 16ach6h: Comment out failing edid line
Fixes #795
2024-02-01 10:14:09 +00:00
4JX 07e43b0530 16ach6h: Fix X11 setup
Fixes #628
2024-02-01 10:14:09 +00:00
4JX 58b17dc234 16ach6h: Do not duplicate nvidia config 2024-02-01 10:14:09 +00:00
Guillaume Girol 3b54f86b53 dell inspiron 5515: add early kms
since the update to 23.11, the screen would remain black frequently on
boot. Pressing alt+sysrq+k would make the display manager start.
Empirically, setting early kms up has solved the issue.
2024-02-01 10:08:38 +00:00
ChaosAttractor 83ce5906a5 ga401: disable hardware.nvidia.powerManagement.enable 2024-02-01 10:01:33 +00:00
ChaosAttractor 80223acd7f ga401: enable nvidia.dynamicBoost 2024-02-01 10:01:33 +00:00
Nick Cao 42d7e50677 starfive visionfive2: update kernel to 6.6.0 2024-02-01 06:00:43 +00:00
mexisme 88712a124b Pick a better name than "versionsOfOption" 2024-01-31 21:36:14 +13:00
mexisme 85a2b5542e Restore the "majorVersion" functionality 2024-01-31 21:33:40 +13:00
mexisme c5214dc06a Add some functions to allow for a major.minor kernel version to be able to auto-allow the major.minor.patch to be auto-selected 2024-01-31 21:33:39 +13:00
mexisme 606b6a270e Drop the kernel version override for Surface Go hardware 2024-01-31 12:04:04 +13:00
mexisme 7def533968 Drop the deprecated "linuxPackage1" function, rename "linuxPackage2" to "linuxPackage" 2024-01-31 12:00:03 +13:00
mexisme f2fbed9ce6 Merge branch 'master' into microsoft/surface/kernel-6.6 2024-01-31 11:53:54 +13:00
mexisme 32ed8e5b86 Merge branch 'microsoft/surface/kernel-6.6' of github.com:mexisme/nixos-hardware into microsoft/surface/kernel-6.6 2024-01-26 11:37:48 +13:00
mexisme b4f54f34ed Merge branch 'master' into microsoft/surface/kernel-6.6 2024-01-26 11:37:25 +13:00
Jörg Thalheim f84eaffc35 Merge pull request #839 from damianoognissanti/patch-3
Make so that kernel configs are actually read when compiling for microsoft surface devices.
2024-01-25 12:30:38 +01:00
Jörg Thalheim e756ff62c2 Merge pull request #843 from stigtsp/surface-kernel-bump-8
surface: linux 6.6.10 -> 6.6.13
2024-01-24 09:32:37 +01:00
Stig Palmquist abff72bb97 surface: linux 6.6.10 -> 6.6.13 2024-01-24 09:25:36 +01:00
Nick Cao ff16da3a6b starfive visionfive2: update u-boot to 2024.01 2024-01-24 08:01:14 +00:00
damianoognissanti e57f8c264a Update default.nix
Needed to make kernel build if options from patch are missing.
2024-01-16 18:41:29 +01:00
damianoognissanti 6b5d311cb6 Fix patches.nix
As discussed here: https://github.com/NixOS/nixos-hardware/issues/523

1) `structuredExtraConfig` is called `extraStructuredConfig` when using `kernelPatches`

2) STREAMING_MEDIA should be STAGING_MEDIA
2024-01-16 18:28:45 +01:00
mexisme 6cf457a2ec Merge branch 'master' into microsoft/surface/kernel-6.6 2024-01-15 22:54:37 +13:00
Domen Kožar bee2202bec Add support for Yoga Slim 7 Gen8 2024-01-15 09:51:25 +00:00
mexisme 921c09c127 Merge branch 'master' into microsoft/surface/kernel-6.6 2024-01-15 22:50:33 +13:00
mexisme 6e43a42577 Merge branch 'master' into microsoft/surface/kernel-6.6 2024-01-04 09:33:48 +13:00
mexisme 62b6776b46 Fix rev and sha256 for the current linux-surface patches 2023-11-26 20:58:28 +13:00
mexisme 7dcae71f61 Fix typos 2023-11-26 13:01:52 +13:00
mexisme 0e169f3d58 Use kernel 6.6.2 by default 2023-11-26 12:44:19 +13:00
mexisme 0516b82287 Add kernel 6.6 2023-11-26 12:43:48 +13:00
mexisme 8605f354e2 Use a new linuxPackage function 2023-11-26 12:42:11 +13:00
98 changed files with 2203 additions and 138 deletions

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Show nixpkgs version
+21 -3
View File
@@ -70,7 +70,7 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md).
See code for all available configurations.
| Model | Path |
| ---------------------------------------------------------------------- | ------------------------------------------------------- |
|------------------------------------------------------------------------|---------------------------------------------------------|
| [Acer Aspire 4810T](acer/aspire/4810t) | `<nixos-hardware/acer/aspire/4810t>` |
| [Airis N990](airis/n990) | `<nixos-hardware/airis/n990>` |
| [Apple MacBook Air 3,X](apple/macbook-air/3) | `<nixos-hardware/apple/macbook-air/3>` |
@@ -86,10 +86,13 @@ See code for all available configurations.
| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `<nixos-hardware/asus/rog-strix/g733qs>` |
| [Asus ROG Zephyrus G14 GA401](asus/zephyrus/ga401) | `<nixos-hardware/asus/zephyrus/ga401>` |
| [Asus ROG Zephyrus G14 GA402](asus/zephyrus/ga402) | `<nixos-hardware/asus/zephyrus/ga402>` |
| [Asus ROG Zephyrus G14 GA402X* (2023)](asus/zephyrus/ga402x/amdgpu) | `<nixos-hardware/asus/zephyrus/ga402x/amdgpu>` |
| [Asus ROG Zephyrus G14 GA402X* (2023)](asus/zephyrus/ga402x/nvidia) | `<nixos-hardware/asus/zephyrus/ga402x/nvidia>` |
| [Asus ROG Zephyrus G15 GA502](asus/zephyrus/ga502) | `<nixos-hardware/asus/zephyrus/ga502>` |
| [Asus ROG Zephyrus G15 GA503](asus/zephyrus/ga503) | `<nixos-hardware/asus/zephyrus/ga503>` |
| [Asus ROG Zephyrus M16 GU603H](asus/zephyrus/gu603h) | `<nixos-hardware/asus/zephyrus/gu603h>` |
| [Asus TUF FX504GD](asus/fx504gd) | `<nixos-hardware/asus/fx504gd>` |
| [Asus TUF FA507RM](asus/fa507rm) | `<nixos-hardware/asus/fa507rm>` |
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `<nixos-hardware/beagleboard/pocketbeagle>` |
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` |
| [Dell G3 3779](dell/g3/3779) | `<nixos-hardware/dell/g3/3779>` |
@@ -100,6 +103,7 @@ See code for all available configurations.
| [Dell Latitude 3340](dell/latitude/3340) | `<nixos-hardware/dell/latitude/3340>` |
| [Dell Latitude 3480](dell/latitude/3480) | `<nixos-hardware/dell/latitude/3480>` |
| [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>` |
| [Dell Latitude 7430](dell/latitude/7430) | `<nixos-hardware/dell/latitude/7430>` |
| [Dell Latitude 7490](dell/latitude/7490) | `<nixos-hardware/dell/latitude/7490>` |
@@ -128,6 +132,9 @@ See code for all available configurations.
| [Dell XPS 15 9560, intel only](dell/xps/15-9560/intel) | `<nixos-hardware/dell/xps/15-9560/intel>` |
| [Dell XPS 15 9560, nvidia only](dell/xps/15-9560/nvidia) | `<nixos-hardware/dell/xps/15-9560/nvidia>` |
| [Dell XPS 15 9560](dell/xps/15-9560) | `<nixos-hardware/dell/xps/15-9560>` |
| [Dell XPS 15 9570, intel only](dell/xps/15-9570/intel) | `<nixos-hardware/dell/xps/15-9570/intel>` |
| [Dell XPS 15 9570, nvidia](dell/xps/15-9570/nvidia) | `<nixos-hardware/dell/xps/15-9570/nvidia>` |
| [Dell XPS 15 9570](dell/xps/15-9570) | `<nixos-hardware/dell/xps/15-9570>` |
| [Dell XPS 17 9700, intel](dell/xps/17-9700/intel) | `<nixos-hardware/dell/xps/17-9700/intel` |
| [Dell XPS 17 9700, nvidia](dell/xps/17-9700/nvidia) | `<nixos-hardware/dell/xps/17-9700/nvidia>` |
| [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `<nixos-hardware/dell/xps/17-9710/intel>` |
@@ -139,6 +146,7 @@ See code for all available configurations.
| [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `<nixos-hardware/friendlyarm/nanopc-t4>` |
| [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `<nixos-hardware/friendlyarm/nanopi-r5s>` |
| [Focus M2 Gen 1](focus/m2/gen1) | `<nixos-hardware/focus/m2/gen1>` |
| [Gigabyte B550](gigabyte/b550) | `<nixos-hardware/gigabyte/b550>` |
| [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>` |
@@ -164,6 +172,7 @@ See code for all available configurations.
| [Lenovo Legion 7 16achg6 (Hybrid)](lenovo/legion/16achg6/hybrid) | `<nixos-hardware/lenovo/legion/16achg6/hybrid>` |
| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `<nixos-hardware/lenovo/legion/16achg6/nvidia>` |
| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `<nixos-hardware/lenovo/legion/16irx8h>` |
| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `<nixos-hardware/lenovo/legion/16arha7>` |
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` |
| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `<nixos-hardware/lenovo/thinkpad/e14/amd>` |
| [Lenovo ThinkPad E14 (Intel)](lenovo/thinkpad/e14/intel) | `<nixos-hardware/lenovo/thinkpad/e14/intel>` |
@@ -204,6 +213,7 @@ See code for all available configurations.
| [Lenovo ThinkPad T520](lenovo/thinkpad/t520) | `<nixos-hardware/lenovo/thinkpad/t520>` |
| [Lenovo ThinkPad T550](lenovo/thinkpad/t550) | `<nixos-hardware/lenovo/thinkpad/t550>` |
| [Lenovo ThinkPad T590](lenovo/thinkpad/t590) | `<nixos-hardware/lenovo/thinkpad/t590>` |
| [Lenovo ThinkPad W520](lenovo/thinkpad/w520) | `<nixos-hardware/lenovo/thinkpad/w520>` |
| [Lenovo ThinkPad X1 Yoga](lenovo/thinkpad/x1/yoga) | `<nixos-hardware/lenovo/thinkpad/x1/yoga>` |
| [Lenovo ThinkPad X1 Yoga Gen 7](lenovo/thinkpad/x1/yoga/7th-gen/) | `<nixos-hardware/lenovo/thinkpad/x1/yoga/7th-gen>` |
| [Lenovo ThinkPad X1 (6th Gen)](lenovo/thinkpad/x1/6th-gen) | `<nixos-hardware/lenovo/thinkpad/x1/6th-gen>` |
@@ -216,7 +226,8 @@ See code for all available configurations.
| [Lenovo ThinkPad X1 Nano Gen 1](lenovo/thinkpad/x1-nano/gen1) | `<nixos-hardware/lenovo/thinkpad/x1-nano/gen1>` |
| [Lenovo ThinkPad X13 Yoga](lenovo/thinkpad/x13/yoga) | `<nixos-hardware/lenovo/thinkpad/x13/yoga>` |
| [Lenovo ThinkPad X13 Yoga (3th Gen)](lenovo/thinkpad/x13/yoga/3th-gen) | `<nixos-hardware/lenovo/thinkpad/x13/yoga/3th-gen>` |
| [Lenovo ThinkPad X13](lenovo/thinkpad/x13) | `<nixos-hardware/lenovo/thinkpad/x13>` |
| [Lenovo ThinkPad X13 (Intel)](lenovo/thinkpad/x13/intel) | `<nixos-hardware/lenovo/thinkpad/x13/intel>` |
| [Lenovo ThinkPad X13 (AMD)](lenovo/thinkpad/x13/amd) | `<nixos-hardware/lenovo/thinkpad/x13/amd>` |
| [Lenovo ThinkPad X140e](lenovo/thinkpad/x140e) | `<nixos-hardware/lenovo/thinkpad/x140e>` |
| [Lenovo ThinkPad X200s](lenovo/thinkpad/x200s) | `<nixos-hardware/lenovo/thinkpad/x200s>` |
| [Lenovo ThinkPad X220](lenovo/thinkpad/x220) | `<nixos-hardware/lenovo/thinkpad/x220>` |
@@ -229,7 +240,11 @@ See code for all available configurations.
| [Lenovo ThinkPad Z Series](lenovo/thinkpad/z) | `<nixos-hardware/lenovo/thinkpad/z>` |
| [Lenovo ThinkPad Z13](lenovo/thinkpad/z/z13) | `<nixos-hardware/lenovo/thinkpad/z/z13>` |
| [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `<nixos-hardware/lenovo/yoga/6/13ALC6>` |
| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/amdgpu) | `<nixos-hardware/lenovo/yoga/7/14ARH7/amdgpu>` |
| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `<nixos-hardware/lenovo/yoga/7/14ARH7/nvidia>` |
| [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `<nixos-hardware/lenovo/yoga/7/slim/gen8>` |
| [MSI B550-A PRO](msi/b550-a-pro) | `<nixos-hardware/msi/b550-a-pro>` |
| [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `<nixos-hardware/msi/b350-tomahawk>` |
| [MSI GS60 2QE](msi/gs60) | `<nixos-hardware/msi/gs60>` |
| [MSI GL62/CX62](msi/gl62) | `<nixos-hardware/msi/gl62>` |
| [Microchip Icicle Kit](microchip/icicle-kit) | `<nixos-hardware/microchip/icicle-kit>` |
@@ -239,18 +254,21 @@ See code for all available configurations.
| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `<nixos-hardware/microsoft/surface/common>` |
| [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `<nixos-hardware/microsoft/surface-pro/3>` |
| [Morefine M600](morefine/m600) | `<nixos-hardware/morefine/m600>` |
| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `<nixos-hardware/nxp/imx8mp-evk>` |
| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `<nixos-hardware/nxp/imx8mq-evk>` |
| [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 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` |
| [Omen 16-n0005ne](omen/16-n0005ne) | `<nixos-hardware/omen/16-n0005ne>` |
| [Omen 15-en1007sa](omen/15-en1007sa) | `<nixos-hardware/omen/15-en1007sa>` |
| [Omen en00015p](omen/en00015p) | `<nixos-hardware/omen/en00015p>` |
| [Omen 15-en0002np](omen/15-en0002np) | `<nixos-hardware/omen/15-en0002np>` |
| [One-Netbook OneNetbook 4](onenetbook/4) | `<nixos-hardware/onenetbook/4>` |
| [Panasonic Let's Note CF-LX4](panasonic/letsnote/cf-lx4) | `<nixos-hardware/panasonic/letsnote/cf-lx4>` |
| [PC Engines APU](pcengines/apu) | `<nixos-hardware/pcengines/apu>` |
| [PINE64 Pinebook Pro](pine64/pinebook-pro/) | `<nixos-hardware/pine64/pinebook-pro>` |
| [PINE64 RockPro64](pine64/rockpro64/) | `<nixos-hardware/pine64/rockpro64>` |
| [PINE64 STAR64](pine64/star64/) | `<nixos-hardware/pine64/star64>` |
| [Protectli VP4670](protectli/vp4670/) | `<nixos-hardware/protectli/vp4670>` |
| [Purism Librem 13v3](purism/librem/13v3) | `<nixos-hardware/purism/librem/13v3>` |
| [Purism Librem 15v3](purism/librem/13v3) | `<nixos-hardware/purism/librem/15v3>` |
| [Purism Librem 5r4](purism/librem/5r4) | `<nixos-hardware/purism/librem/5r4>` |
+15
View File
@@ -0,0 +1,15 @@
{ ... }:
{
imports = [
../../common/cpu/amd
../../common/gpu/nvidia/prime.nix
../../common/pc/laptop
../../common/pc/ssd
];
hardware.nvidia.prime = {
amdgpuBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0";
};
}
+4 -4
View File
@@ -11,11 +11,11 @@
];
hardware.nvidia = {
# PCI-Express Runtime D3 Power Management is enabled by default on this laptop
# But it can fix screen tearing & suspend/resume screen corruption in sync mode
modesetting.enable = lib.mkDefault true;
# Enable DRM kernel mode setting
powerManagement.enable = lib.mkDefault true;
# This will also cause "PCI-Express Runtime D3 Power Management" to be enabled by default
modesetting.enable = lib.mkDefault true;
dynamicBoost.enable = lib.mkDefault true;
prime = {
amdgpuBusId = "PCI:4:0:0";
+58
View File
@@ -0,0 +1,58 @@
{ config,
lib,
pkgs,
...
}:
let
inherit (lib) mkDefault mkEnableOption mkIf mkMerge;
cfg = config.hardware.asus.zephyrus.ga402x;
in {
imports = [
../shared.nix
];
options.hardware.asus.zephyrus.ga402x.amdgpu = {
recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = false; };
sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = true; };
psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // { default = true; };
};
config = mkMerge [
{
# AMD RX680
services.xserver.videoDrivers = mkDefault [ "amdgpu" ];
hardware = {
amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
];
};
}
(mkIf cfg.amdgpu.recovery.enable {
# Hopefully fixes for where the kernel sometimes hangs when suspending or hibernating
# (Though, I'm very suspicious of the Mediatek Wifi...)
boot.kernelParams = [
"amdgpu.gpu_recovery=1"
];
})
(mkIf (!cfg.amdgpu.sg_display.enable) {
# Can help solve flickering/glitching display issues since Scatter/Gather code was reenabled
boot.kernelParams = [
"amdgpu.sg_display=0"
];
})
(mkIf (!cfg.amdgpu.psr.enable) {
# Can help solve flickering/glitching display issues since Scatter/Gather code was reenabled
boot.kernelParams = [
"amdgpu.dcdebugmask=0x10"
];
})
];
}
+15
View File
@@ -0,0 +1,15 @@
## When using from a Flake, you can access these via imports of the attr key, e.g:
#
# imports = [
# nixos-hardware.nixosModules.asus-zephyrus-ga402x.amdgpu
# ];
#
## or:
# imports = [
# nixos-hardware.nixosModules.asus-zephyrus-ga402x.nvidia
# ];
{
amdgpu = import ./amdgpu;
nvidia = import ./nvidia;
}
+55
View File
@@ -0,0 +1,55 @@
{ lib,
pkgs,
...
}:
let
inherit (lib) mkDefault;
in {
imports = [
../shared.nix
## "prime.nix" loads this, aleady:
# ../../../common/gpu/nvidia
../../../../common/gpu/nvidia/prime.nix
];
# NVIDIA GeForce RTX 4060 Mobile
boot = {
blacklistedKernelModules = [ "nouveau" ];
};
# Also in nvidia/default.nix
services.xserver.videoDrivers = mkDefault [ "nvidia" ];
hardware = {
## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [
# Also in nvidia/default.nix
vaapiVdpau
libvdpau-va-gl
];
nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:101:0:0";
nvidiaBusId = "PCI:1:0:0";
};
powerManagement = {
# This is unreliable on the 4060; works a few times, then hangs:
# enable = true;
# finegrained = true
};
};
};
}
+76
View File
@@ -0,0 +1,76 @@
{ config,
pkgs,
lib,
...
}:
let
inherit (lib) mkDefault mkIf mkMerge version versionOlder;
in {
imports = [
../../../common/cpu/amd
# Better power-savings from AMD PState:
../../../common/cpu/amd/pstate.nix
../../../common/gpu/amd
../../../common/pc/laptop
../../../common/pc/laptop/acpi_call.nix
../../../common/pc/ssd
];
config = mkMerge [
{
# Configure basic system settings:
boot = {
kernelModules = [ "kvm-amd" ];
kernelParams = [
"mem_sleep_default=deep"
"pcie_aspm.policy=powersupersave"
];
};
services = {
asusd = {
enable = mkDefault true;
enableUserService = mkDefault true;
};
supergfxd.enable = true;
udev = {
extraHwdb = ''
# Fixes mic mute button
evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:*
KEYBOARD_KEY_ff31007c=f20
'';
extraRules = ''
# Disable auto-suspend for the ASUS N-KEY Device, i.e. USB Keyboard
# Otherwise, it will tend to take 1-2 key-presses to wake-up after suspending
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend", ATTR{idVendor}=="0b05", ATTR{idProduct}=="19b6", ATTR{power/autosuspend}="-1"
'';
};
};
}
(mkIf (versionOlder version "23.11") {
# See https://asus-linux.org/wiki/nixos/ for info about some problems
# detecting the dGPU:
systemd.services.supergfxd.path = [ pkgs.pciutils ];
})
(mkIf (config.networking.wireless.iwd.enable && config.networking.wireless.scanOnLowSignal) {
# Meditek doesn't seem to be quite sensitive enough on the default roaming settings:
# https://wiki.archlinux.org/title/Wpa_supplicant#Roaming
# https://wiki.archlinux.org/title/Iwd#iwd_keeps_roaming
#
# But NixOS doesn't have the tweaks for IWD, yet.
networking.wireless.iwd.settings = {
General = {
RoamThreshold = -75;
RoamThreshold5G = -80;
RoamRetryInterval = 20;
};
};
})
];
}
+2 -3
View File
@@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs, config, ... }:
{
# Sets the kernel version to the latest kernel to make the usage of the iGPU possible if your kernel version is too old
@@ -10,10 +10,9 @@
boot = lib.mkMerge [
(lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") {
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = ["amdgpu.sg_display=0"];
})
(lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.2") {
(lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") {
kernelParams = ["amdgpu.sg_display=0"];
})
];
+7
View File
@@ -0,0 +1,7 @@
{
imports = [ ../. ];
boot.kernelParams = [
"i915.enable_guc=2"
];
}
+1 -1
View File
@@ -5,5 +5,5 @@
"ath3k"
];
services.xserver.libinput.enable = lib.mkDefault true;
services.xserver.libinput.enable = lib.mkDefault config.services.xserver.enable;
}
+1
View File
@@ -2,6 +2,7 @@
{
imports = [
../../../common/cpu/intel
../../../common/gpu/intel
../../../common/pc/laptop
../../../common/pc/ssd
];
+4
View File
@@ -29,5 +29,9 @@
# https://bbs.archlinux.org/viewtopic.php?id=266108 says linux >= 5.12 required
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") pkgs.linuxPackages_latest;
# sometimes boots to a black screen, and pressing alt+sysrq+k makes the
# display manager start
# fixed by early kernel modesetting
boot.initrd.kernelModules = [ "amdgpu" ];
}
+9
View File
@@ -0,0 +1,9 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/intel
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
}
+30
View File
@@ -0,0 +1,30 @@
= Dell XPS 15 9570 =
== Tested Hardware ==
* CPU: Intel(R) Core(TM) i7-8750H CPU @ 4.10GHz
* RAM: 32 GB
* HDD: 512 GiB SSD
* Screen: 15.6" FHD(1920x1080) non-touchscreen
* Graphics: NVIDIA Corporation GTX1050 Ti Mobile 4GB GDDR5, with Intel Graphics too.
* Input: trackpad, bluetooth mouse and keyboard
== Firmware Configuration ==
Not much tweaking of NixOS itself was needed. But we currently cannot automate the firmware setup, so this must be done by hand.
== Installation ==
=== Before installation ===
These settings are needed both for booting the final install, and installer itself. Therefore, they must be done first.
* ''Disable Secure Boot (but keep UEFI Boot).'' Thankfully doing so is as easy as changing any other simple setting.
* ''Disable Intel hardware RAID and use AHCI instead.'' Intel doesn't seem to provide a working linux driver for this. (If you just have SSD it's pointless and just slows things down needlessly anyways.)
=== After installation ===
* ''Add systemd-boot to UEFI boot list.'' The (uneditable anyways) settings mapping drive UUIDs to HD* work fine.
+12
View File
@@ -0,0 +1,12 @@
{ lib, ... }:
{
imports = [
../../../common/cpu/intel
../../../common/cpu/intel/kaby-lake
../../../common/pc/laptop
./xps-common.nix
];
# Includes the Wi-Fi and Bluetooth firmware
hardware.enableRedistributableFirmware = lib.mkDefault true;
}
+8
View File
@@ -0,0 +1,8 @@
{
imports = [
../../../../common/cpu/intel
../../../../common/pc/laptop
../../../../common/gpu/nvidia/disable.nix
../xps-common.nix
];
}
+22
View File
@@ -0,0 +1,22 @@
{ ... }:
{
imports = [
../../../../common/cpu/intel
../../../../common/gpu/nvidia/prime.nix
../../../../common/pc/laptop
../xps-common.nix
];
# This runs only nvidia, great for games or heavy use of render applications
##### disable intel, run nvidia only and as default
hardware.nvidia.prime = {
# Bus ID of the Intel GPU.
intelBusId = "PCI:0:2:0";
# Bus ID of the NVIDIA GPU.
nvidiaBusId = "PCI:1:0:0";
};
}
+10
View File
@@ -0,0 +1,10 @@
{ lib, ... }:
{
# Solution to rcu_sched freezing
boot.kernelParams = [ "acpi_rev_override" ];
boot.kernelModules = [ "kvm-intel" ];
# This will save you money and possibly your life!
services.thermald.enable = lib.mkDefault true;
}
+18 -2
View File
@@ -17,10 +17,12 @@
asus-battery = import ./asus/battery.nix;
asus-ally-rc71l = import ./asus/ally/rc71l;
asus-fx504gd = import ./asus/fx504gd;
asus-fa507rm = import ./asus/fa507rm;
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
asus-zephyrus-ga401 = import ./asus/zephyrus/ga401;
asus-zephyrus-ga402 = import ./asus/zephyrus/ga402;
asus-zephyrus-ga402x = import ./asus/zephyrus/ga402x;
asus-zephyrus-ga502 = import ./asus/zephyrus/ga502;
asus-zephyrus-ga503 = import ./asus/zephyrus/ga503;
asus-zephyrus-gu603h = import ./asus/zephyrus/gu603h;
@@ -35,6 +37,7 @@
dell-latitude-3340 = import ./dell/latitude/3340;
dell-latitude-3480 = import ./dell/latitude/3480;
dell-latitude-5520 = import ./dell/latitude/5520;
dell-latitude-7280 = import ./dell/latitude/7280;
dell-latitude-7390 = import ./dell/latitude/7390;
dell-latitude-7430 = import ./dell/latitude/7430;
dell-latitude-7490 = import ./dell/latitude/7490;
@@ -63,6 +66,8 @@
dell-xps-15-9560 = import ./dell/xps/15-9560;
dell-xps-15-9560-intel = import ./dell/xps/15-9560/intel;
dell-xps-15-9560-nvidia = import ./dell/xps/15-9560/nvidia;
dell-xps-15-9570-intel = import ./dell/xps/15-9570/intel;
dell-xps-15-9570-nvidia = import ./dell/xps/15-9570/nvidia;
dell-xps-17-9700-intel = import ./dell/xps/17-9700/intel;
dell-xps-17-9700-nvidia = import ./dell/xps/17-9700/nvidia;
dell-xps-17-9710-intel = import ./dell/xps/17-9710/intel;
@@ -98,6 +103,7 @@
lenovo-legion-16achg6-hybrid = import ./lenovo/legion/16achg6/hybrid;
lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia;
lenovo-legion-16aph8 = import ./lenovo/legion/16aph8;
lenovo-legion-16arha7 = import ./lenovo/legion/16arha7;
lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6;
lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h;
lenovo-legion-y530-15ich = import ./lenovo/legion/15ich;
@@ -139,6 +145,7 @@
lenovo-thinkpad-t490 = import ./lenovo/thinkpad/t490;
lenovo-thinkpad-t495 = import ./lenovo/thinkpad/t495;
lenovo-thinkpad-t520 = import ./lenovo/thinkpad/t520;
lenovo-thinkpad-w520 = import ./lenovo/thinkpad/w520;
lenovo-thinkpad-t550 = import ./lenovo/thinkpad/t550;
lenovo-thinkpad-t590 = import ./lenovo/thinkpad/t590;
lenovo-thinkpad-x1 = import ./lenovo/thinkpad/x1;
@@ -154,7 +161,8 @@
lenovo-thinkpad-x1-extreme-gen4 = import ./lenovo/thinkpad/x1-extreme/gen4;
lenovo-thinkpad-x1-nano = import ./lenovo/thinkpad/x1-nano;
lenovo-thinkpad-x1-nano-gen1 = import ./lenovo/thinkpad/x1-nano/gen1;
lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13;
lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13/intel;
lenovo-thinkpad-x13-amd = import ./lenovo/thinkpad/x13/amd;
lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13/yoga;
lenovo-thinkpad-x13-yoga-3th-gen = import ./lenovo/thinkpad/x13/yoga/3th-gen;
lenovo-thinkpad-x140e = import ./lenovo/thinkpad/x140e;
@@ -169,6 +177,7 @@
lenovo-thinkpad-z = import ./lenovo/thinkpad/z;
lenovo-thinkpad-z13 = import ./lenovo/thinkpad/z/z13;
lenovo-yoga-6-13ALC6 = import ./lenovo/yoga/6/13ALC6;
lenovo-yoga-7-14ARH7 = import ./lenovo/yoga/7/14ARH7;
lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8;
letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4;
microchip-icicle-kit = import ./microchip/icicle-kit;
@@ -177,22 +186,28 @@
microsoft-surface-laptop-amd = import ./microsoft/surface/surface-laptop-amd;
microsoft-surface-common = import ./microsoft/surface/common;
microsoft-surface-pro-3 = import ./microsoft/surface-pro/3;
milkv-pioneer = import ./milkv/pioneer;
morefine-m600 = import ./morefine/m600;
msi-b350-tomahawk = import ./msi/b350-tomahawk;
msi-b550-a-pro = import ./msi/b550-a-pro;
msi-gs60 = import ./msi/gs60;
msi-gl62 = import ./msi/gl62;
nxp-imx8mp-evk = import ./nxp/imx8mp-evk;
nxp-imx8mq-evk = import ./nxp/imx8mq-evk;
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
omen-15-en0010ca = import ./omen/15-en0010ca;
omen-16-n0005ne = import ./omen/16-n0005ne;
omen-15-en1007sa = import ./omen/15-en1007sa;
omen-en00015p = import ./omen/en00015p;
omen-15-en0002np = import ./omen/15-en0002np;
onenetbook-4 = import ./onenetbook/4;
olimex-teres_i = import ./olimex/teres_i;
pcengines-apu = import ./pcengines/apu;
pine64-pinebook-pro = import ./pine64/pinebook-pro;
pine64-rockpro64 = import ./pine64/rockpro64;
pine64-star64 = import ./pine64/star64;
protectli-vp4670 = import ./protectli/vp4670;
purism-librem-13v3 = import ./purism/librem/13v3;
purism-librem-15v3 = import ./purism/librem/15v3;
purism-librem-5r4 = import ./purism/librem/5r4;
@@ -218,6 +233,7 @@
common-cpu-amd-pstate = import ./common/cpu/amd/pstate.nix;
common-cpu-amd-raphael-igpu = import ./common/cpu/amd/raphael/igpu.nix;
common-cpu-intel = import ./common/cpu/intel;
common-cpu-intel-comet-lake = import ./common/cpu/intel/comet-lake;
common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix;
common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake;
common-cpu-intel-sandy-bridge = import ./common/cpu/intel/sandy-bridge;
+1 -5
View File
@@ -7,6 +7,7 @@ in
imports = [
../common
../common/amd.nix
../../../common/cpu/amd/raphael/igpu.nix
];
options = {
@@ -24,11 +25,6 @@ in
};
config = {
# Newer kernel is better for amdgpu driver updates
# Requires at least 5.16 for working wi-fi and bluetooth (RZ616, kmod mt7922):
# https://wireless.wiki.kernel.org/en/users/drivers/mediatek
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") (lib.mkDefault pkgs.linuxPackages_latest);
# Workaround applied upstream in Linux >=6.7 (on BIOS 03.03)
# https://github.com/torvalds/linux/commit/a55bdad5dfd1efd4ed9ffe518897a21ca8e4e193
services.udev.extraRules = lib.mkIf (lib.versionOlder pkgs.linux.version "6.7" && cfg.preventWakeOnAC) ''
+47
View File
@@ -0,0 +1,47 @@
# B550 suspend bug
Gigabyte B550-family motherboards have a hard to diagnose (At least, from the system log events) suspend bug.
As of the F18 bios for the b550m-d3sh (My machine), released in 2024-02-27, this is still unfixed by the manufacurer and has been for over 4 years.
Symptoms:
- Suspend PC
- It goes into suspend, then seems to boot and hang. Sometimes it suspends successfully, but waking it from suspend puts it in the "zombie" state.
- By playing chicken with volatile storage and flicking the power switch on the back of power supply, you can sometimes get it to wake from suspend as the card un-powers before volatile storage does.
Fix: disable GPP0 and GPP8 (And, for some cards, potentially PTXH, I can't test) in /proc/acpi/wakeup
- To do this permanently, a systemd service is provided
## This affects at least:
- Gigabyte b550m-d3sh (my machine)
- Gigabyte B550i AORUS Pro Ax https://www.reddit.com/r/gigabyte/comments/p5ewjn/b550i_pro_ax_f13_bios_sleep_issue_on_linux/
- Gigabyte B550 Vision D https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/hb32elw/
- Gigabyte B550 Aorus Pro https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ijsx8ia/
- Gigabyte B550 Aorus Pro AC https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/j6cbnwq/
- Gigabyte B550 Aorus Pro v2 https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/imx7sz0/
- B550 Aorus Pro may need GPP0 and PTXH instead of GPP8, I don't have hardware to test
- Gigabyte B550 Aurus Elite v2 https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/k2psbgu/
- Gigabyte B550m pro https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/huocd81/
- Gigabyte B550m Aorus Elite https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/hzngaa7/
- Gigabyte B550 Gaming X v2 https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/hvojl44/
- Gigabyte B550 Aorus Master v1.0 https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/j1alpxk/
### Anecdotes of other boards:
- Gigabyte A520M https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/i57jpjw/
## Shoutouts:
- thanks to [/u/dustythermals's reddit comment](https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/hb32elw/) for the systemd service blueprint
- thanks to help from [@ToxicFrog](https://github.com/ToxicFrog) for advice on making it not toggle when `nixos-rebuild switch` is ran
- thanks to [/u/Demotay's reddit comment](https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ksbm0mb/) for how to make it check and only fire if these are enabled
- Huge thanks to /u/theHugePotato who found the [root cause](https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/h9plj88/) and put it where everyone could find
## Breadcrumbs:
https://www.reddit.com/r/gigabyte/comments/p5ewjn/b550i_pro_ax_f13_bios_sleep_issue_on_linux/
https://www.reddit.com/r/archlinux/comments/11urtla/systemctl_suspend_hibernate_and_hybridsleep_all/
https://forum.manjaro.org/t/system-do-not-wake-up-after-suspend/76681/2
+35
View File
@@ -0,0 +1,35 @@
{ pkgs, lib, ... } :
{
systemd.services.bugfixSuspend-GPP0 = {
enable = lib.mkDefault true;
description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)";
unitConfig = {
Type = "oneshot";
};
serviceConfig = {
User = "root"; # root may not be necessary
# check for gppN, disable if enabled
# lifted from https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ksbm0mb/ /u/Demotay
ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP0' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP0' > /proc/acpi/wakeup; fi'";
RemainAfterExit = "yes"; # required to not toggle when `nixos-rebuild switch` is ran
};
wantedBy = ["multi-user.target"];
};
systemd.services.bugfixSuspend-GPP8 = {
enable = lib.mkDefault true;
description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)";
unitConfig = {
Type = "oneshot";
};
serviceConfig = {
User = "root";
ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP8' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP8' > /proc/acpi/wakeup; fi''";
RemainAfterExit = "yes";
};
wantedBy = ["multi-user.target"];
};
}
+5
View File
@@ -0,0 +1,5 @@
{
imports = [
./b550-fix-suspend.nix
];
}
+7
View File
@@ -0,0 +1,7 @@
# GPD Win Max 2 2023
## Gyro
The IMU (Bosch BMI260) is incorrectly identified in the BIOS. It's named BMI0160:00 in ACPI table.
The IMU is on `/dev/i2c-2`, address `0x69`. It's `CHIP_ID` in reg `0x00` is `0x27`, which could determine that it is actually BMI0260: https://chromium.googlesource.com/chromiumos/platform/ec/+/master/driver/accelgyro_bmi260.h#28
+33
View File
@@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
with lib;
let
bmi260 = config.boot.kernelPackages.callPackage ./package.nix { };
in
{
meta.maintainers = [ maintainers.Cryolitia ];
###### interface
options = {
hardware.sensor.iio.bmi260.enable = mkOption {
default = false;
type = types.bool;
description = mdDoc ''
Enable Bosch BMI260 IMU kernel module driver.
'';
};
};
###### implementation
config = mkIf config.hardware.sensor.iio.bmi260.enable {
boot.extraModulePackages = [ bmi260 ];
boot.kernelModules = [ "bmi260_core" "bmi260_i2c" ];
};
}
+42
View File
@@ -0,0 +1,42 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchurl
, kernel
}:
stdenv.mkDerivation (finalAttr: {
pname = "bmi260";
version = "0.0.2";
src = fetchFromGitHub {
owner = "hhd-dev";
repo = finalAttr.pname;
rev = "v${finalAttr.version}";
hash = "sha256-J0npD75QqOGY1QUoznBjQ+jX28gq5u6b0JZOseclwE8=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = [
"KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installPhase = ''
runHook preInstall
install *.ko -Dm444 -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/bmi260
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/hhd-dev/bmi260";
description = "A kernel module driver for the Bosch BMI260 IMU";
license = with licenses; [ bsd3 gpl2Only ];
maintainers = with maintainers; [ Cryolitia ];
platforms = platforms.linux;
};
})
+6 -4
View File
@@ -6,10 +6,12 @@ with lib;
../../../common/cpu/amd
../../../common/cpu/amd/pstate.nix
../../../common/gpu/amd
./bmi260
];
# fix suspend problem: https://www.reddit.com/r/gpdwin/comments/16veksm/win_max_2_2023_linux_experience_suspend_problems/
services.udev.extraRules = ''
ACTION=="add" SUBSYSTEM=="pci" ATTR{vendor}=="0x1022" ATTR{device}=="0x14ee" ATTR{power/wakeup}="disabled"
'';
hardware.sensor.iio.bmi260.enable = lib.mkDefault true;
#see README
boot.blacklistedKernelModules = mkIf config.hardware.sensor.iio.bmi260.enable [ "bmi160_spi" "bmi160_i2c" "bmi160_core" ];
hardware.sensor.iio.enable = mkIf config.hardware.sensor.iio.bmi260.enable true;
}
+30
View File
@@ -0,0 +1,30 @@
## Introduction
Due to the introduction of DDG feature, you may toggle DDG frequently, so for the default settings of this laptop, we use "specialization" feature of Nix so that you can easily select the required graphics card driver in the startup menu.
**But It will slow down NixOS evaluation by factor 2 and increase memory usage.**
So if you don't need specialization feature, you can just use hybrid only configuration or nvidia only (DDG only) configuration
## Using multiple drives with this configuration
When using more than one drive, the value of `hardware.nvidia.prime.amdgpuBusId` will change from the default of `PCI:5:0:0`.
Make sure you override this default in your personal configuration. For two drives, it should be `PCI:6:0:0`.
## Setup at the time of testing
```
$ nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 6.0.9, NixOS, 22.11 (Raccoon), 22.11beta19.c9538a9b707`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.11.0`
- channels(root): `"nixos-22.11"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
```
```
$ lspci
...
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
...
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c5)
...
```
+11
View File
@@ -0,0 +1,11 @@
{ ... }:
{
imports = [ ./hybrid ];
specialisation.ddg.configuration = {
# This specialisation is for the case where "DDG" (Dual-Direct GFX, A hardware feature that can enable in bios) is enabled, since the amd igpu is blocked at hardware level and the built-in display is directly connected to the dgpu, we no longer need the amdgpu and prime configuration.
system.nixos.tags = [ "Dual-Direct-GFX-Mode" ];
imports = [ ./nvidia ];
};
}
+35
View File
@@ -0,0 +1,35 @@
{ lib, ... }:
{
imports = [
../../../../common/cpu/amd
../../../../common/cpu/amd/pstate.nix
../../../../common/gpu/amd
../../../../common/gpu/nvidia/prime.nix
../../../../common/pc/laptop
../../../../common/pc/laptop/ssd
];
# Still needs to load at some point if we want X11 to work
boot.kernelModules = [ "amdgpu" ];
# modesetting just doesn't work (on X11?), so get rid of it by only explicitly declaring nvidia
# Needed due to https://github.com/NixOS/nixos-hardware/commit/630a8e3e4eea61d35524699f2f59dbc64886357d
# See also https://github.com/NixOS/nixos-hardware/issues/628
# options.services.xserver.drivers will have a amdgpu entry from using the prime stuff in nixpkgs
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
amdgpu.loadInInitrd = lib.mkDefault false;
nvidia = {
modesetting.enable = lib.mkDefault true;
powerManagement.enable = lib.mkDefault true;
prime = {
amdgpuBusId = lib.mkDefault "PCI:6:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};
}
+26
View File
@@ -0,0 +1,26 @@
{ ... }:
{
imports = [ ../hybrid ];
services.xserver.videoDrivers = [ "nvidia" ]; # This will override services.xserver.videoDrivers = lib.mkDefault [ "amdgpu" "nvidia" ];
# When I play the game through proton, I found that in the case of Dual-Direct GFX
# enabled (dGPU disabled), proton will crash directly. But in the case of hybrid,
# the game runs fine with or without nvidia-offload After investigation, this is
# because when writing the specialization of Dual-Direct GFX, I did not completely
# remove all packages for amd igpu. I only removed amdgpu from
# services.xserver.videoDrivers by overriding. This is because the specialization
# of nix cannot implement such an operation as canceling an import. In the end, if
# it is enabled in Dual-Direct GFX In the absence of amd igpu, the amdvlk package
# caused the proton to crash. In order to solve this problem, I add the option of
# whether to enable amdvlk to the configuration file of amd gpu, and open it by
# default, and turn it off in specialization, so as to delete amdvlk package and
# other packages for amd igpu in specialization. At the same time, I also added an
# option to amdgpu's opencl runtime.
hardware = {
nvidia.prime.offload.enable = false;
amdgpu = {
amdvlk = false;
opencl = false;
};
};
}
+6
View File
@@ -3,6 +3,12 @@ Due to the introduction of DDG feature, you may toggle DDG frequently, so for th
**But It will slow down NixOS evaluation by factor 2 and increase memory usage.**
So if you don't need specialization feature, you can just use hybrid only configuration or nvidia only (DDG only) configuration
## Using multiple drives with this configuration
When using more than one drive, the value of `hardware.nvidia.prime.amdgpuBusId` will change from the default of `PCI:5:0:0`.
Make sure you override this default in your personal configuration. For two drives, it should be `PCI:6:0:0`.
## Setup at the time of testing
```
$ nix-info -m
+2 -9
View File
@@ -6,13 +6,6 @@
specialisation.ddg.configuration = {
# This specialisation is for the case where "DDG" (Dual-Direct GFX, A hardware feature that can enable in bios) is enabled, since the amd igpu is blocked at hardware level and the built-in display is directly connected to the dgpu, we no longer need the amdgpu and prime configuration.
system.nixos.tags = [ "Dual-Direct-GFX-Mode" ];
services.xserver.videoDrivers = [ "nvidia" ]; # This will override services.xserver.videoDrivers = lib.mkDefault [ "amdgpu" "nvidia" ];
hardware = {
nvidia.prime.offload.enable = false;
amdgpu = {
amdvlk = false;
opencl = false;
};
};
imports = [ ./nvidia ];
};
}
}
+8 -4
View File
@@ -1,4 +1,4 @@
{ pkgs, ...}:
{ pkgs, ... }:
let
# This file was obtained from the display while "DDG" mode was enabled.
@@ -10,6 +10,10 @@ in
{
hardware.firmware = [ chip_edid ];
boot.kernelParams = [ "drm.edid_firmware=edid/16ach6h.bin" ];
boot.initrd.extraFiles."lib/firmware/edid/16ach6h.bin".source = pkgs.runCommandLocal "chip_edid" { } "cp ${./16ach6h.bin} $out";
}
# For some reason, the internal display is sometimes eDP-1, and sometimes it's eDP-2
boot.kernelParams = [ "drm.edid_firmware=eDP-1:edid/16ach6h.bin,eDP-2:edid/16ach6h.bin" ];
# This fails at the moment, https://github.com/NixOS/nixos-hardware/issues/795
# Extra refresh rates seem to work regardless
# boot.initrd.extraFiles."lib/firmware/edid/16ach6h.bin".source = pkgs.runCommandLocal "chip_edid" { } "cp ${./16ach6h.bin} $out";
}
+11 -2
View File
@@ -11,6 +11,15 @@
../edid
];
# Still needs to load at some point if we want X11 to work
boot.kernelModules = [ "amdgpu" ];
# modesetting just doesn't work (on X11?), so get rid of it by only explicitly declaring nvidia
# Needed due to https://github.com/NixOS/nixos-hardware/commit/630a8e3e4eea61d35524699f2f59dbc64886357d
# See also https://github.com/NixOS/nixos-hardware/issues/628
# options.services.xserver.drivers will have a amdgpu entry from using the prime stuff in nixpkgs
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
amdgpu.loadInInitrd = lib.mkDefault false;
@@ -19,9 +28,9 @@
powerManagement.enable = lib.mkDefault true;
prime = {
amdgpuBusId = "PCI:6:0:0";
amdgpuBusId = lib.mkDefault "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};
}
}
+15
View File
@@ -0,0 +1,15 @@
## Introduction
This configuration includes a fix to get audio playing over the speakers, however, the volume is low. If you know of a workaround or fix, please contribute it to the repo!!
## Setup at the time of testing
```
$ nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 6.8.2-zen2, NixOS, 24.05 (Uakari), 24.05.20240403.fd281bd`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.18.2`
- channels(root): `""`
- nixpkgs: `/home/aires/.nix-defexpr/channels/nixpkgs`
```
@@ -0,0 +1,38 @@
# Patch sourced from https://github.com/christian-bendiksen/kernel-6.8.0-63.16ARHA7.fc40
{ pkgs, lib, kernel ? pkgs.linuxPackages_latest.kernel }:
pkgs.stdenv.mkDerivation {
pname = "lenovo-16ARHA7-speaker-fix-module";
inherit (kernel) src version postPatch nativeBuildInputs;
kernel_dev = kernel.dev;
kernelVersion = kernel.modDirVersion;
modulePath = "sound/pci/hda/";
buildPhase = ''
BUILT_KERNEL=$kernel_dev/lib/modules/$kernelVersion/build
cp $BUILT_KERNEL/Module.symvers .
cp $BUILT_KERNEL/.config .
cp $kernel_dev/vmlinux .
make "-j$NIX_BUILD_CORES" modules_prepare
make "-j$NIX_BUILD_CORES" M=$modulePath modules
'';
installPhase = ''
make \
INSTALL_MOD_PATH="$out" \
XZ="xz -T$NIX_BUILD_CORES" \
M="$modulePath" \
modules_install
'';
patches = [ ./lenovo_16ARHA7_sound_fix.patch ];
meta = {
description = "Patch to get the speakers working for Lenovo Legion Slim 7 Gen 7 AMD (16ARHA7)";
license = lib.licenses.gpl3;
};
}
@@ -0,0 +1,33 @@
diff -rupN linux-6.8-9791-ge5eb28f6d1af/sound/pci/hda/cs35l41_hda_property.c linux-6.8-9791-ge5eb28f6d1af-patched/sound/pci/hda/cs35l41_hda_property.c
--- linux-6.8-9791-ge5eb28f6d1af/sound/pci/hda/cs35l41_hda_property.c 2024-03-15 02:03:09.000000000 +0100
+++ linux-6.8-9791-ge5eb28f6d1af-patched/sound/pci/hda/cs35l41_hda_property.c 2024-03-17 12:23:48.183404375 +0100
@@ -115,6 +115,8 @@ static const struct cs35l41_config cs35l
{ "17AA38B5", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
{ "17AA38B6", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
{ "17AA38B7", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
+ { "17AA3877", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
+ { "17AA3878", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
{}
};
@@ -503,6 +505,8 @@ static const struct cs35l41_prop_model c
{ "CSC3551", "17AA38B5", generic_dsd_config },
{ "CSC3551", "17AA38B6", generic_dsd_config },
{ "CSC3551", "17AA38B7", generic_dsd_config },
+ { "CSC3551", "17AA3877", generic_dsd_config },
+ { "CSC3551", "17AA3878", generic_dsd_config },
{}
};
diff -rupN linux-6.8-9791-ge5eb28f6d1af/sound/pci/hda/patch_realtek.c linux-6.8-9791-ge5eb28f6d1af-patched/sound/pci/hda/patch_realtek.c
--- linux-6.8-9791-ge5eb28f6d1af/sound/pci/hda/patch_realtek.c 2024-03-15 02:03:09.000000000 +0100
+++ linux-6.8-9791-ge5eb28f6d1af-patched/sound/pci/hda/patch_realtek.c 2024-03-17 12:18:22.241570472 +0100
@@ -10263,6 +10263,8 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
+ SND_PCI_QUIRK(0x17aa, 0x3877, "Legion S7 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
+ SND_PCI_QUIRK(0x17aa, 0x3878, "Legion S7 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
+21
View File
@@ -0,0 +1,21 @@
{ config, pkgs, ... }:
let
lenovo-speaker-fix = pkgs.callPackage ./audio/lenovo-16ARHA7_speaker-fix.nix {
# Make sure the module targets the same kernel as your system is using.
inherit (config.boot.kernelPackages) kernel;
};
in
{
imports = [
../../../common/cpu/amd/pstate.nix
../../../common/gpu/amd
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];
boot.extraModulePackages = [ lenovo-speaker-fix ];
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
services.xserver.dpi = 189;
}
+8
View File
@@ -0,0 +1,8 @@
{
imports = [
../.
../tp-smapi.nix
../../../common/cpu/intel/sandy-bridge
../../../common/pc/laptop/acpi_call.nix
];
}
+17 -1
View File
@@ -1,3 +1,19 @@
{ ... }: {
{ pkgs, ... }:
{
imports = [ ../. ];
environment.systemPackages = with pkgs; [
alsa-utils
];
systemd.services.x1-fix = {
description = "Use alsa-utils to fix sound interference on Thinkpad x1 Nano";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.alsa-tools}/bin/hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0";
Restart = "on-failure";
};
wantedBy = [ "default.target" ];
};
}
@@ -0,0 +1,12 @@
# Thinkpad X13 Deprecations
## Overview
The X13 has multiple variants. Originally, the configs only supported Intel
hardware.
## How to update
If you previously imported the module under `lenovo/thinkpad/x13`, you can now
import `lenovo/thinkpad/x13/intel` instead. Users with the AMD variant should
import `lenovo/thinkpad/x13/amd`.
+6
View File
@@ -0,0 +1,6 @@
{ ... }: {
imports = [
../common.nix
../../../../common/cpu/amd
];
}
+10
View File
@@ -0,0 +1,10 @@
{ ... }: {
imports = [
../.
../../../common/pc/laptop/acpi_call.nix
../../../common/pc/laptop/ssd
];
# Somehow psmouse does not load automatically on boot for me
boot.initrd.kernelModules = [ "psmouse" ];
}
+6 -10
View File
@@ -1,12 +1,8 @@
{ ... }: {
# Reference to hardware: https://certification.ubuntu.com/hardware/202004-27844
imports = [
../.
../../../common/cpu/intel
../../../common/pc/laptop/acpi_call.nix
../../../common/pc/laptop/ssd
{
assertions = [
{
assertion = false;
message = "Importing the x13/ (default.nix) directly is deprecated! See https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/x13/OLD-BEHAVIOUR-DEPRECATED.md for more details.";
}
];
# Somehow psmouse does not load automatically on boot for me
boot.initrd.kernelModules = [ "psmouse" ];
}
+7
View File
@@ -0,0 +1,7 @@
{ ... }: {
# Reference to hardware: https://certification.ubuntu.com/hardware/202004-27844
imports = [
../common.nix
../../../../common/cpu/intel
];
}
+1 -1
View File
@@ -1,6 +1,6 @@
{ config, lib, ... }: {
imports = [
../.
../intel
../../yoga.nix
];
+23
View File
@@ -0,0 +1,23 @@
# Including this file will enable the AMD-GPU driver
{ lib, pkgs, ... }:
let
inherit (lib) mkDefault;
in {
imports = [
../shared.nix
];
# AMD RX680
services.xserver.videoDrivers = mkDefault [ "amdgpu" ];
hardware = {
amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
];
};
}
+15
View File
@@ -0,0 +1,15 @@
# When using from a Flake, you can access these via imports of the attr key, e.g:
#
# imports = [
# nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7.amdgpu
# ];
#
## or:
# imports = [
# nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7.nvidia
# ];
{
amdgpu = import ./amdgpu;
nvidia = import ./nvidia;
}
+47
View File
@@ -0,0 +1,47 @@
# Including this file will enable the NVidia driver, and PRIME offload
{ lib, pkgs, ... }:
let
inherit (lib) mkDefault;
in {
imports = [
../shared.nix
## "prime.nix" loads this, aleady:
# ../../../../common/gpu/nvidia
../../../../../common/gpu/nvidia/prime.nix
];
# NVIDIA GeForce RTX 3050 Mobile (Ampere)
services.xserver.videoDrivers = mkDefault [ "nvidia" ];
hardware = {
## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
];
nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:4:0:0";
nvidiaBusId = "PCI:1:0:0";
};
powerManagement = {
enable = true;
# Doesn't seem to be reliable, yet?
# finegrained = true
};
};
};
}
+32
View File
@@ -0,0 +1,32 @@
{ ... }:
{
imports = [
../../../../common/cpu/amd
# Better power-savings from AMD PState:
../../../../common/cpu/amd/pstate.nix
../../../../common/gpu/amd
../../../../common/pc/laptop
../../../../common/pc/laptop/acpi_call.nix
../../../../common/pc/ssd
];
# Configure basic system settings:
boot = {
kernelModules = [ "kvm-amd" ];
kernelParams = [
"mem_sleep_default=deep"
"pcie_aspm.policy=powersupersave"
## Supposed to help fix for suspend issues: SSD not correctly working, and Keyboard not responding:
## Not needed for the 6.1+ kernels?
# "iommu=pt"
## Fixes for s2idle:
## https://www.phoronix.com/news/More-s2idle-Rembrandt-Linux
"acpi.prefer_microsoft_dsm_guid=1"
];
blacklistedKernelModules = [ "nouveau" ];
};
}
+1 -1
View File
@@ -9,7 +9,7 @@ Currently this overlay is used for generating bootable NixOS SD images.
Code snippet example that enables icicle-kit configuration:
```
{ nixos-hardware, }: {
system = "aarch64-linux";
system = "riscv64-linux";
modules = [
nixos-hardware.nixosModules.icicle-kit
];
@@ -1,37 +1,29 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption types;
inherit (pkgs) fetchurl;
inherit (lib) mkIf mkOption;
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage repos;
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfEnum;
cfg = config.microsoft-surface;
version = "6.6.10";
majorVersion = "6.6";
patchDir = repos.linux-surface + "/patches/${majorVersion}";
kernelPatches = pkgs.callPackage ./patches.nix {
inherit (lib) kernel;
inherit version patchDir;
version = "6.6.25";
kernelPatches = surfacePatches {
inherit version;
patchFn = ./patches.nix;
};
kernelPackages = linuxPackage {
inherit version kernelPatches;
extraMeta.branch = majorVersion;
src = fetchurl {
url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz";
sha256 = "sha256-nuYn5MEJrsf8o+2liY6B0gGvLH6y99nX2UwfDhIFVGw=";
};
sha256 = "0i0zvqlj02rm6wpbidji0rn9559vrpfc1b8gbfjk70lhhyz11llr";
ignoreConfigErrors=true;
};
in {
options.microsoft-surface.kernelVersion = mkOption {
type = types.enum [ version majorVersion ];
type = versionsOfEnum version;
};
config = mkIf (cfg.kernelVersion == version || cfg.kernelVersion == majorVersion) {
config = mkIf (isVersionOf cfg.kernelVersion version) {
boot = {
inherit kernelPackages;
};
@@ -1,5 +1,6 @@
{ kernel,
patchDir,
{ lib,
kernel ? lib.kernel,
patchSrc,
version,
}:
@@ -7,14 +8,14 @@
{
name = "microsoft-surface-patches-linux-${version}";
patch = null;
structuredExtraConfig = with kernel; {
STREAMING_MEDIA = yes;
extraStructuredConfig = with kernel; {
STAGING_MEDIA = yes;
#
# Surface Aggregator Module
#
SURFACE_AGGREGATOR = module;
SURFACE_AGGREGATOR_ERROR_INJECTION = no;
# SURFACE_AGGREGATOR_ERROR_INJECTION is not set
SURFACE_AGGREGATOR_BUS = yes;
SURFACE_AGGREGATOR_CDEV = module;
SURFACE_AGGREGATOR_HUB = module;
@@ -31,27 +32,23 @@
BATTERY_SURFACE = module;
CHARGER_SURFACE = module;
#
# Surface Hotplug
#
##
## Surface Hotplug
##
SURFACE_HOTPLUG = module;
#
# Intel Touch Host Controller
#
##
## IPTS and ITHC touchscreen
##
## This only enables the user interface for IPTS/ITHC data.
## For the touchscreen to work, you need to install iptsd.
##
HID_IPTS = module;
HID_ITHC = module;
#
# IPTS touchscreen
#
# This only enables the user interface for IPTS data.
# For the touchscreen to work, you need to install iptsd.
#
MISC_IPTS = module;
#
# Cameras: IPU3
#
##
## Cameras: IPU3
##
VIDEO_DW9719 = module;
VIDEO_IPU3_IMGU = module;
VIDEO_IPU3_CIO2 = module;
@@ -59,23 +56,28 @@
INTEL_SKL_INT3472 = module;
REGULATOR_TPS68470 = module;
COMMON_CLK_TPS68470 = module;
COMMON_LEDS_TPS68470 = module;
LEDS_TPS68470 = module;
#
# Cameras: Sensor drivers
#
##
## Cameras: Sensor drivers
##
VIDEO_OV5693 = module;
VIDEO_OV7251 = module;
VIDEO_OV8865 = module;
#
# ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
#
##
## Surface 3: atomisp causes problems (see issue #1095). Disable it for now.
##
# INTEL_ATOMISP is not set
##
## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
##
APDS9960 = module;
#
# Other Drivers
#
##
## Other Drivers
##
INPUT_SOC_BUTTON_ARRAY = module;
SURFACE_3_POWER_OPREGION = module;
SURFACE_PRO3_BUTTON = module;
@@ -85,58 +87,58 @@
}
{
name = "ms-surface/0001-surface3-oemb";
patch = patchDir + "/0001-surface3-oemb.patch";
patch = patchSrc + "/0001-surface3-oemb.patch";
}
{
name = "ms-surface/0002-mwifiex";
patch = patchDir + "/0002-mwifiex.patch";
patch = patchSrc + "/0002-mwifiex.patch";
}
{
name = "ms-surface/0003-ath10k";
patch = patchDir + "/0003-ath10k.patch";
patch = patchSrc + "/0003-ath10k.patch";
}
{
name = "ms-surface/0004-ipts";
patch = patchDir + "/0004-ipts.patch";
patch = patchSrc + "/0004-ipts.patch";
}
{
name = "ms-surface/0005-ithc";
patch = patchDir + "/0005-ithc.patch";
patch = patchSrc + "/0005-ithc.patch";
}
{
name = "ms-surface/0006-surface-sam";
patch = patchDir + "/0006-surface-sam.patch";
patch = patchSrc + "/0006-surface-sam.patch";
}
{
name = "ms-surface/0007-surface-sam-over-hid";
patch = patchDir + "/0007-surface-sam-over-hid.patch";
patch = patchSrc + "/0007-surface-sam-over-hid.patch";
}
{
name = "ms-surface/0008-surface-button";
patch = patchDir + "/0008-surface-button.patch";
patch = patchSrc + "/0008-surface-button.patch";
}
{
name = "ms-surface/0009-surface-typecover";
patch = patchDir + "/0009-surface-typecover.patch";
patch = patchSrc + "/0009-surface-typecover.patch";
}
{
name = "ms-surface/0010-surface-shutdown";
patch = patchDir + "/0010-surface-shutdown.patch";
patch = patchSrc + "/0010-surface-shutdown.patch";
}
{
name = "ms-surface/0011-surface-gpe";
patch = patchDir + "/0011-surface-gpe.patch";
patch = patchSrc + "/0011-surface-gpe.patch";
}
{
name = "ms-surface/0012-cameras";
patch = patchDir + "/0012-cameras.patch";
patch = patchSrc + "/0012-cameras.patch";
}
{
name = "ms-surface/0013-amd-gpio";
patch = patchDir + "/0013-amd-gpio.patch";
patch = patchSrc + "/0013-amd-gpio.patch";
}
{
name = "ms-surface/0014-rtc";
patch = patchDir + "/0014-rtc.patch";
patch = patchSrc + "/0014-rtc.patch";
}
]
@@ -1,22 +1,55 @@
{ lib,
{ pkgs,
lib,
fetchurl,
buildLinux,
callPackage,
linuxPackagesFor,
}:
let
inherit (lib) recurseIntoAttrs;
inherit (builtins) elem;
inherit (lib) recurseIntoAttrs types versions;
in {
repos = callPackage ../repos.nix {};
repos = pkgs.callPackage ../repos.nix {};
linuxPackage =
{ version,
modDirVersion ? version,
{ url ? "mirror://kernel/linux/kernel/v${versions.major version}.x/linux-${version}.tar.xz",
sha256 ? null,
src ? (fetchurl { inherit url sha256; }),
version,
modDirVersion ? (versions.pad 3 version),
kernelPatches ? [],
...
} @ args:
let
buildLinux' = buildLinux (args // { inherit modDirVersion; });
linuxPackagesFor' = linuxPackagesFor buildLinux';
in recurseIntoAttrs linuxPackagesFor';
} @ args: let
inherit (builtins) removeAttrs;
args' = {
inherit src version modDirVersion kernelPatches;
} // removeAttrs args [ "url" "sha256" ];
linuxPackage = buildLinux args';
linuxPackages' = recurseIntoAttrs (linuxPackagesFor linuxPackage);
in linuxPackages';
surfacePatches =
{ patchSrc ? (repos.linux-surface + "/patches/${versions.majorMinor version}"),
version,
patchFn,
}: pkgs.callPackage patchFn {
inherit (lib) kernel;
inherit version patchSrc;
};
versionsOf = version:
# Provides a list of versions that can be used as an enum option for this full version:
[ version (versions.majorMinor version) ];
versionsOfEnum = version:
# Provide an enum option for versions of this kernel:
types.enum (versionsOf version);
isVersionOf = kernelVersion: version:
# Test if the provided version is considered one of the list of versions from above:
elem version (versionsOf version);
in {
inherit linuxPackage repos surfacePatches versionsOf isVersionOf versionsOfEnum;
}
+50
View File
@@ -0,0 +1,50 @@
# Creating an installation SD card image
Create and customize a `flake.nix` file:
```nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
};
outputs = { nixpkgs, nixos-hardware, ... }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"riscv64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSupportedSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forAllSupportedSystems (system: rec {
default = sd-image;
sd-image = (import "${nixpkgs}/nixos" {
configuration = {
imports = [
"${nixos-hardware}/milkv/pioneer/sd-image-installer.nix"
];
nixpkgs.buildPlatform.system = system;
nixpkgs.hostPlatform.system = "riscv64-linux";
system.stateVersion = "24.05";
};
inherit system;
}).config.system.build.sdImage;
});
};
}
```
Then build the image by running `nix build .#` in the same folder.
# Known issues
LinuxBoot will not output the boot menu on the serial console, only on the graphical console.
Unfortuately, it might also pick up boot options from other devices, e.g. an nvme or sata drive.
It might end up booting by default from those instead of booting from the SD card.
+28
View File
@@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:
{
boot = {
consoleLogLevel = lib.mkDefault 7;
initrd = {
availableKernelModules = [
"amdgpu"
"radeon"
"mmc_block"
"sdhci_sophgo"
];
};
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./linux.nix {
inherit (config.boot) kernelPatches;
});
kernelParams = lib.mkDefault [
"earlycon"
"console=ttyS0,115200"
"console=tty1"
];
};
hardware.deviceTree = {
enable = true;
name = lib.mkDefault "sophgo/mango-milkv-pioneer.dtb";
};
}
+7
View File
@@ -0,0 +1,7 @@
{ fetchurl, ... }:
# Download the vendor's Firmware Image Package
fetchurl {
url = "https://github.com/sophgo/bootloader-riscv/raw/3f750677e0249ff549ad3fe20bbc800998503539/firmware/fip.bin";
hash = "sha256-rav00Ok6+FU77lI0piQPHCaz7Tw1RSbyUal4PyeSccg=";
}
+46
View File
@@ -0,0 +1,46 @@
{ stdenv
, writeText
, opensbi
, fip
, zsbl
, linuxboot-kernel
, linuxboot-initrd
, dtbs ? "${linuxboot-kernel}/dtbs"
, ...
}:
let
# Configure a conf.init for linuxboot. If this is not found on the sdcard,
# zsbl will load it from spi flash even when booting from sd. That conf.ini
# might be configured differently and thus not properly boot from sd.
conf-ini = writeText "conf.ini" ''
[sophgo-config]
[devicetree]
name = mango-milkv-pioneer.dtb
[kernel]
name = riscv64_Image
[firmware]
name = fw_dynamic.bin
[ramfs]
name = initrd.img
[eof]
'';
in
stdenv.mkDerivation {
name = "milkv-pioneer-firmware";
buildCommand = ''
install -D ${conf-ini} $out/riscv64/conf.ini
install -D ${fip} $out/fip.bin
install -D ${zsbl} $out/zsbl.bin
install -D ${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin $out/riscv64/
install -D ${linuxboot-initrd}/initrd.img $out/riscv64/
install -D ${dtbs}/sophgo/mango-milkv-pioneer.dtb $out/riscv64/
install -D ${linuxboot-kernel}/Image $out/riscv64/riscv64_Image
'';
}
+44
View File
@@ -0,0 +1,44 @@
{ buildLinux, fetchFromGitHub, kernelPatches, lib, ... } @ args:
let
modDirVersion = "6.6.20";
in
buildLinux (args // {
inherit kernelPatches modDirVersion;
version = "${modDirVersion}-milkv-pioneer";
src = fetchFromGitHub {
owner = "sophgo";
repo = "linux-riscv";
rev = "caa949e3690fe8a4656313b2b56f52666fa880db";
hash = "sha256-qJpR3KMgvP4tfPfBfQ/MiEWg/uuuxHYuACK8taKKK3E=";
};
defconfig = "sophgo_mango_normal_defconfig";
structuredExtraConfig = let inherit (lib.kernel) freeform module yes; in {
# LinuxBoot will override the console bootparams which will result
# in the distro kernel to be booted with e.g. console=tty1 only.
# https://github.com/sophgo/bootloader-riscv/issues/71
# Force output on serial console through the config. This is also
# needed to get the forced serial-getty to be started.
# We also list tty1 again because according to
# https://docs.kernel.org/admin-guide/serial-console.html and
# https://0pointer.de/blog/projects/serial-console.html
# this will be the main console.
CMDLINE = freeform "console=ttyS0,115200 console=tty1";
CMDLINE_EXTEND = yes;
# Enable these explicitly because they are not enabled by the defconfig.
# The all-hardware profile expects these to be built.
VIRTIO_MENU = yes;
VIRTIO_PCI = module;
# There is an i2c mcu driver (drivers/soc/sophgo/umcu) which is always
# compiled into the kernel. Hence some of the i2c support also needs to
# be compiled in instead of being compiled as a module.
I2C = yes;
I2C_CHARDEV = yes;
I2C_DESIGNWARE_PLATFORM = yes;
};
extraMeta.branch = "sg2042-dev-6.6";
} // (args.argsOverride or { }))
+73
View File
@@ -0,0 +1,73 @@
{ buildPackages
, fetchFromGitHub
, fetchpatch
, linux-firmware
, buildGoModule
, ...
}:
# Based on
# https://github.com/sophgo/bootloader-riscv/blob/e0839852d571df106db622611f4786ae17e8df0f/scripts/envsetup.sh#L809-L819
let
u-root = buildPackages.buildGoModule rec {
pname = "u-root";
version = "0.14.0";
src = fetchFromGitHub {
owner = "u-root";
repo = "u-root";
rev = "v${version}";
hash = "sha256-8zA3pHf45MdUcq/MA/mf0KCTxB1viHieU/oigYwIPgo=";
};
vendorHash = null;
patches = [
(fetchpatch {
url = "https://github.com/sophgo/bootloader-riscv/commit/322c3305763872a9b88a1c85d79bca63b8fbe7a6.patch";
hash = "sha256-l5r3DbcMqRYD5FhRBqtEIEscZAdDvjmQJE4BIAtWYWE=";
stripLen = 1;
})
];
postInstall = ''
cp -r . $out/src
'';
# We only build the u-root binary in the build phase and the initrd in the
# postBuild hook.
subPackages = [ "." ];
# Tests time out after 10min for native riscv64 builds on the pioneer.
doCheck = false;
};
in
buildGoModule {
name = "linuxboot-initrd";
src = null;
vendorHash = null;
dontUnpack = true;
nativeBuildInputs = [ u-root ];
buildPhase = ''
runHook preBuild
pushd ${u-root}/src
mkdir -p $out
GOROOT="$(go env GOROOT)" u-root \
-build bb \
-uinitcmd=boot \
-files "${linux-firmware}/lib/firmware/amdgpu/:lib/firmware/amdgpu/" \
-files "${linux-firmware}/lib/firmware/radeon/:lib/firmware/radeon/" \
-o $out/initramfs.cpio \
core boot
popd
# The vendor does not compress the initrd. We do since we include more
# firmware files. CRC32 is required by the kernel's decompressor.
xz --check=crc32 $out/initramfs.cpio
runHook postBuild
'';
installPhase = ''
runHook preInstall
mv $out/initramfs.cpio.xz $out/initrd.img
runHook postInstall
'';
}
+15
View File
@@ -0,0 +1,15 @@
{ fetchFromGitHub, lib, linuxManualConfig, stdenv, ... }:
linuxManualConfig rec {
inherit lib stdenv;
modDirVersion = "6.6.20";
version = "${modDirVersion}-milkv-pioneer";
src = fetchFromGitHub {
owner = "sophgo";
repo = "linux-riscv";
rev = "caa949e3690fe8a4656313b2b56f52666fa880db";
hash = "sha256-qJpR3KMgvP4tfPfBfQ/MiEWg/uuuxHYuACK8taKKK3E=";
};
configfile = "${src}/arch/riscv/configs/sophgo_mango_normal_defconfig";
extraMeta.branch = "sg2042-dev-6.6";
}
+22
View File
@@ -0,0 +1,22 @@
{ fetchFromGitHub, opensbi, ... }:
opensbi.overrideAttrs (attrs: {
# Based on the vendor's sg2042-master branch.
version = "1.4-git-a6e158f7";
src = fetchFromGitHub {
owner = "sophgo";
repo = "opensbi";
rev = "a6e158f71aab17155e2bf25a325ce4f0be51d9dd";
hash = "sha256-5ggrEx1e53pB2+m0TBjDzDJXf2wjsQ2edu01FqqGt/Y=";
};
makeFlags =
# Based on the vendor options
# https://github.com/sophgo/bootloader-riscv/blob/01dc52ce10e7cf489c93e4f24b6bfe1bf6e55919/scripts/envsetup.sh#L299
attrs.makeFlags ++ [
"PLATFORM=generic"
"FW_PIC=y"
"BUILD_INFO=y"
"DEBUG=1"
];
})
+12
View File
@@ -0,0 +1,12 @@
{ modulesPath, ... }:
{
imports = [
"${modulesPath}/profiles/installation-device.nix"
./sd-image.nix
];
# the installation media is also the installation target,
# so we don't want to provide the installation configuration.nix.
installer.cloneConfig = false;
}
+57
View File
@@ -0,0 +1,57 @@
{ config, lib, modulesPath, pkgs, ... }:
let
inherit (pkgs) callPackage;
fip = callPackage ./fip.nix { };
zsbl = callPackage ./zsbl.nix { };
opensbi = callPackage ./opensbi.nix { };
linuxboot-kernel = callPackage ./linuxboot-kernel.nix { };
linuxboot-initrd = callPackage ./linuxboot-initrd.nix { };
dtbs = config.hardware.deviceTree.package;
firmware = callPackage ./firmware.nix {
inherit fip zsbl opensbi linuxboot-kernel linuxboot-initrd dtbs;
};
in
{
imports = [
"${modulesPath}/profiles/base.nix"
"${modulesPath}/installer/sd-card/sd-image.nix"
./default.nix
];
boot.loader = {
grub.enable = lib.mkDefault false;
generic-extlinux-compatible.enable = lib.mkDefault true;
};
hardware.enableRedistributableFirmware = true;
# For some reason the serial getty is not started automatically
# even though console=ttyS0,115200 is passed to the kernel.
# https://docs.kernel.org/admin-guide/serial-console.html
# https://github.com/NixOS/nixpkgs/issues/84105
systemd.services."serial-getty@ttyS0" = {
enable = true;
wantedBy = [ "getty.target" ];
serviceConfig.Restart = "always";
};
sdImage = {
imageName = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}-milkv-pioneer.img";
populateFirmwareCommands = ''
mkdir -p firmware/
cp -a ${firmware}/* firmware/
touch firmware/BOOT
'';
firmwarePartitionOffset = 1;
firmwareSize = 128;
populateRootCommands = ''
mkdir -p ./files/boot
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
'';
};
}
+15
View File
@@ -0,0 +1,15 @@
--- a/drivers/sd/sd.c
+++ b/drivers/sd/sd.c
@@ -560,11 +560,11 @@ static int bm_sd_read(int lba, uintptr_t buf, size_t size)
} else {
udelay(1);
timeout++;
}
- if (timeout >= 10000) {
+ if (timeout >= 100000) {
printf("sdhci read data timeout\n");
goto timeout;
}
}
+51
View File
@@ -0,0 +1,51 @@
{ buildPackages
, bison
, fetchFromGitHub
, flex
, lib
, stdenv
, ...
}:
stdenv.mkDerivation rec {
pname = "zsbl-sg2042";
version = "git-cc806273";
src = fetchFromGitHub {
owner = "sophgo";
repo = "zsbl";
rev = "cc806273e0f679bef2f6b017c68adede1594ad31";
hash = "sha256-zOlBM7mwz8FUM/BlzOxJmpI8LI/KcFOGXegvgiilbaM=";
};
patches = [
# Depending on the sdcard, reading larger initrds (say >= 25MB)
# can hit the timeout.
./zsbl-increase-timeout.patch
];
nativeBuildInputs = [
bison
flex
];
depsBuildBuild = [
buildPackages.stdenv.cc
];
hardeningDisable = [
"fortify"
"stackprotector"
];
makeFlags = [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
configurePhase = "make sg2042_defconfig";
installPhase = "install -D zsbl.bin $out";
enableParallelBuilding = true;
dontStrip = true;
meta = {
homepage = "https://github.com/sophgo/zsbl";
description = "Sophgo RISC-V Zero Stage Boot Loader";
license = lib.licenses.gpl2;
};
}
+9
View File
@@ -0,0 +1,9 @@
{
imports = [
../../common/cpu/amd
../../common/pc/ssd
../../common/pc
];
boot.kernelModules = ["nct6775"];
}
+9
View File
@@ -0,0 +1,9 @@
{
imports = [
../../common/cpu/amd
../../common/pc/ssd
../../common/pc
];
boot.kernelModules = ["nct6683"];
}
+19
View File
@@ -5,6 +5,8 @@
- [i.MX8QuadXPlus Multisensory Enablement Kit](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-8quadxplus-multisensory-enablement-kit-mek:MCIMX8QXP-CPU) (**imx8qxp-mek**) - device-specific U-Boot and Linux kernel.
## 2. How to use
### 2.1 For imx8qm-mek
Currently this NXP overlay is used for generating EFI-bootable NixOS images.
I recommend to use [Tow-Boot](https://tow-boot.org/) as a bootloader, but U-Boot from this overlay can also be used.
U-Boot was tested separately from NixOS.
@@ -18,3 +20,20 @@ Code snippet example that enables imx8qm configuration:
];
}
```
### 2.2 For imx8mq-evk/imx8mp-evk
This NXP overlay is used for generating sdimage.
Current configuration uses uboot as a bootloader. It provides an options to use optee-os which is currently disabled. It can be enabled using `enable-tee` boolean argument avalable in `imx8m<q/p>-boot.nix`, which is `false` by default.
Code snippet example that enables 'imx8mp-evk/emx8mq-evk' configuration:
```
{ nixos-hardware, }: {
system = "aarch64-linux";
modules = [
nixos-hardware.nixosModules.imx8mp-evk #For imx8mp-evk
#nixos-hardware.nixosModules.imx8mq-evk #For imx8mq-evk
];
}
```
+1 -1
View File
@@ -7,7 +7,7 @@
{
armTrustedFirmwareiMX8 = buildArmTrustedFirmware rec {
src = fetchgit {
url = "https://source.codeaurora.org/external/imx/imx-atf";
url = "https://github.com/nxp-imx/imx-atf.git";
# tag: "lf_v2.6"
rev = "c6a19b1a351308cc73443283f6aa56b2eff791b8";
sha256 = "sha256-C046MrZBDFuzBdnjuPC2fAGtXzZjTWRrO8nYTf1rjeg=";
+8 -3
View File
@@ -4,15 +4,20 @@ with pkgs;
pkgs.stdenv.mkDerivation rec {
pname = "imx-mkimage";
version = "lf-5.15.32-2.0.0";
src = fetchgit {
url = "https://source.codeaurora.org/external/imx/imx-mkimage.git";
url = "https://github.com/nxp-imx/imx-mkimage.git";
rev = version;
sha256 = "sha256-31pib5DTDPVfiAAoOSzK8HWUlnuiNnfXQIsxbjneMCc=";
sha256 = "sha256-vJuWK2GOAtps798QY1I6xIcixgenJmntrh24s9KtsKU=";
leaveDotGit = true;
};
postPatch = ''
substituteInPlace Makefile \
--replace 'CC = gcc' 'CC = clang'
'';
nativeBuildInputs = [
clang
git
];
+1 -1
View File
@@ -35,7 +35,7 @@ pkgs.stdenv.mkDerivation rec {
];
src = fetchGit {
url = "https://source.codeaurora.org/external/imx/imx-optee-os.git";
url = "https://github.com/nxp-imx/imx-optee-os.git";
ref = "lf-5.15.32_2.0.0";
};
+1 -1
View File
@@ -32,7 +32,7 @@ in {
ubootImx8 = buildUBoot {
version = "2022.04";
src = fetchgit {
url = "https://source.codeaurora.org/external/imx/uboot-imx.git";
url = "https://github.com/nxp-imx/uboot-imx.git";
# tag: "lf_v2022.04"
rev = "1c881f4da83cc05bee50f352fa183263d7e2622b";
sha256 = "sha256-0TS6VH6wq6PwZUq6ekbuLaisZ9LrE0/haU9nseGdiE0=";
+34
View File
@@ -0,0 +1,34 @@
{
lib,
pkgs,
buildArmTrustedFirmware,
fetchgit,
enable-tee,
}:
with pkgs; let
opteedflag =
if enable-tee
then "SPD=opteed"
else "";
target-board = "imx8mp";
in
buildArmTrustedFirmware rec {
pname = "imx8mp-atf";
platform = target-board;
enableParallelBuilding = true;
extraMeta.platforms = ["aarch64-linux"];
src = fetchgit {
url = "https://github.com/nxp-imx/imx-atf.git";
#lf6.1.55_2.2.0
rev = "08e9d4eef2262c0dd072b4325e8919e06d349e02";
sha256 = "sha256-96EddJXlFEkP/LIGVgNBvUP4IDI3BbDE/c9Yub22gnc=";
};
extraMakeFlags = lib.concatLists [
(lib.optional (lib.versionAtLeast pkgs.binutils.version "2.39") "LDFLAGS=--no-warn-rwx-segments")
["PLAT=${platform}" "bl31" "${opteedflag}"]
];
filesToInstall = ["build/${target-board}/release/bl31.bin"];
}
+80
View File
@@ -0,0 +1,80 @@
{
pkgs,
enable-tee ? true,
}:
with pkgs; let
fw-ver = "202006";
cp-tee =
if enable-tee
then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin"
else "";
imx8mp-atf = pkgs.callPackage ./imx8mp-atf.nix {
inherit (pkgs) buildArmTrustedFirmware;
inherit enable-tee;
};
imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix {};
imx8mp-uboot = pkgs.callPackage ./imx8mp-uboot.nix {};
imx8mp-optee-os = pkgs.callPackage ./imx8mp-optee-os.nix {};
in {
imx8m-boot = pkgs.stdenv.mkDerivation rec {
name = "imx8mp-mkimage";
version = "lf-6.1.55-2.2.0";
src = pkgs.fetchgit {
url = "https://github.com/nxp-imx/imx-mkimage.git";
rev = "c4365450fb115d87f245df2864fee1604d97c06a";
sha256 = "sha256-xycEaWKVM63BlDyBKNN0OefyK6iX/fQOTvv4fRVM55U=";
leaveDotGit = true;
};
postPatch = ''
substituteInPlace Makefile \
--replace 'CC = gcc' 'CC = clang'
patchShebangs scripts
'';
nativeBuildInputs = [
clang
git
dtc
];
buildInputs = [
git
glibc.static
zlib
zlib.static
];
buildPhase = ''
runHook preBuild
make bin
make SOC=iMX8MP mkimage_imx8
cp -v ${pkgs.ubootTools}/bin/mkimage ./iMX8M/mkimage_uboot
install -m 0644 ${imx8mp-uboot}/u-boot-spl.bin ./iMX8M/u-boot-spl.bin
install -m 0644 ${imx8mp-uboot}/u-boot-nodtb.bin ./iMX8M/u-boot-nodtb.bin
install -m 0644 ${imx8mp-uboot}/imx8mp-evk.dtb ./iMX8M/imx8mp-evk.dtb
install -m 0644 ${imx8mp-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_${fw-ver}.bin ./iMX8M/lpddr4_pmu_train_1d_dmem_${fw-ver}.bin
install -m 0644 ${imx8mp-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_${fw-ver}.bin ./iMX8M/lpddr4_pmu_train_1d_imem_${fw-ver}.bin
install -m 0644 ${imx8mp-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_${fw-ver}.bin ./iMX8M/lpddr4_pmu_train_2d_dmem_${fw-ver}.bin
install -m 0644 ${imx8mp-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_${fw-ver}.bin ./iMX8M/lpddr4_pmu_train_2d_imem_${fw-ver}.bin
install -m 0644 ${imx8mp-firmware}/firmware/hdmi/cadence/signed_hdmi_imx8m.bin ./iMX8M/signed_hdmi_imx8m.bin
install -m 0644 ${imx8mp-atf}/bl31.bin ./iMX8M/bl31.bin
${cp-tee}
make SOC=iMX8MP flash_evk
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/image
install -m 0644 ./iMX8M/flash.bin $out/image
runHook postInstall
'';
};
}
+19
View File
@@ -0,0 +1,19 @@
{pkgs, ...}:
with pkgs;
stdenv.mkDerivation rec {
pname = "imx8mp-firmware";
version = "8.22";
src = pkgs.fetchurl {
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin";
sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A=";
};
dontUnpack = true;
dontStrip = true;
installPhase = ''
${pkgs.bash}/bin/bash $src --auto-accept --force
mv firmware-imx-${version} $out
'';
}
+50
View File
@@ -0,0 +1,50 @@
{pkgs, ...} @ args:
with pkgs;
buildLinux (args
// rec {
version = "6.1.55";
name = "imx8mp-linux";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = version;
defconfig = "imx_v8_defconfig";
kernelPatches = [
];
autoModules = false;
extraConfig = ''
CRYPTO_TLS m
TLS y
MD_RAID0 m
MD_RAID1 m
MD_RAID10 m
MD_RAID456 m
DM_VERITY m
LOGO y
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
FB_EFI n
EFI_STUB y
EFI y
VIRTIO y
VIRTIO_PCI y
VIRTIO_BLK y
DRM_VIRTIO_GPU y
EXT4_FS y
USBIP_CORE m
USBIP_VHCI_HCD m
USBIP_HOST m
USBIP_VUDC m
'';
src = fetchFromGitHub {
owner = "nxp-imx";
repo = "linux-imx";
# tag: lf-6.1.55-2.2.0
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
};
}
// (args.argsOverride or {}))
+66
View File
@@ -0,0 +1,66 @@
{pkgs}: let
python3 = pkgs.buildPackages.python3;
toolchain = pkgs.gcc9Stdenv.cc;
binutils = pkgs.gcc9Stdenv.cc.bintools.bintools_bin;
cpp = pkgs.gcc;
in
pkgs.stdenv.mkDerivation rec {
pname = "imx8mp-optee-os";
version = "lf-6.1.55-2.2.0";
nativeBuildInputs = [
python3
];
enableParallelBuilding = true;
propagatedBuildInputs = with python3.pkgs; [
pycryptodomex
pyelftools
cryptography
];
src = pkgs.fetchgit {
url = "https://github.com/nxp-imx/imx-optee-os.git";
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
};
postPatch = ''
substituteInPlace scripts/arm32_sysreg.py \
--replace '/usr/bin/env python3' '${python3}/bin/python'
substituteInPlace scripts/gen_tee_bin.py \
--replace '/usr/bin/env python3' '${python3}/bin/python'
substituteInPlace scripts/pem_to_pub_c.py \
--replace '/usr/bin/env python3' '${python3}/bin/python'
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
--replace '/bin/bash' '${pkgs.bash}/bin/bash'
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
'';
makeFlags = [
"PLATFORM=imx"
"PLATFORM_FLAVOR=mx8mpevk"
"CFG_ARM64_core=y"
"CFG_TEE_TA_LOG_LEVEL=0"
"CFG_TEE_CORE_LOG_LEVEL=0"
"CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}"
"CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}"
];
installPhase = ''
mkdir -p $out
cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin
'';
}
+41
View File
@@ -0,0 +1,41 @@
{pkgs}:
with pkgs; let
inherit buildUBoot;
in
(buildUBoot {
pname = "imx8mp-uboot";
version = "2023.04";
src = fetchgit {
url = "https://github.com/nxp-imx/uboot-imx.git";
# tag: "lf-6.1.55-2.2.0"
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
};
extraConfig = ''
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
CONFIG_CMD_BOOTEFI_SELFTEST=y
CONFIG_CMD_BOOTEFI=y
CONFIG_EFI_LOADER=y
CONFIG_BLK=y
CONFIG_PARTITIONS=y
CONFIG_DM_DEVICE_REMOVE=n
CONFIG_CMD_CACHE=y
'';
enableParallelBuilding = true;
defconfig = "imx8mp_evk_defconfig";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [
"./u-boot-nodtb.bin"
"./spl/u-boot-spl.bin"
"./arch/arm/dts/imx8mp-evk.dtb"
".config"
];
})
.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.perl];
})
+18
View File
@@ -0,0 +1,18 @@
{pkgs, ...}: {
nixpkgs.overlays = [
(import ./overlay.nix)
];
imports = [
./modules.nix
];
boot.loader.grub.extraFiles = {
"imx8mp-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mp-linux.nix {}}/dtbs/freescale/imx8mp-evk.dtb";
};
hardware.deviceTree = {
filter = "imx8mp-*.dtb";
name = "imx8mp-evk.dtb";
};
}
+16
View File
@@ -0,0 +1,16 @@
{
pkgs,
lib,
...
}: {
nixpkgs.hostPlatform = "aarch64-linux";
boot = {
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix {});
initrd.includeDefaultModules = lib.mkForce false;
};
disabledModules = ["profiles/all-hardware.nix"];
hardware.deviceTree.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
final: prev: {
inherit (final.callPackage ./bsp/imx8mp-boot.nix {pkgs = final;}) imx8m-boot;
}
+34
View File
@@ -0,0 +1,34 @@
{
lib,
pkgs,
buildArmTrustedFirmware,
fetchgit,
enable-tee,
}:
with pkgs; let
opteedflag =
if enable-tee
then "SPD=opteed"
else "";
target-board = "imx8mq";
in
buildArmTrustedFirmware rec {
pname = "imx8mq-atf";
platform = target-board;
enableParallelBuilding = true;
extraMeta.platforms = ["aarch64-linux"];
src = fetchgit {
url = "https://github.com/nxp-imx/imx-atf.git";
#lf6.1.55_2.2.0
rev = "08e9d4eef2262c0dd072b4325e8919e06d349e02";
sha256 = "sha256-96EddJXlFEkP/LIGVgNBvUP4IDI3BbDE/c9Yub22gnc=";
};
extraMakeFlags = lib.concatLists [
(lib.optional (lib.versionAtLeast pkgs.binutils.version "2.39") "LDFLAGS=--no-warn-rwx-segments")
["PLAT=${platform}" "bl31" "${opteedflag}"]
];
filesToInstall = ["build/${target-board}/release/bl31.bin"];
}
+78
View File
@@ -0,0 +1,78 @@
{
pkgs,
enable-tee ? false,
}:
with pkgs; let
cp-tee =
if enable-tee
then "install -m 0644 ${imx8mq-optee-os}/tee.bin ./iMX8M/tee.bin"
else "";
imx8mq-atf = pkgs.callPackage ./imx8mq-atf.nix {
inherit (pkgs) buildArmTrustedFirmware;
inherit enable-tee;
};
imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix {};
imx8mq-uboot = pkgs.callPackage ./imx8mq-uboot.nix {};
imx8mq-optee-os = pkgs.callPackage ./imx8mq-optee-os.nix {};
in {
imx8m-boot = pkgs.stdenv.mkDerivation rec {
name = "imx8mq-mkimage";
version = "lf-6.1.55-2.2.0";
src = pkgs.fetchgit {
url = "https://github.com/nxp-imx/imx-mkimage.git";
rev = "c4365450fb115d87f245df2864fee1604d97c06a";
sha256 = "sha256-xycEaWKVM63BlDyBKNN0OefyK6iX/fQOTvv4fRVM55U=";
leaveDotGit = true;
};
postPatch = ''
substituteInPlace Makefile \
--replace 'CC = gcc' 'CC = clang'
patchShebangs scripts
'';
nativeBuildInputs = [
clang
git
dtc
];
buildInputs = [
git
glibc.static
zlib
zlib.static
];
buildPhase = ''
runHook preBuild
make bin
make SOC=iMX8M mkimage_imx8
cp -v ${pkgs.ubootTools}/bin/mkimage ./iMX8M/mkimage_uboot
install -m 0644 ${imx8mq-uboot}/u-boot-spl.bin ./iMX8M/u-boot-spl.bin
install -m 0644 ${imx8mq-uboot}/u-boot-nodtb.bin ./iMX8M/u-boot-nodtb.bin
install -m 0644 ${imx8mq-uboot}/imx8mq-evk.dtb ./iMX8M/imx8mq-evk.dtb
install -m 0644 ${imx8mq-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin ./iMX8M/lpddr4_pmu_train_1d_dmem.bin
install -m 0644 ${imx8mq-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin ./iMX8M/lpddr4_pmu_train_1d_imem.bin
install -m 0644 ${imx8mq-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin ./iMX8M/lpddr4_pmu_train_2d_dmem.bin
install -m 0644 ${imx8mq-firmware}/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin ./iMX8M/lpddr4_pmu_train_2d_imem.bin
install -m 0644 ${imx8mq-firmware}/firmware/hdmi/cadence/signed_hdmi_imx8m.bin ./iMX8M/signed_hdmi_imx8m.bin
install -m 0644 ${imx8mq-atf}/bl31.bin ./iMX8M/bl31.bin
${cp-tee}
make SOC=iMX8M flash_evk
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/image
install -m 0644 ./iMX8M/flash.bin $out/image
runHook postInstall
'';
};
}
+19
View File
@@ -0,0 +1,19 @@
{pkgs, ...}:
with pkgs;
stdenv.mkDerivation rec {
pname = "imx8mq-firmware";
version = "8.22";
src = pkgs.fetchurl {
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin";
sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A=";
};
dontUnpack = true;
dontStrip = true;
installPhase = ''
${pkgs.bash}/bin/bash $src --auto-accept --force
mv firmware-imx-${version} $out
'';
}
+50
View File
@@ -0,0 +1,50 @@
{pkgs, ...} @ args:
with pkgs;
buildLinux (args
// rec {
version = "6.1.55";
name = "imx8mq-linux";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = version;
defconfig = "imx_v8_defconfig";
kernelPatches = [
];
autoModules = false;
extraConfig = ''
CRYPTO_TLS m
TLS y
MD_RAID0 m
MD_RAID1 m
MD_RAID10 m
MD_RAID456 m
DM_VERITY m
LOGO y
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
FB_EFI n
EFI_STUB y
EFI y
VIRTIO y
VIRTIO_PCI y
VIRTIO_BLK y
DRM_VIRTIO_GPU y
EXT4_FS y
USBIP_CORE m
USBIP_VHCI_HCD m
USBIP_HOST m
USBIP_VUDC m
'';
src = fetchFromGitHub {
owner = "nxp-imx";
repo = "linux-imx";
# tag: lf-6.1.55-2.2.0
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
};
}
// (args.argsOverride or {}))
+66
View File
@@ -0,0 +1,66 @@
{pkgs}: let
python3 = pkgs.buildPackages.python3;
toolchain = pkgs.gcc9Stdenv.cc;
binutils = pkgs.gcc9Stdenv.cc.bintools.bintools_bin;
cpp = pkgs.gcc;
in
pkgs.stdenv.mkDerivation rec {
pname = "imx8mq-optee-os";
version = "lf-6.1.55-2.2.0";
nativeBuildInputs = [
python3
];
enableParallelBuilding = true;
propagatedBuildInputs = with python3.pkgs; [
pycryptodomex
pyelftools
cryptography
];
src = pkgs.fetchgit {
url = "https://github.com/nxp-imx/imx-optee-os.git";
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
};
postPatch = ''
substituteInPlace scripts/arm32_sysreg.py \
--replace '/usr/bin/env python3' '${python3}/bin/python'
substituteInPlace scripts/gen_tee_bin.py \
--replace '/usr/bin/env python3' '${python3}/bin/python'
substituteInPlace scripts/pem_to_pub_c.py \
--replace '/usr/bin/env python3' '${python3}/bin/python'
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
--replace '/bin/bash' '${pkgs.bash}/bin/bash'
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
substituteInPlace mk/gcc.mk \
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
'';
makeFlags = [
"PLATFORM=imx"
"PLATFORM_FLAVOR=mx8mqevk"
"CFG_ARM64_core=y"
"CFG_TEE_TA_LOG_LEVEL=0"
"CFG_TEE_CORE_LOG_LEVEL=0"
"CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}"
"CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}"
];
installPhase = ''
mkdir -p $out
cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin
'';
}
+41
View File
@@ -0,0 +1,41 @@
{pkgs}:
with pkgs; let
inherit buildUBoot;
in
(buildUBoot {
pname = "imx8mq-uboot";
version = "2023.04";
src = fetchgit {
url = "https://github.com/nxp-imx/uboot-imx.git";
# tag: "lf-6.1.55-2.2.0"
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
};
extraConfig = ''
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
CONFIG_CMD_BOOTEFI_SELFTEST=y
CONFIG_CMD_BOOTEFI=y
CONFIG_EFI_LOADER=y
CONFIG_BLK=y
CONFIG_PARTITIONS=y
CONFIG_DM_DEVICE_REMOVE=n
CONFIG_CMD_CACHE=y
'';
enableParallelBuilding = true;
defconfig = "imx8mq_evk_defconfig";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [
"./u-boot-nodtb.bin"
"./spl/u-boot-spl.bin"
"./arch/arm/dts/imx8mq-evk.dtb"
".config"
];
})
.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.perl];
})
+18
View File
@@ -0,0 +1,18 @@
{pkgs, ...}: {
nixpkgs.overlays = [
(import ./overlay.nix)
];
imports = [
./modules.nix
];
boot.loader.grub.extraFiles = {
"imx8mq-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mq-linux.nix {}}/dtbs/freescale/imx8mq-evk.dtb";
};
hardware.deviceTree = {
filter = "imx8mq-*.dtb";
name = "imx8mq-evk.dtb";
};
}
+16
View File
@@ -0,0 +1,16 @@
{
pkgs,
lib,
...
}: {
nixpkgs.hostPlatform = "aarch64-linux";
boot = {
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix {});
initrd.includeDefaultModules = lib.mkForce false;
};
disabledModules = ["profiles/all-hardware.nix"];
hardware.deviceTree.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
final: prev: {
inherit (final.callPackage ./bsp/imx8mq-boot.nix {pkgs = final;}) imx8m-boot;
}
File renamed without changes.
+1 -1
View File
@@ -55,7 +55,7 @@ let
# brute force disable drm
CEC_CORE = no;
CEC_NOTIFIER = no;
DRM = no;
DRM = lib.mkForce no;
DRM_MIPI_DBI = no;
DRM_MIPI_DSI = no;
DRM_DP_AUX_BUS = no;
+9
View File
@@ -0,0 +1,9 @@
{
imports = [
../../common/cpu/intel/comet-lake
];
boot.initrd.kernelModules = [
"sdhci_pci" # 16G eMMC on board
];
}
+2 -2
View File
@@ -9,8 +9,8 @@ let
src = fetchFromGitHub {
owner = "starfive-tech";
repo = "linux";
rev = "7ccbe4604c1498e880cc63c7e8b45e3c55914d6d";
hash = "sha256-iO7tnnWYfveVbyvVZKL0dDLwONijt1n0RUD1kTkOQew=";
rev = "13eb70da2a73187c8c7aece13d23d68928aa8210";
hash = "sha256-bwB7Pc+Z+MWXPfWYdgtRGuhqjiNHLDGNCY62e4lBGvE=";
};
inherit modDirVersion kernelPatches;
+2 -2
View File
@@ -6,13 +6,13 @@
}:
buildUBoot rec {
version = "2024.01-rc5";
version = "2024.01";
src = fetchFromGitHub {
owner = "u-boot";
repo = "u-boot";
rev = "refs/tags/v${version}";
hash = "sha256-QlwgvnSaXh39z9AM7HNF731lRiUkPbN3oQyioQNTYFA=";
hash = "sha256-0Da7Czy9cpQ+D5EICc3/QSZhAdCBsmeMvBgykYhAQFw=";
};
# workaround for https://github.com/NixOS/nixpkgs/pull/146634