mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-06 07:53:30 +01:00
Compare commits
76
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e60c66bd0b | ||
|
|
e4c6ee69e7 | ||
|
|
ae91411396 | ||
|
|
d48e8f0e16 | ||
|
|
eea20ba3b0 | ||
|
|
2e85ae1b70 | ||
|
|
8b72f74d80 | ||
|
|
655a6da8a8 | ||
|
|
bffe23e699 | ||
|
|
5ad68c5dff | ||
|
|
fad92f5f57 | ||
|
|
f2e49f279c | ||
|
|
e598a4ca2f | ||
|
|
2567706185 | ||
|
|
7467f155fc | ||
|
|
ddb27b7bba | ||
|
|
13cc234e37 | ||
|
|
a2bc09823a | ||
|
|
86d9291cc3 | ||
|
|
8650454db6 | ||
|
|
11ea8b8477 | ||
|
|
a3576f0f3c | ||
|
|
fe21eda733 | ||
|
|
43ffe9ac82 | ||
|
|
3beac2438b | ||
|
|
b09586b101 | ||
|
|
e07b1618c3 | ||
|
|
e214e292a6 | ||
|
|
779c16f604 | ||
|
|
6ec1e82182 | ||
|
|
4bafcc2454 | ||
|
|
46ab381a8c | ||
|
|
ec7bf039ca | ||
|
|
e11482075d | ||
|
|
2379bc4099 | ||
|
|
688ee555de | ||
|
|
8b405e9c6d | ||
|
|
34b7229b95 | ||
|
|
46f9982c9b | ||
|
|
9c0ee5dfa1 | ||
|
|
7667e19678 | ||
|
|
b27995044c | ||
|
|
d6645c340e | ||
|
|
c4fe135227 | ||
|
|
9ed85f8afe | ||
|
|
c816590dca | ||
|
|
eb9e8e10ac | ||
|
|
156fbb62a9 | ||
|
|
c52ea60901 | ||
|
|
d232c6f9cc | ||
|
|
a8bbda8911 | ||
|
|
d0955d227d | ||
|
|
3441b5242a | ||
|
|
0257a0aa58 | ||
|
|
e087756cf4 | ||
|
|
a74f5ce8c6 | ||
|
|
dd4227bb1b | ||
|
|
30bf4efeda | ||
|
|
081542ae22 | ||
|
|
28c41d0a5d | ||
|
|
c8b6a49ebf | ||
|
|
895e314e4b | ||
|
|
0582a93516 | ||
|
|
1243f78ca9 | ||
|
|
5e57f28e6a | ||
|
|
095a445675 | ||
|
|
0e9dc7cf61 | ||
|
|
27581273c2 | ||
|
|
76a314765d | ||
|
|
4ba28b48c8 | ||
|
|
40dffd02e3 | ||
|
|
0c55f0f776 | ||
|
|
8972e6538b | ||
|
|
c92f8fc536 | ||
|
|
37d0301b3c | ||
|
|
66e88bdcaa |
No files matched your search
@@ -11,11 +11,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
- run: cd tests && nix fmt .. -- --fail-on-change
|
- run: nix build .#checks.x86_64-linux.formatting
|
||||||
tests:
|
tests:
|
||||||
needs: nixfmt
|
needs: nixfmt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
- run: nix run ./tests#run .
|
- run: nix run .#run-tests
|
||||||
+1
-1
@@ -11,4 +11,4 @@ purism/librem/13v3 @yegortimoshenko
|
|||||||
system76/darp6 @khumba
|
system76/darp6 @khumba
|
||||||
framework @emiller88
|
framework @emiller88
|
||||||
tuxedo/pulse/15/gen2 @trueNAHO
|
tuxedo/pulse/15/gen2 @trueNAHO
|
||||||
tuxedo/pulse/14/gen3 @gabyx @britter @trueNAHO
|
tuxedo/pulse/14/gen3 @gabyx @britter
|
||||||
+4
-3
@@ -14,8 +14,9 @@ For example:
|
|||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ lib }: {
|
{ lib }: {
|
||||||
# Using mkDefault, because the user might want to disable tlp
|
# Using mkDefault, because the user might want to disable power-profiles-daemon
|
||||||
services.tlp.enable = lib.mkDefault true;
|
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# No need to use mkDefault, because the setting will merge with the user's setting
|
# No need to use mkDefault, because the setting will merge with the user's setting
|
||||||
boot.kernelModules = [ "tmp_smapi" ];
|
boot.kernelModules = [ "tmp_smapi" ];
|
||||||
}
|
}
|
||||||
@@ -42,7 +43,7 @@ Link the profile in the table in README.md and in flake.nix.
|
|||||||
|
|
||||||
## 3. Testing
|
## 3. Testing
|
||||||
|
|
||||||
Run `nix run ./tests#run .` to evaluate all hardware profiles.
|
Run `nix run .#run-tests` to evaluate all hardware profiles.
|
||||||
Because profiles can only be tested with the appropriate hardware, quality
|
Because profiles can only be tested with the appropriate hardware, quality
|
||||||
assurance is up to *you*.
|
assurance is up to *you*.
|
||||||
|
|
||||||
|
|||||||
@@ -85,13 +85,14 @@ All contributors and users are welcome to join!
|
|||||||
See code for all available configurations.
|
See code for all available configurations.
|
||||||
|
|
||||||
| Model | Path | Flake Module |
|
| Model | Path | Flake Module |
|
||||||
| --------------------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------------------- |
|
| --------------------------------------------------------------------------------- | ------------------------------------------------------- | -------------------------------------- |
|
||||||
| [Acer Aspire 4810T](acer/aspire/4810t) | `<nixos-hardware/acer/aspire/4810t>` | `acer-aspire-4810t` |
|
| [Acer Aspire 4810T](acer/aspire/4810t) | `<nixos-hardware/acer/aspire/4810t>` | `acer-aspire-4810t` |
|
||||||
| [Airis N990](airis/n990) | `<nixos-hardware/airis/n990>` | `airis-n990` |
|
| [Airis N990](airis/n990) | `<nixos-hardware/airis/n990>` | `airis-n990` |
|
||||||
| [Apple iMac 14.2](apple/imac/14-2) | `<nixos-hardware/apple/imac/14-2>` | `apple-imac-14-2` |
|
| [Apple iMac 14.2](apple/imac/14-2) | `<nixos-hardware/apple/imac/14-2>` | `apple-imac-14-2` |
|
||||||
| [Apple iMac 18.2](apple/imac/18-2) | `<nixos-hardware/apple/imac/18-2>` | `apple-imac-18-2` |
|
| [Apple iMac 18.2](apple/imac/18-2) | `<nixos-hardware/apple/imac/18-2>` | `apple-imac-18-2` |
|
||||||
| [Apple MacBook Air 3,X](apple/macbook-air/3) | `<nixos-hardware/apple/macbook-air/3>` | `apple-macbook-air-3` |
|
| [Apple MacBook Air 3,X](apple/macbook-air/3) | `<nixos-hardware/apple/macbook-air/3>` | `apple-macbook-air-3` |
|
||||||
| [Apple MacBook Air 4,X](apple/macbook-air/4) | `<nixos-hardware/apple/macbook-air/4>` | `apple-macbook-air-4` |
|
| [Apple MacBook Air 4,X](apple/macbook-air/4) | `<nixos-hardware/apple/macbook-air/4>` | `apple-macbook-air-4` |
|
||||||
|
| [Apple MacBook Air 5,X](apple/macbook-air/5) | `<nixos-hardware/apple/macbook-air/5>` | `apple-macbook-air-5` |
|
||||||
| [Apple MacBook Air 6,X](apple/macbook-air/6) | `<nixos-hardware/apple/macbook-air/6>` | `apple-macbook-air-6` |
|
| [Apple MacBook Air 6,X](apple/macbook-air/6) | `<nixos-hardware/apple/macbook-air/6>` | `apple-macbook-air-6` |
|
||||||
| [Apple MacBook Air 7,X](apple/macbook-air/7) | `<nixos-hardware/apple/macbook-air/7>` | `apple-macbook-air-7` |
|
| [Apple MacBook Air 7,X](apple/macbook-air/7) | `<nixos-hardware/apple/macbook-air/7>` | `apple-macbook-air-7` |
|
||||||
| [Apple MacBook Pro 8,1](apple/macbook-pro/8-1) | `<nixos-hardware/apple/macbook-pro/8-1>` | `apple-macbook-pro-8-1` |
|
| [Apple MacBook Pro 8,1](apple/macbook-pro/8-1) | `<nixos-hardware/apple/macbook-pro/8-1>` | `apple-macbook-pro-8-1` |
|
||||||
@@ -108,6 +109,7 @@ See code for all available configurations.
|
|||||||
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` | `asus-ally-rc71l` |
|
| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `<nixos-hardware/asus/ally/rc71l>` | `asus-ally-rc71l` |
|
||||||
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `<nixos-hardware/asus/flow/gv302x/amdgpu>` | `asus-flow-gv302x-amdgpu` |
|
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `<nixos-hardware/asus/flow/gv302x/amdgpu>` | `asus-flow-gv302x-amdgpu` |
|
||||||
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `<nixos-hardware/asus/flow/gv302x/nvidia>` | `asus-flow-gv302x-nvidia` |
|
| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `<nixos-hardware/asus/flow/gv302x/nvidia>` | `asus-flow-gv302x-nvidia` |
|
||||||
|
| [Asus ROG GL552VW](asus/rog-gl552vw) | `<nixos-hardware/asus/rog-gl552vw>` | `asus-rog-gl552vw` |
|
||||||
| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `<nixos-hardware/asus/rog-strix/g513im>` | `asus-rog-strix-g513im` |
|
| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `<nixos-hardware/asus/rog-strix/g513im>` | `asus-rog-strix-g513im` |
|
||||||
| [Asus ROG Strix G533ZW](asus/rog-strix/g533zw) | `<nixos-hardware/asus/rog-strix/g533zw>` | `asus-rog-strix-g533zw` |
|
| [Asus ROG Strix G533ZW](asus/rog-strix/g533zw) | `<nixos-hardware/asus/rog-strix/g533zw>` | `asus-rog-strix-g533zw` |
|
||||||
| [Asus ROG Strix G533Q](asus/rog-strix/g533q) | `<nixos-hardware/asus/rog-strix/g533q>` | `asus-rog-strix-g533zw` |
|
| [Asus ROG Strix G533Q](asus/rog-strix/g533q) | `<nixos-hardware/asus/rog-strix/g533q>` | `asus-rog-strix-g533zw` |
|
||||||
@@ -131,6 +133,7 @@ See code for all available configurations.
|
|||||||
| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/nvidia/) | `<nixos-hardware/asus/zenbook/ux481/nvidia>` | `asus-zenbook-ux481-nvidia` |
|
| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/nvidia/) | `<nixos-hardware/asus/zenbook/ux481/nvidia>` | `asus-zenbook-ux481-nvidia` |
|
||||||
| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `<nixos-hardware/asus/zenbook/ux371>` | `asus-zenbook-ux371` |
|
| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `<nixos-hardware/asus/zenbook/ux371>` | `asus-zenbook-ux371` |
|
||||||
| [Asus Zenbook Pro 15 UX535](asus/zenbook/ux535/) | `<nixos-hardware/asus/zenbook/ux535>` | `asus-zenbook-ux535` |
|
| [Asus Zenbook Pro 15 UX535](asus/zenbook/ux535/) | `<nixos-hardware/asus/zenbook/ux535>` | `asus-zenbook-ux535` |
|
||||||
|
| [Asus Zenbook Pro 17 UM6702](asus/zenbook/um6702/) | `<nixos-hardware/asus/zenbook/um6702>` | `asus-zenbook-um6702` |
|
||||||
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `<nixos-hardware/beagleboard/pocketbeagle>` | `beagleboard-pocketbeagle` |
|
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `<nixos-hardware/beagleboard/pocketbeagle>` | `beagleboard-pocketbeagle` |
|
||||||
| [Chuwi MiniBook X](chuwi/minibook-x) | `<nixos-hardware/chuwi/minibook-x>` | `chuwi-minibook-x` |
|
| [Chuwi MiniBook X](chuwi/minibook-x) | `<nixos-hardware/chuwi/minibook-x>` | `chuwi-minibook-x` |
|
||||||
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` | `deciso-dec` |
|
| [Deciso DEC series](deciso/dec) | `<nixos-hardware/deciso/dec>` | `deciso-dec` |
|
||||||
@@ -196,7 +199,7 @@ See code for all available configurations.
|
|||||||
| [Dell XPS 17 9700, nvidia](dell/xps/17-9700/nvidia) | `<nixos-hardware/dell/xps/17-9700/nvidia>` | `dell-xps-17-9700-nvidia` |
|
| [Dell XPS 17 9700, nvidia](dell/xps/17-9700/nvidia) | `<nixos-hardware/dell/xps/17-9700/nvidia>` | `dell-xps-17-9700-nvidia` |
|
||||||
| [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `<nixos-hardware/dell/xps/17-9710/intel>` | `dell-xps-17-9710-intel` |
|
| [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `<nixos-hardware/dell/xps/17-9710/intel>` | `dell-xps-17-9710-intel` |
|
||||||
| [Framework 11th Gen Intel Core](framework/13-inch/11th-gen-intel) | `<nixos-hardware/framework/13-inch/11th-gen-intel>` | `framework-11th-gen-intel` |
|
| [Framework 11th Gen Intel Core](framework/13-inch/11th-gen-intel) | `<nixos-hardware/framework/13-inch/11th-gen-intel>` | `framework-11th-gen-intel` |
|
||||||
| [Framework 12th Gen Intel Core](framework/12-inch/13th-gen-intel) | `<nixos-hardware/framework/12-inch/13th-gen-intel>` | `framework-12th-gen-intel` |
|
| [Framework 12th Gen Intel Core](framework/13-inch/12th-gen-intel) | `<nixos-hardware/framework/13-inch/12th-gen-intel>` | `framework-12th-gen-intel` |
|
||||||
| [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `<nixos-hardware/framework/13-inch/13th-gen-intel>` | `framework-13th-gen-intel` |
|
| [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `<nixos-hardware/framework/13-inch/13th-gen-intel>` | `framework-13th-gen-intel` |
|
||||||
| [Framework Intel Core Ultra Series 1](framework/13-inch/intel-core-ultra-series1) | `<nixos-hardware/framework/13-inch/intel-core-ultra-series1>` | `framework-intel-core-ultra-series1` |
|
| [Framework Intel Core Ultra Series 1](framework/13-inch/intel-core-ultra-series1) | `<nixos-hardware/framework/13-inch/intel-core-ultra-series1>` | `framework-intel-core-ultra-series1` |
|
||||||
| [Framework 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `<nixos-hardware/framework/13-inch/7040-amd>` | `framework-13-7040-amd` |
|
| [Framework 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `<nixos-hardware/framework/13-inch/7040-amd>` | `framework-13-7040-amd` |
|
||||||
@@ -226,12 +229,14 @@ See code for all available configurations.
|
|||||||
| [HP Elitebook 845g9](hp/elitebook/845/g9) | `<nixos-hardware/hp/elitebook/845/g9>` | `hp-elitebook-845g9` |
|
| [HP Elitebook 845g9](hp/elitebook/845/g9) | `<nixos-hardware/hp/elitebook/845/g9>` | `hp-elitebook-845g9` |
|
||||||
| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `<nixos-hardware/hp/laptop/14s-dq2024nf>` | `hp-laptop-14s-dq2024nf` |
|
| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `<nixos-hardware/hp/laptop/14s-dq2024nf>` | `hp-laptop-14s-dq2024nf` |
|
||||||
| [HP Notebook 14-df0023](hp/notebook/14-df0023) | `<nixos-hardware/hp/notebook/14-df0023>` | `hp-notebook-14-df0023` |
|
| [HP Notebook 14-df0023](hp/notebook/14-df0023) | `<nixos-hardware/hp/notebook/14-df0023>` | `hp-notebook-14-df0023` |
|
||||||
| [HP Probook 440G5](hp/probook/440g5) | `<nixos-hardware/hp/probook/440g5>` | `hp-probook-440G5` |
|
| [HP Probook 440G5](hp/probook/440G5) | `<nixos-hardware/hp/probook/440G5>` | `hp-probook-440G5` |
|
||||||
|
| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `<nixos-hardware/hp/laptop/14s-dq2024nf>` | `hp-laptop-14s-dq2024nf` |
|
||||||
| [HP Probook 460G11](hp/probook/460g11) | `<nixos-hardware/hp/probook/460g11>` | `hp-probook-46011` |
|
| [HP Probook 460G11](hp/probook/460g11) | `<nixos-hardware/hp/probook/460g11>` | `hp-probook-46011` |
|
||||||
| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `<nixos-hardware/huawei/machc-wa>` | `huawei-machc-wa` |
|
| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `<nixos-hardware/huawei/machc-wa>` | `huawei-machc-wa` |
|
||||||
| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `<nixos-hardware/nxp/imx8qm-mek>` | `nxp-imx8qm-mek` |
|
| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `<nixos-hardware/nxp/imx8qm-mek>` | `nxp-imx8qm-mek` |
|
||||||
| [Intel NUC 5i5RYB](intel/nuc/5i5ryb/) | `<nixos-hardware/intel/nuc/5i5ryb>` | `intel-nuc-5i5ryb` |
|
| [Intel NUC 5i5RYB](intel/nuc/5i5ryb/) | `<nixos-hardware/intel/nuc/5i5ryb>` | `intel-nuc-5i5ryb` |
|
||||||
| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `<nixos-hardware/intel/nuc/8i7beh>` | `intel-nuc-8i7beh` |
|
| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `<nixos-hardware/intel/nuc/8i7beh>` | `intel-nuc-8i7beh` |
|
||||||
|
| [Kobol Helios4](kobol/helios4) | `<nixos-hardware/kobol/helios4>` | `kobol-helios-4` |
|
||||||
| [Lenovo IdeaCentre K330](lenovo/ideacentre/k330) | `<nixos-hardware/lenovo/ideacentre/k330>` | `lenovo-ideacentre-k330` |
|
| [Lenovo IdeaCentre K330](lenovo/ideacentre/k330) | `<nixos-hardware/lenovo/ideacentre/k330>` | `lenovo-ideacentre-k330` |
|
||||||
| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `<nixos-hardware/lenovo/ideapad/15alc6>` | `lenovo-ideapad-15alc6` |
|
| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `<nixos-hardware/lenovo/ideapad/15alc6>` | `lenovo-ideapad-15alc6` |
|
||||||
| [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `<nixos-hardware/lenovo/ideapad/15arh05>` | `lenovo-ideapad-15arh05` |
|
| [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `<nixos-hardware/lenovo/ideapad/15arh05>` | `lenovo-ideapad-15arh05` |
|
||||||
@@ -258,6 +263,7 @@ See code for all available configurations.
|
|||||||
| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `<nixos-hardware/lenovo/legion/16achg6/nvidia>` | `lenovo-legion-16achg6-nvidia` |
|
| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `<nixos-hardware/lenovo/legion/16achg6/nvidia>` | `lenovo-legion-16achg6-nvidia` |
|
||||||
| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `<nixos-hardware/lenovo/legion/16irx8h>` | `lenovo-legion-16irx8h` |
|
| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `<nixos-hardware/lenovo/legion/16irx8h>` | `lenovo-legion-16irx8h` |
|
||||||
| [Lenovo Legion 7 Pro 16irx9h (Intel)](lenovo/legion/16irx9h) | `<nixos-hardware/lenovo/legion/16irx9h>` | `lenovo-legion-16irx9h` |
|
| [Lenovo Legion 7 Pro 16irx9h (Intel)](lenovo/legion/16irx9h) | `<nixos-hardware/lenovo/legion/16irx9h>` | `lenovo-legion-16irx9h` |
|
||||||
|
| [Lenovo Legion Slim 5](lenovo/legion/16aph8/) | `<nixos-hardware/lenovo/legion/16aph8>` | `lenovo-legion-16aph8` |
|
||||||
| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `<nixos-hardware/lenovo/legion/16arha7>` | `lenovo-legion-16arha7` |
|
| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `<nixos-hardware/lenovo/legion/16arha7>` | `lenovo-legion-16arha7` |
|
||||||
| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `<nixos-hardware/lenovo/legion/t526amr5>` | `lenovo-legion-t526amr5` |
|
| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `<nixos-hardware/lenovo/legion/t526amr5>` | `lenovo-legion-t526amr5` |
|
||||||
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` | `lenovo-legion-y530-15ich` |
|
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` | `lenovo-legion-y530-15ich` |
|
||||||
@@ -299,6 +305,8 @@ See code for all available configurations.
|
|||||||
| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen4>` | `lenovo-thinkpad-t14-amd-gen4` |
|
| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen4>` | `lenovo-thinkpad-t14-amd-gen4` |
|
||||||
| [Lenovo ThinkPad T14 AMD Gen 5](lenovo/thinkpad/t14/amd/gen5) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen5>` | `lenovo-thinkpad-t14-amd-gen5` |
|
| [Lenovo ThinkPad T14 AMD Gen 5](lenovo/thinkpad/t14/amd/gen5) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen5>` | `lenovo-thinkpad-t14-amd-gen5` |
|
||||||
| [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `<nixos-hardware/lenovo/thinkpad/t14>` | `lenovo-thinkpad-t14` |
|
| [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `<nixos-hardware/lenovo/thinkpad/t14>` | `lenovo-thinkpad-t14` |
|
||||||
|
| [Lenovo ThinkPad T14 Intel Gen 1](lenovo/thinkpad/t14/intel/gen1) | `<nixos-hardware/lenovo/thinkpad/t14/intel/gen1>` | `lenovo-thinkpad-t14-intel-gen1` |
|
||||||
|
| [Lenovo ThinkPad T14 Intel Gen 1 (Nvidia)](lenovo/thinkpad/t14/intel/gen1/nvidia) | `<nixos-hardware/lenovo/thinkpad/t14/intel/gen1/nvidia>`| `lenovo-thinkpad-t14-intel-gen1-nvidia`|
|
||||||
| [Lenovo ThinkPad T14 Intel Gen 6](lenovo/thinkpad/t14/intel/gen6) | `<nixos-hardware/lenovo/thinkpad/t14/intel/gen6>` | `lenovo-thinkpad-t14-intel-gen6` |
|
| [Lenovo ThinkPad T14 Intel Gen 6](lenovo/thinkpad/t14/intel/gen6) | `<nixos-hardware/lenovo/thinkpad/t14/intel/gen6>` | `lenovo-thinkpad-t14-intel-gen6` |
|
||||||
| [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen1>` | `lenovo-thinkpad-t14s-amd-gen1` |
|
| [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen1>` | `lenovo-thinkpad-t14s-amd-gen1` |
|
||||||
| [Lenovo ThinkPad T14s AMD Gen 4](lenovo/thinkpad/t14s/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen4>` | `lenovo-thinkpad-t14s-amd-gen4` |
|
| [Lenovo ThinkPad T14s AMD Gen 4](lenovo/thinkpad/t14s/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen4>` | `lenovo-thinkpad-t14s-amd-gen4` |
|
||||||
@@ -362,11 +370,14 @@ See code for all available configurations.
|
|||||||
| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `<nixos-hardware/lenovo/yoga/7/14IAH7/hybrid>` | `lenovo-yoga-7-14IAH7-hybrid` |
|
| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `<nixos-hardware/lenovo/yoga/7/14IAH7/hybrid>` | `lenovo-yoga-7-14IAH7-hybrid` |
|
||||||
| [Lenovo Yoga Slim 7 14ILL10](lenovo/yoga/7/14ILL10) | `<nixos-hardware/lenovo/yoga/7/14ILL10>` | `lenovo-yoga-7-14ILL10` |
|
| [Lenovo Yoga Slim 7 14ILL10](lenovo/yoga/7/14ILL10) | `<nixos-hardware/lenovo/yoga/7/14ILL10>` | `lenovo-yoga-7-14ILL10` |
|
||||||
| [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `<nixos-hardware/lenovo/yoga/7/slim/gen8>` | `lenovo-yoga-7-slim-gen8` |
|
| [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `<nixos-hardware/lenovo/yoga/7/slim/gen8>` | `lenovo-yoga-7-slim-gen8` |
|
||||||
|
| [Linglong Nova Studio](linglong/nova-studio) | `<nixos-hardware/linglong/nova-studio>` | `linglong-nova-studio` |
|
||||||
| [MSI B550-A PRO](msi/b550-a-pro) | `<nixos-hardware/msi/b550-a-pro>` | `msi-b550-a-pro` |
|
| [MSI B550-A PRO](msi/b550-a-pro) | `<nixos-hardware/msi/b550-a-pro>` | `msi-b550-a-pro` |
|
||||||
| [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `<nixos-hardware/msi/b350-tomahawk>` | `msi-b350-tomahawk` |
|
| [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `<nixos-hardware/msi/b350-tomahawk>` | `msi-b350-tomahawk` |
|
||||||
|
| [MSI B550 TOMAHAWK](msi/b550-tomahawk) | `<nixos-hardware/msi/b550-tomahawk>` | `msi-b550-tomahawk` |
|
||||||
| [MSI GS60 2QE](msi/gs60) | `<nixos-hardware/msi/gs60>` | `msi-gs60` |
|
| [MSI GS60 2QE](msi/gs60) | `<nixos-hardware/msi/gs60>` | `msi-gs60` |
|
||||||
| [MSI GL62/CX62](msi/gl62) | `<nixos-hardware/msi/gl62>` | `msi-gl62` |
|
| [MSI GL62/CX62](msi/gl62) | `<nixos-hardware/msi/gl62>` | `msi-gl62` |
|
||||||
| [MSI GL65 10SDR-492](msi/gl65/10SDR-492) | `<nixos-hardware/msi/gl65/10SDR-492>` | `msi-gl65-10SDR-492` |
|
| [MSI GL65 10SDR-492](msi/gl65/10SDR-492) | `<nixos-hardware/msi/gl65/10SDR-492>` | `msi-gl65-10SDR-492` |
|
||||||
|
| [Malibal Aon S1](malibal/aon/s1) | | `<nixos-hardware/malibal/aon/s1>` | `malibal-aon-s1` |
|
||||||
| [Microchip Icicle Kit](microchip/icicle-kit) | `<nixos-hardware/microchip/icicle-kit>` | `microchip-icicle-kit` |
|
| [Microchip Icicle Kit](microchip/icicle-kit) | `<nixos-hardware/microchip/icicle-kit>` | `microchip-icicle-kit` |
|
||||||
| [Microsoft Surface Go](microsoft/surface/surface-go) | `<nixos-hardware/microsoft/surface/surface-go>` | `microsoft-surface-go` |
|
| [Microsoft Surface Go](microsoft/surface/surface-go) | `<nixos-hardware/microsoft/surface/surface-go>` | `microsoft-surface-go` |
|
||||||
| [Microsoft Surface Pro (Intel)](microsoft/surface/surface-pro-intel) | `<nixos-hardware/microsoft/surface/surface-pro-intel>` | `microsoft-surface-pro-intel` |
|
| [Microsoft Surface Pro (Intel)](microsoft/surface/surface-pro-intel) | `<nixos-hardware/microsoft/surface/surface-pro-intel>` | `microsoft-surface-pro-intel` |
|
||||||
@@ -374,14 +385,17 @@ See code for all available configurations.
|
|||||||
| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `<nixos-hardware/microsoft/surface/common>` | `microsoft-surface-common` |
|
| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `<nixos-hardware/microsoft/surface/common>` | `microsoft-surface-common` |
|
||||||
| [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `<nixos-hardware/microsoft/surface-pro/3>` | `microsoft-surface-pro-3` |
|
| [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `<nixos-hardware/microsoft/surface-pro/3>` | `microsoft-surface-pro-3` |
|
||||||
| [Microsoft Surface Pro 9](microsoft/surface-pro/9) | `<nixos-hardware/microsoft/surface-pro/9>` | `microsoft-surface-pro-9` |
|
| [Microsoft Surface Pro 9](microsoft/surface-pro/9) | `<nixos-hardware/microsoft/surface-pro/9>` | `microsoft-surface-pro-9` |
|
||||||
|
| [Milk-V Pioneer](milkv/pioneer) | `<nixos-hardware/milkv/pioneer>` | `milkv-pioneer` |
|
||||||
| [Morefine M600](morefine/m600) | `<nixos-hardware/morefine/m600>` | `morefine-m600` |
|
| [Morefine M600](morefine/m600) | `<nixos-hardware/morefine/m600>` | `morefine-m600` |
|
||||||
| [Minisforum V3](minisforum/v3) | `<nixos-hardware/minisforum/v3>` | `minisforum-v3` |
|
| [Minisforum V3](minisforum/v3) | `<nixos-hardware/minisforum/v3>` | `minisforum-v3` |
|
||||||
|
| [MNT Reform with RK3588 module](mnt/reform/rk3588) | `<nixos-hardware/mnt/reform/rk3588` | `mnt-reform-rk3588` |
|
||||||
| [MECHREVO Yilong15Pro](mechrevo/GM5HG0A) | `<nixos-hardware/mechrevo/GM5HG0A>` | `mechrevo-gm5hg0a` |
|
| [MECHREVO Yilong15Pro](mechrevo/GM5HG0A) | `<nixos-hardware/mechrevo/GM5HG0A>` | `mechrevo-gm5hg0a` |
|
||||||
| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `<nixos-hardware/nxp/imx8mp-evk>` | `nxp-imx8mp-evk` |
|
| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `<nixos-hardware/nxp/imx8mp-evk>` | `nxp-imx8mp-evk` |
|
||||||
| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `<nixos-hardware/nxp/imx8mq-evk>` | `nxp-imx8mq-evk` |
|
| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `<nixos-hardware/nxp/imx8mq-evk>` | `nxp-imx8mq-evk` |
|
||||||
| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `<nixos-hardware/hardkernel/odroid-hc4>` | `hardkernel-odroid-hc4` |
|
| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `<nixos-hardware/hardkernel/odroid-hc4>` | `hardkernel-odroid-hc4` |
|
||||||
| [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `<nixos-hardware/hardkernel/odroid-h3>` | `hardkernel-odroid-h3` |
|
| [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `<nixos-hardware/hardkernel/odroid-h3>` | `hardkernel-odroid-h3` |
|
||||||
| [Hardkernel Odroid H4](hardkernel/odroid-h4/default.nix) | `<nixos-hardware/hardkernel/odroid-h4>` | `hardkernel-odroid-h4` |
|
| [Hardkernel Odroid H4](hardkernel/odroid-h4/default.nix) | `<nixos-hardware/hardkernel/odroid-h4>` | `hardkernel-odroid-h4` |
|
||||||
|
| [Olimex TERES-I](olimex/teres_i) | `<nixos-hardware/olimex/teres_i>` | `olimex-teres_i` |
|
||||||
| [Omen 14-fb0798ng](omen/14-fb0798ng) | `<nixos-hardware/omen/14-fb0798ng>` | `omen-14-fb0798ng` |
|
| [Omen 14-fb0798ng](omen/14-fb0798ng) | `<nixos-hardware/omen/14-fb0798ng>` | `omen-14-fb0798ng` |
|
||||||
| [Omen 15-ce002ns](omen/15-ce002ns) | `<nixos-hardware/omen/15-ce002ns>` | `omen-15-ce002ns` |
|
| [Omen 15-ce002ns](omen/15-ce002ns) | `<nixos-hardware/omen/15-ce002ns>` | `omen-15-ce002ns` |
|
||||||
| [Omen 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` | `omen-15-en0010ca` |
|
| [Omen 15-en0010ca](omen/15-en0010ca) | `<nixos-hardware/omen/15-en0010ca>` | `omen-15-en0010ca` |
|
||||||
@@ -390,6 +404,7 @@ See code for all available configurations.
|
|||||||
| [Omen 15-en1007sa](omen/15-en1007sa) | `<nixos-hardware/omen/15-en1007sa>` | `omen-15-en1007sa` |
|
| [Omen 15-en1007sa](omen/15-en1007sa) | `<nixos-hardware/omen/15-en1007sa>` | `omen-15-en1007sa` |
|
||||||
| [Omen 15-en0002np](omen/15-en0002np) | `<nixos-hardware/omen/15-en0002np>` | `omen-15-en0002np` |
|
| [Omen 15-en0002np](omen/15-en0002np) | `<nixos-hardware/omen/15-en0002np>` | `omen-15-en0002np` |
|
||||||
| [One-Netbook OneNetbook 4](onenetbook/4) | `<nixos-hardware/onenetbook/4>` | `onenetbook-4` |
|
| [One-Netbook OneNetbook 4](onenetbook/4) | `<nixos-hardware/onenetbook/4>` | `onenetbook-4` |
|
||||||
|
| [Panasonic Let's Note CF-LX3](panasonic/letsnote/cf-lx3) | `<nixos-hardware/panasonic/letsnote/cf-lx3>` | `panasonic-letsnote-cf-lx3` |
|
||||||
| [Panasonic Let's Note CF-LX4](panasonic/letsnote/cf-lx4) | `<nixos-hardware/panasonic/letsnote/cf-lx4>` | `letsnote-cf-lx4` |
|
| [Panasonic Let's Note CF-LX4](panasonic/letsnote/cf-lx4) | `<nixos-hardware/panasonic/letsnote/cf-lx4>` | `letsnote-cf-lx4` |
|
||||||
| [PC Engines APU](pcengines/apu) | `<nixos-hardware/pcengines/apu>` | `pcengines-apu` |
|
| [PC Engines APU](pcengines/apu) | `<nixos-hardware/pcengines/apu>` | `pcengines-apu` |
|
||||||
| [PINE64 Pinebook Pro](pine64/pinebook-pro/) | `<nixos-hardware/pine64/pinebook-pro>` | `pine64-pinebook-pro` |
|
| [PINE64 Pinebook Pro](pine64/pinebook-pro/) | `<nixos-hardware/pine64/pinebook-pro>` | `pine64-pinebook-pro` |
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
"bcma"
|
"bcma"
|
||||||
];
|
];
|
||||||
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
|
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
|
||||||
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../.
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -3,8 +3,6 @@
|
|||||||
{
|
{
|
||||||
imports = [ ../. ];
|
imports = [ ../. ];
|
||||||
|
|
||||||
boot.kernelModules = [ "wl" ];
|
|
||||||
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
boot.blacklistedKernelModules = [ "bcma" ];
|
boot.blacklistedKernelModules = [ "bcma" ];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
|||||||
@@ -6,9 +6,5 @@
|
|||||||
../../../common/cpu/intel/haswell
|
../../../common/cpu/intel/haswell
|
||||||
];
|
];
|
||||||
|
|
||||||
# broadcom-wl
|
|
||||||
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
||||||
# nixos-generate-config doesn't detect this automatically.
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [ broadcom_sta ];
|
|
||||||
boot.kernelModules = [ "wl" ];
|
|
||||||
}
|
}
|
||||||
@@ -31,10 +31,14 @@ in
|
|||||||
wantedBy = [
|
wantedBy = [
|
||||||
"local-fs.target"
|
"local-fs.target"
|
||||||
"suspend.target"
|
"suspend.target"
|
||||||
|
"suspend-then-hibernate.target"
|
||||||
|
"hibernate.target"
|
||||||
];
|
];
|
||||||
after = [
|
after = [
|
||||||
"local-fs.target"
|
"local-fs.target"
|
||||||
"suspend.target"
|
"suspend.target"
|
||||||
|
"suspend-then-hibernate.target"
|
||||||
|
"hibernate.target"
|
||||||
];
|
];
|
||||||
description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%";
|
description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%";
|
||||||
startLimitBurst = 5;
|
startLimitBurst = 5;
|
||||||
|
|||||||
@@ -25,10 +25,6 @@
|
|||||||
lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8")
|
lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8")
|
||||||
[ "rtc_cmos.use_acpi_alarm=1" ];
|
[ "rtc_cmos.use_acpi_alarm=1" ];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
# Adds the missing asus functionality to Linux.
|
# Adds the missing asus functionality to Linux.
|
||||||
# https://asus-linux.org/manual/asusctl-manual/
|
# https://asus-linux.org/manual/asusctl-manual/
|
||||||
services = {
|
services = {
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../common/cpu/intel/skylake
|
||||||
|
../../common/gpu/nvidia/maxwell
|
||||||
|
../../common/gpu/nvidia/prime.nix
|
||||||
|
../../common/pc/laptop
|
||||||
|
../../common/pc/ssd
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.nvidia.prime = {
|
||||||
|
intelBusId = "PCI:0:2:0";
|
||||||
|
nvidiaBusId = "PCI:1:0:0";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkDefault;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../common/cpu/amd
|
||||||
|
../../../common/cpu/amd/pstate.nix
|
||||||
|
|
||||||
|
# iGPU
|
||||||
|
../../../common/gpu/amd
|
||||||
|
|
||||||
|
# dGPU
|
||||||
|
../../../common/gpu/nvidia/prime.nix
|
||||||
|
../../../common/gpu/nvidia/ampere
|
||||||
|
|
||||||
|
../../../common/pc/laptop
|
||||||
|
../../../common/pc/ssd
|
||||||
|
|
||||||
|
../../battery.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.nvidia = {
|
||||||
|
dynamicBoost.enable = mkDefault true;
|
||||||
|
|
||||||
|
powerManagement = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
finegrained = mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
|
prime = {
|
||||||
|
amdgpuBusId = "PCI:1:0:0";
|
||||||
|
nvidiaBusId = "PCI:101:0:0";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
{ config, lib, ... }:
|
{ lib, config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ../. ];
|
imports = [ ../. ];
|
||||||
|
|
||||||
# Gnome 40 introduced a new way of managing power, without tlp.
|
config.services.power-profiles-daemon.enable = lib.mkDefault (!config.services.tlp.enable);
|
||||||
# However, these 2 services clash when enabled simultaneously.
|
|
||||||
# https://github.com/NixOS/nixos-hardware/issues/260
|
|
||||||
services.tlp.enable = lib.mkDefault (
|
|
||||||
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
|
||||||
|| !config.services.power-profiles-daemon.enable
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
# UCM-iMX95 SOM support
|
||||||
|
|
||||||
|
## Supported devices
|
||||||
|
- [UCM-iMX95 System-on-Module](https://www.compulab.com/products/som-evaluation-kits/ucm-imx95-evaluation-kit/) (**ucm-imx95**) – based on the NXP i.MX95 SoC (A0 silicon), with device-specific boot components(OEI, SM, ATF), U-Boot, and Linux kernel support, including a NixOS configuration example.
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
This overlay provides configuration and hardware support for the **CompuLab UCM-iMX95** platform, based on the **NXP i.MX95 A0 silicon**. It enables generating NixOS images suitable for booting via U-Boot, using the CompuLab UCM-iMX95 Evaluation Kit carrier board.
|
||||||
|
|
||||||
|
### Boot flow
|
||||||
|
The boot flow for the UCM-iMX95 platform follows the standard NXP i.MX95 sequence:
|
||||||
|
|
||||||
|
Boot ROM → OEI (initially in TCM, then DDR) → System Manager (SM) → ARM Trusted Firmware (ATF) → U-Boot → Linux kernel → NixOS userspace
|
||||||
|
|
||||||
|
Boot ROM initializes the SoC and loads OEI, which runs in TCM to perform early setup, then configures DDR and loads the System Manager (SM). SM completes SoC initialization and passes control to ATF, which handles secure world setup and then transfers execution to U-Boot, eventually booting the Linux kernel and NixOS root filesystem.
|
||||||
|
|
||||||
|
### Example NixOS configuration
|
||||||
|
```nix
|
||||||
|
{ nixos-hardware, }: {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
modules = [
|
||||||
|
nixos-hardware.nixosModules.ucm-imx95
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building Boot Images
|
||||||
|
|
||||||
|
The boot image for flashing to SD cards can be built directly from the flake:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build boot image for UCM-iMX95
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.ucm-imx95-boot
|
||||||
|
```
|
||||||
|
|
||||||
|
The boot image will be available at `./result/image/flash.bin`.
|
||||||
|
|
||||||
|
**Note:** These packages target `aarch64-linux`. If you're on a different architecture (e.g., x86_64-linux), you'll need remote builders configured for aarch64-linux.
|
||||||
|
|
||||||
|
### Flashing to SD Card
|
||||||
|
|
||||||
|
Once built, you can flash the boot image to an SD card:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Write boot image to SD card at 32KB offset (adjust /dev/sdX to your SD card device)
|
||||||
|
sudo dd if=./result/image/flash.bin of=/dev/sdX bs=1k seek=32 conv=fsync
|
||||||
|
```
|
||||||
|
|
||||||
|
**Warning:** Double-check the device path to avoid overwriting the wrong disk!
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
- The configuration, including device-tree, kernel, and bootloader components, is optimized for the UCM-iMX95 SoM and EVK.
|
||||||
|
- The generated NixOS image supports booting from SD card or eMMC, depending on the hardware configuration.
|
||||||
|
- The boot components (OEI in TCM/DDR, SM, ATF, U-Boot) follow the standard NXP release layout for i.MX95 platforms.
|
||||||
|
|
||||||
|
### Upstream Documentation
|
||||||
|
- [NXP i.MX95 EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx95_evk.html)
|
||||||
|
- [CompuLab UCM-iMX95 Product Page](https://www.compulab.com/products/computer-on-modules/ucm-imx95-nxp-i-mx-95-som-system-on-module/)
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
pkgsCross,
|
||||||
|
openssl,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
target-board = "imx95";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-atf";
|
||||||
|
version = "2.13.0";
|
||||||
|
platform = target-board;
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-atf";
|
||||||
|
rev = "28affcae957cb8194917b5246276630f9e6343e1";
|
||||||
|
sha256 = "sha256-a8F+Lf8pwML+tCwawS0N/mrSXWPmFhlUeOg0MCRK3VE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Compiler dependencies
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgsCross.aarch64-embedded.stdenv.cc
|
||||||
|
openssl
|
||||||
|
];
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"HOSTCC=$(CC_FOR_BUILD)"
|
||||||
|
"CROSS_COMPILE=${pkgsCross.aarch64-embedded.stdenv.cc.targetPrefix}"
|
||||||
|
"PLAT=${platform}"
|
||||||
|
"SPD=opteed"
|
||||||
|
"bl31"
|
||||||
|
"LDFLAGS=-no-warn-rwx-segments"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/${target-board}/release/bl31.bin $out
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-atf";
|
||||||
|
description = "Reference implementation of secure world software for ARMv8-A";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
{
|
||||||
|
callPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenv,
|
||||||
|
clang,
|
||||||
|
git,
|
||||||
|
dtc,
|
||||||
|
glibc,
|
||||||
|
zlib,
|
||||||
|
vim,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
|
||||||
|
imx95-atf = callPackage ./ucm-imx95-atf.nix { };
|
||||||
|
imx95-firmware = callPackage ./ucm-imx95-firmware.nix { };
|
||||||
|
imx95-uboot = callPackage ./ucm-imx95-uboot.nix { };
|
||||||
|
imx95-optee-os = callPackage ./ucm-imx95-optee-os.nix { };
|
||||||
|
imx95-sm-fw = callPackage ./ucm-imx95-sm-fw.nix { };
|
||||||
|
imx95-oei-ddr = callPackage ./ucm-imx95-oei-ddr.nix { };
|
||||||
|
imx95-oei-tcm = callPackage ./ucm-imx95-oei-tcm.nix { };
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-mkimage";
|
||||||
|
#tag: lf-6.6.52-2.2.1
|
||||||
|
rev = "f620fb8ef7a04c8dbed8119880f5eeffe3e69746";
|
||||||
|
sha256 = "sha256-JZlX122uZntCIISI1H3Hw+tnk+N/gBJpFFDaZoY8W3c=";
|
||||||
|
};
|
||||||
|
shortRev = builtins.substring 0 8 src.rev;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imx95-boot = stdenv.mkDerivation rec {
|
||||||
|
inherit src;
|
||||||
|
name = "imx95-mkimage";
|
||||||
|
version = "lf-6.6.52-2.2.1";
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail 'CC = gcc' 'CC = clang'
|
||||||
|
substituteInPlace iMX95/soc.mak \
|
||||||
|
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_fcb_gen.sh \
|
||||||
|
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_packer.sh \
|
||||||
|
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
clang
|
||||||
|
git
|
||||||
|
dtc
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
glibc.static
|
||||||
|
zlib
|
||||||
|
zlib.static
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
if [ -f ${imx95-uboot}/u-boot.bin ]; then
|
||||||
|
install -m 0644 ${imx95-uboot}/u-boot.bin ./iMX95/u-boot.bin
|
||||||
|
else
|
||||||
|
cat ${imx95-uboot}/u-boot-nodtb.bin ${imx95-uboot}/ucm-imx95.dtb > ./iMX95/u-boot.bin
|
||||||
|
fi
|
||||||
|
install -m 0644 ${imx95-uboot}/u-boot-spl.bin ./iMX95/u-boot-spl.bin
|
||||||
|
install -m 0644 ${imx95-uboot}/u-boot-nodtb.bin ./iMX95/u-boot-nodtb.bin
|
||||||
|
install -m 0644 ${imx95-uboot}/ucm-imx95.dtb ./iMX95/ucm-imx95.dtb
|
||||||
|
install -m 0644 ${imx95-optee-os}/tee.bin ./iMX95/tee.bin
|
||||||
|
install -m 0644 ${imx95-atf}/bl31.bin ./iMX95/bl31.bin
|
||||||
|
install -m 0644 ${imx95-sm-fw}/m33_image.bin ./iMX95/m33_image.bin
|
||||||
|
install -m 0644 ${imx95-oei-ddr}/oei-m33-ddr.bin ./iMX95/oei-m33-ddr.bin
|
||||||
|
install -m 0644 ${imx95-oei-tcm}/oei-m33-tcm.bin ./iMX95/oei-m33-tcm.bin
|
||||||
|
install -m 0644 ${imx95-firmware}/ddr/lpddr5* ./iMX95/
|
||||||
|
install -m 0644 ${imx95-firmware}/ahab/mx95a0-ahab-container.img ./iMX95/
|
||||||
|
install -m 0644 ${imx95-firmware}/m7_image.bin ./iMX95/
|
||||||
|
|
||||||
|
make SOC=iMX95 REV=A0 OEI=YES LPDDR_TYPE=lpddr5 flash_all
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out/image
|
||||||
|
install -m 0644 ./iMX95/flash.bin $out/image
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
fetchurl,
|
||||||
|
coreutils,
|
||||||
|
bash,
|
||||||
|
siliconRev ? "A0",
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "nxp-firmware-imx95";
|
||||||
|
version = "nxp-firmware-8.28-994fa14";
|
||||||
|
|
||||||
|
m7Firmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx95-m7-demo-25.09.00.bin";
|
||||||
|
sha256 = "sha256-3nA6uka6WPtXH5aZhaaKHKRM0tJ0pxHQdPEupNic1Ks=";
|
||||||
|
};
|
||||||
|
|
||||||
|
ddrFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.28-994fa14.bin";
|
||||||
|
sha256 = "sha256-VZlvNA6HglaFoAzTCZARiQZuyVRe5gdzT5QsPN5Nadw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
ahabFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-ele-imx-2.0.2-89161a8.bin";
|
||||||
|
sha256 = "sha256-LSnwpN42YroV9qfZBpcC1OrtQV2WoX8p1bEn8sb91jQ=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
coreutils
|
||||||
|
bash
|
||||||
|
];
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
export SILICON=${siliconRev}
|
||||||
|
|
||||||
|
# M7 firmware
|
||||||
|
echo "Copying M7 firmware..."
|
||||||
|
cp ${m7Firmware} $out/m7_image.bin
|
||||||
|
|
||||||
|
# DDR firmware
|
||||||
|
cp ${ddrFirmware} ./firmware-imx-8.28-994fa14.bin
|
||||||
|
chmod +x firmware-imx-8.28-994fa14.bin
|
||||||
|
./firmware-imx-8.28-994fa14.bin --auto-accept
|
||||||
|
|
||||||
|
mkdir -p $out/ddr
|
||||||
|
# Resolve wildcard and verify at least one file matches
|
||||||
|
lpddr5_files=(firmware-imx-8.28-994fa14/firmware/ddr/synopsys/lpddr5*v202409.bin)
|
||||||
|
if [ ''${#lpddr5_files[@]} -eq 0 ]; then
|
||||||
|
echo "ERROR: No lpddr5*v202409.bin file found in firmware/ddr/synopsys/" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cp "''${lpddr5_files[@]}" $out/ddr/
|
||||||
|
|
||||||
|
# AHAB container
|
||||||
|
cp ${ahabFirmware} ./firmware-ele-imx-2.0.2-89161a8.bin
|
||||||
|
chmod +x firmware-ele-imx-2.0.2-89161a8.bin
|
||||||
|
./firmware-ele-imx-2.0.2-89161a8.bin --auto-accept
|
||||||
|
|
||||||
|
mkdir -p $out/ahab
|
||||||
|
if [ "$SILICON" = "A0" ]; then
|
||||||
|
cp firmware-ele-imx-2.0.2-89161a8/mx95a0-ahab-container.img $out/ahab/
|
||||||
|
elif [ "$SILICON" = "B0" ]; then
|
||||||
|
cp firmware-ele-imx-2.0.2-89161a8/mx95b0-ahab-container.img $out/ahab/
|
||||||
|
else
|
||||||
|
echo "ERROR: Invalid SILICON value '$SILICON'. Must be 'A0' or 'B0'." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildLinux,
|
||||||
|
fetchFromGitHub,
|
||||||
|
...
|
||||||
|
}@args:
|
||||||
|
buildLinux (
|
||||||
|
args
|
||||||
|
// rec {
|
||||||
|
version = "6.6.36";
|
||||||
|
name = "imx95-linux";
|
||||||
|
|
||||||
|
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
||||||
|
modDirVersion = version;
|
||||||
|
|
||||||
|
defconfig = "compulab-mx95_defconfig";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will fail.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
|
|
||||||
|
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 = "compulab-yokneam";
|
||||||
|
repo = "linux-compulab";
|
||||||
|
# tag: linux-compulab_6.6.36
|
||||||
|
rev = "b93daaad0807fb15d4f3f1a6e5be843ac7532ef7";
|
||||||
|
sha256 = "sha256-wCeuGXBTz3H6OFWBA1M1/t/9WgxBVjQ8FU/wvAUVW2w=";
|
||||||
|
};
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/compulab-yokneam/linux-compulab";
|
||||||
|
license = licenses.gpl2Only;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// (args.argsOverride or { })
|
||||||
|
)
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
gcc-arm-embedded,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchpatch,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-imx-oei";
|
||||||
|
version = "lf-6.6.36-2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
buildPackages.python3
|
||||||
|
gcc-arm-embedded
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-oei";
|
||||||
|
rev = "5fca9f47544d03c52ca371eadfffbfd2454e6925";
|
||||||
|
sha256 = "sha256-Sb6u1NlhJpDCOKBu3HqUb4BLEy0F8LYVnJE0tRSvzWc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
|
||||||
|
sha256 = "sha256-6ZpBOXw2aIhD2i9Wx368xfHq6NvdZghWHU9u8+gRTj8=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0002-board-mx95lp5-Fix-default-DDR_CONFIG-timing-name.patch";
|
||||||
|
sha256 = "sha256-WZ/vYaTC2iKIC+jnHtnPriCxK9gjRsOv2Uy13Ye4698=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0003-Add-CompuLab-lpddr5_timing_4g.c.patch";
|
||||||
|
sha256 = "sha256-yyierv2USZlM8Cuxf4FDj4+UtILvJQH9BJSj+fmayL8=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace oei/makefiles/build_info.mak \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"board=mx95lp5"
|
||||||
|
"CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"OEI_CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"ARCH=arm"
|
||||||
|
"DDR_CONFIG=lpddr5_timing"
|
||||||
|
"oei=ddr"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/mx95lp5/ddr/oei-m33-ddr.bin $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-oei";
|
||||||
|
description = "Optional Executable Image assembler for i.MX95 processors";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
gcc-arm-embedded,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchpatch,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-imx-oei-tcm";
|
||||||
|
version = "lf-6.6.36-2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
buildPackages.python3
|
||||||
|
gcc-arm-embedded
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-oei";
|
||||||
|
rev = "5fca9f47544d03c52ca371eadfffbfd2454e6925";
|
||||||
|
sha256 = "sha256-Sb6u1NlhJpDCOKBu3HqUb4BLEy0F8LYVnJE0tRSvzWc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
|
||||||
|
sha256 = "sha256-6ZpBOXw2aIhD2i9Wx368xfHq6NvdZghWHU9u8+gRTj8=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0002-board-mx95lp5-Fix-default-DDR_CONFIG-timing-name.patch";
|
||||||
|
sha256 = "sha256-WZ/vYaTC2iKIC+jnHtnPriCxK9gjRsOv2Uy13Ye4698=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0003-Add-CompuLab-lpddr5_timing_4g.c.patch";
|
||||||
|
sha256 = "sha256-yyierv2USZlM8Cuxf4FDj4+UtILvJQH9BJSj+fmayL8=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace oei/makefiles/build_info.mak \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"board=mx95lp5"
|
||||||
|
"CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"OEI_CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"ARCH=arm"
|
||||||
|
"DDR_CONFIG=lpddr5_timing"
|
||||||
|
"oei=tcm"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/mx95lp5/tcm/oei-m33-tcm.bin $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-oei";
|
||||||
|
description = "Optional Executable Image assembler for i.MX95 processors";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPackages,
|
||||||
|
bash,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (buildPackages) python3;
|
||||||
|
toolchain = stdenv.cc;
|
||||||
|
binutils = stdenv.cc.bintools.bintools_bin;
|
||||||
|
cpp = stdenv.cc;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "imx95-optee-os";
|
||||||
|
version = "lf-6.6.36_2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
python3
|
||||||
|
];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
|
pycryptodomex
|
||||||
|
pyelftools
|
||||||
|
cryptography
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-optee-os";
|
||||||
|
rev = "612bc5a642a4608d282abeee2349d86de996d7ee";
|
||||||
|
sha256 = "sha256-l8GKkrlBs5kgw6jrzGLT9WAeTSDqo8XWZDFT2+Fisv4=";
|
||||||
|
};
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-optee-os";
|
||||||
|
license = licenses.bsd2;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace scripts/arm32_sysreg.py \
|
||||||
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
|
substituteInPlace scripts/gen_tee_bin.py \
|
||||||
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
|
substituteInPlace scripts/pem_to_pub_c.py \
|
||||||
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
|
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
||||||
|
--replace-fail '/bin/bash' '${bash}/bin/bash'
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/${toolchain.targetPrefix}cpp
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"PLATFORM=imx-mx95evk"
|
||||||
|
"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
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
gcc-arm-embedded,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchpatch,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
metaBspImx95Rev = "224eed17cddc573061150e9d2ce6f9acb39ea50e"; # scarthgap-6.6.36-EVAL-UCM-iMX95-1.0
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx95-sm-fw";
|
||||||
|
version = "lf-6.6.36-2.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
buildPackages.python3
|
||||||
|
gcc-arm-embedded
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = with buildPackages.python3.pkgs; [
|
||||||
|
pycryptodomex
|
||||||
|
pyelftools
|
||||||
|
cryptography
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "imx-sm";
|
||||||
|
rev = "709deccd9338399eb39b5cf99a60eab4fa60d539";
|
||||||
|
sha256 = "sha256-02Cl+XhWGSFswspdBJ/4B/mBm4XTs/qKotx0BXMQpJk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0001-Add-mcimx95cust-board.patch";
|
||||||
|
sha256 = "sha256-zvZ4bNew+yRPmaZQMrAH087KpCLRqz6zdElfe72Dtuc=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0002-Fix-null-pionter-except.patch";
|
||||||
|
sha256 = "sha256-q72VEvJqm2CmOxdWMqGibgXS5lY08mC4srEcy00QdrE=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0001-update-for-yocto-6.6.36-compatibility.patch";
|
||||||
|
sha256 = "sha256-JzHqDiD/ZOu6VQQI0JxY17RQ3bA2t1aP3O1sjLPguWs=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0003-sm-Disable-GPIO1-10-interrupt.patch";
|
||||||
|
sha256 = "sha256-dhcDv7Uq856+MBonczMPznk+tuqUFxTcHiKLX+myCVA=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0004-configs-mx95cust-change-LPTPM1-ownership.patch";
|
||||||
|
sha256 = "sha256-NcLu6+zXpiSz1bHKW14Zuf6F/4pzKsekb+zaRtKjSTY=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace sm/makefiles/gcc_cross.mak \
|
||||||
|
--replace-fail "\$(SM_CROSS_COMPILE)objcopy" ${gcc-arm-embedded}/bin/arm-none-eabi-objcopy
|
||||||
|
substituteInPlace sm/makefiles/build_info.mak \
|
||||||
|
--replace-fail "/bin/echo" "echo"
|
||||||
|
substituteInPlace sm/makefiles/gcc_cross.mak \
|
||||||
|
--replace-fail 'SM_CROSS_COMPILE ?= $(TOOLS)/arm-gnu-toolchain-*-none-eabi/bin/arm-none-eabi-' \
|
||||||
|
'SM_CROSS_COMPILE ?= $(CROSS_COMPILE)'
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"config=mx95cust"
|
||||||
|
"M=2"
|
||||||
|
"CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"CROSS_COMPILE64=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||||
|
"ARCH=arm"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/mx95cust/m33_image.bin $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-sm";
|
||||||
|
description = "System Manager firmware for i.MX processors";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = [
|
||||||
|
{
|
||||||
|
name = "Govind Singh";
|
||||||
|
email = "govind.singh@tii.ae";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
lib,
|
||||||
|
bison,
|
||||||
|
dtc,
|
||||||
|
fetchFromGitHub,
|
||||||
|
flex,
|
||||||
|
gnutls,
|
||||||
|
libuuid,
|
||||||
|
ncurses,
|
||||||
|
openssl,
|
||||||
|
which,
|
||||||
|
perl,
|
||||||
|
buildPackages,
|
||||||
|
efitools,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
ubsrc = fetchFromGitHub {
|
||||||
|
owner = "compulab-yokneam";
|
||||||
|
repo = "u-boot-compulab";
|
||||||
|
# tag: lf_v2024.04
|
||||||
|
rev = "824401fe487d7d3cbcf251bd60270bd7fe8d21d0";
|
||||||
|
sha256 = "sha256-m+YW7+XF/jcNKfyb5533LXGyOWvStqY+MCczAdcNGZI=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "imx95-uboot";
|
||||||
|
version = "2024.04";
|
||||||
|
src = ubsrc;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs tools
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
bison
|
||||||
|
flex
|
||||||
|
openssl
|
||||||
|
which
|
||||||
|
ncurses
|
||||||
|
libuuid
|
||||||
|
gnutls
|
||||||
|
openssl
|
||||||
|
perl
|
||||||
|
efitools
|
||||||
|
];
|
||||||
|
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"DTC=${lib.getExe buildPackages.dtc}"
|
||||||
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
CONFIG_USE_BOOTCOMMAND=y
|
||||||
|
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x97000000; setenv fdt_addr_r 0x96000000; 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
|
||||||
|
'';
|
||||||
|
|
||||||
|
passAsFile = [ "extraConfig" ];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
make ucm-imx95_defconfig
|
||||||
|
cat $extraConfigPath >> .config
|
||||||
|
make olddefconfig
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp ./u-boot-nodtb.bin $out
|
||||||
|
cp ./spl/u-boot-spl.bin $out
|
||||||
|
cp ./arch/arm/dts/ucm-imx95.dtb $out
|
||||||
|
cp .config $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
dontStrip = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import ./overlay.nix)
|
||||||
|
];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./modules.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.grub.extraFiles = {
|
||||||
|
"ucm-imx95.dtb" = "${pkgs.callPackage ./bsp/ucm-imx95-linux.nix { }}/dtbs/compulab/ucm-imx95.dtb";
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.deviceTree = {
|
||||||
|
filter = "ucm-imx95.dtb";
|
||||||
|
name = "ucm-imx95.dtb";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/ucm-imx95-linux.nix { });
|
||||||
|
initrd.includeDefaultModules = lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
disabledModules = [ "profiles/all-hardware.nix" ];
|
||||||
|
|
||||||
|
hardware.deviceTree.enable = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
final: _prev: {
|
||||||
|
inherit (final.callPackage ./bsp/ucm-imx95-boot.nix { }) imx95-boot;
|
||||||
|
}
|
||||||
@@ -8,6 +8,3 @@
|
|||||||
`fwupd` is used to receive firmware updates from vendors. This device is in its [supported devices list](https://fwupd.org/lvfs/devices/)
|
`fwupd` is used to receive firmware updates from vendors. This device is in its [supported devices list](https://fwupd.org/lvfs/devices/)
|
||||||
|
|
||||||
`thermald` is used to achieve better thermal behaviour
|
`thermald` is used to achieve better thermal behaviour
|
||||||
|
|
||||||
##### TLP
|
|
||||||
TLP is a battery power optimizer for laptops. It is enabled by default, however, since it conflicts with power-profiles-daemon which is GNOME's power management system, TLP will not be installed with if power-profiles-daemon or a recent version of GNOME is present.
|
|
||||||
@@ -6,16 +6,8 @@
|
|||||||
../../../common/pc/laptop
|
../../../common/pc/laptop
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware.enableAllFirmware = lib.mkDefault true;
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
fwupd.enable = lib.mkDefault true;
|
fwupd.enable = lib.mkDefault true;
|
||||||
thermald.enable = lib.mkDefault true;
|
thermald.enable = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
|
||||||
# needs to be explicitly loaded or else bluetooth/wifi won't work.
|
|
||||||
kernelModules = [ "wl" ];
|
|
||||||
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -13,11 +13,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
# needs to be explicitly loaded or else bluetooth/wifi won't work
|
|
||||||
kernelModules = [
|
kernelModules = [
|
||||||
"kvm-intel"
|
"kvm-intel"
|
||||||
"wl"
|
|
||||||
];
|
];
|
||||||
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,39 @@
|
|||||||
description = "nixos-hardware";
|
description = "nixos-hardware";
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{ ... }:
|
{ self, ... }:
|
||||||
|
let
|
||||||
|
# Import private inputs (for development)
|
||||||
|
privateInputs =
|
||||||
|
(import ./tests/flake-compat.nix {
|
||||||
|
src = ./tests;
|
||||||
|
}).defaultNix;
|
||||||
|
|
||||||
|
systems = [
|
||||||
|
"aarch64-linux"
|
||||||
|
"riscv64-linux"
|
||||||
|
"x86_64-linux"
|
||||||
|
];
|
||||||
|
|
||||||
|
formatSystems = [
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Helper to iterate over systems
|
||||||
|
eachSystem =
|
||||||
|
f:
|
||||||
|
privateInputs.nixos-unstable-small.lib.genAttrs systems (
|
||||||
|
system: f privateInputs.nixos-unstable-small.legacyPackages.${system} system
|
||||||
|
);
|
||||||
|
|
||||||
|
eachSystemFormat =
|
||||||
|
f:
|
||||||
|
privateInputs.nixos-unstable-small.lib.genAttrs formatSystems (
|
||||||
|
system: f privateInputs.nixos-unstable-small.legacyPackages.${system} system
|
||||||
|
);
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
nixosModules =
|
nixosModules =
|
||||||
@@ -20,6 +52,7 @@
|
|||||||
apple-imac-18-2 = import ./apple/imac/18-2;
|
apple-imac-18-2 = import ./apple/imac/18-2;
|
||||||
apple-macbook-air-3 = import ./apple/macbook-air/3;
|
apple-macbook-air-3 = import ./apple/macbook-air/3;
|
||||||
apple-macbook-air-4 = import ./apple/macbook-air/4;
|
apple-macbook-air-4 = import ./apple/macbook-air/4;
|
||||||
|
apple-macbook-air-5 = import ./apple/macbook-air/5;
|
||||||
apple-macbook-air-6 = import ./apple/macbook-air/6;
|
apple-macbook-air-6 = import ./apple/macbook-air/6;
|
||||||
apple-macbook-air-7 = import ./apple/macbook-air/7;
|
apple-macbook-air-7 = import ./apple/macbook-air/7;
|
||||||
apple-macbook-pro = import ./apple/macbook-pro;
|
apple-macbook-pro = import ./apple/macbook-pro;
|
||||||
@@ -42,12 +75,14 @@
|
|||||||
asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu;
|
asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu;
|
||||||
asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia;
|
asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia;
|
||||||
asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;
|
asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace;
|
||||||
|
asus-rog-gl552vw = import ./asus/rog-gl552vw;
|
||||||
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
|
asus-rog-strix-g513im = import ./asus/rog-strix/g513im;
|
||||||
asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw;
|
asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw;
|
||||||
asus-rog-strix-g533q = import ./asus/rog-strix/g533q;
|
asus-rog-strix-g533q = import ./asus/rog-strix/g533q;
|
||||||
asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie;
|
asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie;
|
||||||
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
|
asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
|
||||||
asus-rog-strix-x570e = import ./asus/rog-strix/x570e;
|
asus-rog-strix-x570e = import ./asus/rog-strix/x570e;
|
||||||
|
asus-zenbook-um6702 = import ./asus/zenbook/um6702;
|
||||||
asus-zenbook-ux371 = import ./asus/zenbook/ux371;
|
asus-zenbook-ux371 = import ./asus/zenbook/ux371;
|
||||||
asus-zenbook-ux535 = import ./asus/zenbook/ux535;
|
asus-zenbook-ux535 = import ./asus/zenbook/ux535;
|
||||||
asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu;
|
asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu;
|
||||||
@@ -235,6 +270,8 @@
|
|||||||
lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3;
|
lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3;
|
||||||
lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4;
|
lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4;
|
||||||
lenovo-thinkpad-t14-amd-gen5 = import ./lenovo/thinkpad/t14/amd/gen5;
|
lenovo-thinkpad-t14-amd-gen5 = import ./lenovo/thinkpad/t14/amd/gen5;
|
||||||
|
lenovo-thinkpad-t14-intel-gen1 = import ./lenovo/thinkpad/t14/intel/gen1;
|
||||||
|
lenovo-thinkpad-t14-intel-gen1-nvidia = import ./lenovo/thinkpad/t14/intel/gen1/nvidia;
|
||||||
lenovo-thinkpad-t14-intel-gen6 = import ./lenovo/thinkpad/t14/intel/gen6;
|
lenovo-thinkpad-t14-intel-gen6 = import ./lenovo/thinkpad/t14/intel/gen6;
|
||||||
lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s;
|
lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s;
|
||||||
lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1;
|
lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1;
|
||||||
@@ -301,7 +338,9 @@
|
|||||||
lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid;
|
lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid;
|
||||||
lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10;
|
lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10;
|
||||||
lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8;
|
lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8;
|
||||||
|
letsnote-cf-lx3 = import ./panasonic/letsnote/cf-lx3;
|
||||||
letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4;
|
letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4;
|
||||||
|
linglong-nova-studio = import ./linglong/nova-studio;
|
||||||
malibal-aon-s1-intel = import ./malibal/aon/s1;
|
malibal-aon-s1-intel = import ./malibal/aon/s1;
|
||||||
mechrevo-gm5hg0a = import ./mechrevo/GM5HG0A;
|
mechrevo-gm5hg0a = import ./mechrevo/GM5HG0A;
|
||||||
microchip-icicle-kit = import ./microchip/icicle-kit;
|
microchip-icicle-kit = import ./microchip/icicle-kit;
|
||||||
@@ -313,15 +352,19 @@
|
|||||||
microsoft-surface-pro-9 = import ./microsoft/surface-pro/9;
|
microsoft-surface-pro-9 = import ./microsoft/surface-pro/9;
|
||||||
milkv-pioneer = import ./milkv/pioneer;
|
milkv-pioneer = import ./milkv/pioneer;
|
||||||
minisforum-v3 = import ./minisforum/v3;
|
minisforum-v3 = import ./minisforum/v3;
|
||||||
|
mnt-reform-rk3588 = import ./mnt/reform/rk3588;
|
||||||
morefine-m600 = import ./morefine/m600;
|
morefine-m600 = import ./morefine/m600;
|
||||||
msi-b350-tomahawk = import ./msi/b350-tomahawk;
|
msi-b350-tomahawk = import ./msi/b350-tomahawk;
|
||||||
msi-b550-a-pro = import ./msi/b550-a-pro;
|
msi-b550-a-pro = import ./msi/b550-a-pro;
|
||||||
|
msi-b550-tomahawk = import ./msi/b550-tomahawk;
|
||||||
msi-gs60 = import ./msi/gs60;
|
msi-gs60 = import ./msi/gs60;
|
||||||
msi-gl62 = import ./msi/gl62;
|
msi-gl62 = import ./msi/gl62;
|
||||||
msi-gl65-10SDR-492 = import ./msi/gl65/10SDR-492;
|
msi-gl65-10SDR-492 = import ./msi/gl65/10SDR-492;
|
||||||
nxp-imx8mp-evk = import ./nxp/imx8mp-evk;
|
nxp-imx8mp-evk = import ./nxp/imx8mp-evk;
|
||||||
nxp-imx8mq-evk = import ./nxp/imx8mq-evk;
|
nxp-imx8mq-evk = import ./nxp/imx8mq-evk;
|
||||||
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
|
nxp-imx8qm-mek = import ./nxp/imx8qm-mek;
|
||||||
|
nxp-imx93-evk = import ./nxp/imx93-evk;
|
||||||
|
ucm-imx95 = import ./compulab/ucm-imx95;
|
||||||
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
|
hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4;
|
||||||
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
|
hardkernel-odroid-h3 = import ./hardkernel/odroid-h3;
|
||||||
hardkernel-odroid-h4 = import ./hardkernel/odroid-h4;
|
hardkernel-odroid-h4 = import ./hardkernel/odroid-h4;
|
||||||
@@ -410,5 +453,48 @@
|
|||||||
common-pc-laptop-ssd = import ./common/pc/ssd;
|
common-pc-laptop-ssd = import ./common/pc/ssd;
|
||||||
common-pc-ssd = import ./common/pc/ssd;
|
common-pc-ssd = import ./common/pc/ssd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Add formatter for `nix fmt`
|
||||||
|
formatter = eachSystemFormat (
|
||||||
|
pkgs: _system:
|
||||||
|
(privateInputs.treefmt-nix.lib.evalModule pkgs ./tests/treefmt.nix).config.build.wrapper
|
||||||
|
);
|
||||||
|
|
||||||
|
# Add packages
|
||||||
|
packages = eachSystem (
|
||||||
|
pkgs: system:
|
||||||
|
{
|
||||||
|
run-tests = pkgs.callPackage ./tests/run-tests.nix {
|
||||||
|
inherit self;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// pkgs.lib.optionalAttrs (system == "aarch64-linux") {
|
||||||
|
# Boot images for NXP i.MX boards (aarch64-linux only)
|
||||||
|
ucm-imx95-boot = (pkgs.callPackage ./compulab/ucm-imx95/bsp/ucm-imx95-boot.nix { }).imx95-boot;
|
||||||
|
imx93-boot = (pkgs.callPackage ./nxp/imx93-evk/bsp/imx93-boot.nix { }).imx93-boot;
|
||||||
|
imx8mp-boot = (pkgs.callPackage ./nxp/imx8mp-evk/bsp/imx8mp-boot.nix { }).imx8m-boot;
|
||||||
|
imx8mq-boot = (pkgs.callPackage ./nxp/imx8mq-evk/bsp/imx8mq-boot.nix { }).imx8m-boot;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
# Add checks for `nix run .#run-tests`
|
||||||
|
checks = eachSystem (
|
||||||
|
pkgs: system:
|
||||||
|
let
|
||||||
|
treefmtEval = privateInputs.treefmt-nix.lib.evalModule pkgs ./tests/treefmt.nix;
|
||||||
|
nixosTests = import ./tests/nixos-tests.nix {
|
||||||
|
inherit
|
||||||
|
self
|
||||||
|
privateInputs
|
||||||
|
system
|
||||||
|
pkgs
|
||||||
|
;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.lib.optionalAttrs (self.formatter ? ${system}) {
|
||||||
|
formatting = treefmtEval.config.build.check self;
|
||||||
|
}
|
||||||
|
// nixosTests
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,7 @@
|
|||||||
../../../common/gpu/amd
|
../../../common/gpu/amd
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[
|
|
||||||
# There seems to be an issue with panel self-refresh (PSR) that
|
# There seems to be an issue with panel self-refresh (PSR) that
|
||||||
# causes hangs for users.
|
# causes hangs for users.
|
||||||
#
|
#
|
||||||
@@ -19,8 +18,4 @@
|
|||||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||||
"rtc_cmos.use_acpi_alarm=1"
|
"rtc_cmos.use_acpi_alarm=1"
|
||||||
];
|
];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
}
|
}
|
||||||
@@ -9,8 +9,7 @@
|
|||||||
../../../common/cpu/intel
|
../../../common/cpu/intel
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[
|
|
||||||
# For Power consumption
|
# For Power consumption
|
||||||
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
|
# https://community.frame.work/t/linux-battery-life-tuning/6665/156
|
||||||
"nvme.noacpi=1"
|
"nvme.noacpi=1"
|
||||||
|
|||||||
@@ -20,30 +20,6 @@
|
|||||||
lib.mkDefault pkgs.linuxPackages_latest
|
lib.mkDefault pkgs.linuxPackages_latest
|
||||||
);
|
);
|
||||||
|
|
||||||
# Intel NPU Driver
|
|
||||||
# https://discourse.nixos.org/t/new-installation-on-asus-zenbook-ux5406-intel-vpu-firmware-error-2/58732/2
|
|
||||||
hardware.firmware = lib.optionals (config.hardware.enableRedistributableFirmware) [
|
|
||||||
(
|
|
||||||
let
|
|
||||||
model = "37xx";
|
|
||||||
version = "0.0";
|
|
||||||
|
|
||||||
firmware = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/intel/linux-npu-driver/raw/v1.13.0/firmware/bin/vpu_${model}_v${version}.bin";
|
|
||||||
hash = "sha256-Mpoeq8HrwChjtHALsss/7QsFtDYAoFNsnhllU0xp3os=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.runCommand "intel-vpu-firmware-${model}-${version}" { } ''
|
|
||||||
mkdir -p "$out/lib/firmware/intel/vpu"
|
|
||||||
cp '${firmware}' "$out/lib/firmware/intel/vpu/vpu_${model}_v${version}.bin"
|
|
||||||
''
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
warnings = lib.mkIf (!config.hardware.enableRedistributableFirmware) [
|
|
||||||
''For Intel NPU support, set the option: hardware.enableRedistributableFirmware = true;''
|
|
||||||
];
|
|
||||||
|
|
||||||
hardware.framework.laptop13.audioEnhancement.rawDeviceName =
|
hardware.framework.laptop13.audioEnhancement.rawDeviceName =
|
||||||
lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo";
|
lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo";
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,7 @@
|
|||||||
../../../common/gpu/amd
|
../../../common/gpu/amd
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[
|
|
||||||
# There seems to be an issue with panel self-refresh (PSR) that
|
# There seems to be an issue with panel self-refresh (PSR) that
|
||||||
# causes hangs for users.
|
# causes hangs for users.
|
||||||
#
|
#
|
||||||
@@ -19,8 +18,4 @@
|
|||||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||||
"rtc_cmos.use_acpi_alarm=1"
|
"rtc_cmos.use_acpi_alarm=1"
|
||||||
];
|
];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
}
|
}
|
||||||
+13
-34
@@ -1,22 +1,26 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
kernel_version_compatible = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.hardware.framework.enableKmod =
|
options.hardware.framework.enableKmod =
|
||||||
(lib.mkEnableOption "Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs.")
|
(lib.mkEnableOption "the community-created Framework kernel module that allows interacting with the embedded controller from sysfs.")
|
||||||
// {
|
// {
|
||||||
# enable by default on NixOS >= 24.05 and kernel >= 6.10
|
# enable by default on NixOS >= 24.05 and kernel >= 6.10
|
||||||
default = lib.and (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") kernel_version_compatible;
|
default = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
|
||||||
defaultText = "enabled by default on NixOS >= 24.05 and kernel >= 6.10";
|
defaultText = "enabled by default if kernel >= 6.10";
|
||||||
};
|
};
|
||||||
|
|
||||||
config.boot = lib.mkIf config.hardware.framework.enableKmod {
|
config = lib.mkIf config.hardware.framework.enableKmod {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
|
||||||
|
message = "The framework laptop kernel module requires Linux 6.10 or above";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
boot = {
|
||||||
extraModulePackages = with config.boot.kernelPackages; [
|
extraModulePackages = with config.boot.kernelPackages; [
|
||||||
framework-laptop-kmod
|
framework-laptop-kmod
|
||||||
];
|
];
|
||||||
@@ -26,31 +30,6 @@ in
|
|||||||
"cros_ec"
|
"cros_ec"
|
||||||
"cros_ec_lpcs"
|
"cros_ec_lpcs"
|
||||||
];
|
];
|
||||||
|
};
|
||||||
# add required patch if enabled on kernel <6.10
|
|
||||||
kernelPatches = lib.mkIf (!kernel_version_compatible) [
|
|
||||||
rec {
|
|
||||||
name = "platform/chrome: cros_ec_lpc: add support for AMD Framework Laptops";
|
|
||||||
msgid = "20240403004713.130365-1-dustin@howett.net";
|
|
||||||
version = "3";
|
|
||||||
hash = "sha256-aQSyys8CMzlj9EdNhg8vtp76fg1qEwUVeJL0E+8w5HU=";
|
|
||||||
patch =
|
|
||||||
pkgs.runCommandLocal "patch-${msgid}"
|
|
||||||
{
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
b4
|
|
||||||
git
|
|
||||||
cacert
|
|
||||||
];
|
|
||||||
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
|
|
||||||
|
|
||||||
outputHash = hash;
|
|
||||||
}
|
|
||||||
''
|
|
||||||
export HOME="$TMP"
|
|
||||||
PYTHONHASHSEED=0 ${pkgs.b4}/bin/b4 -n am -C -T -v ${version} -o- "${msgid}" > "$out"
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -10,11 +10,6 @@
|
|||||||
"video=eDP-1:panel_orientation=right_side_up"
|
"video=eDP-1:panel_orientation=right_side_up"
|
||||||
];
|
];
|
||||||
|
|
||||||
services.tlp.enable = lib.mkDefault (
|
|
||||||
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
|
||||||
|| !config.services.power-profiles-daemon.enable
|
|
||||||
);
|
|
||||||
|
|
||||||
# Required for grub to properly display the boot menu.
|
# Required for grub to properly display the boot menu.
|
||||||
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
|
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ in
|
|||||||
|
|
||||||
nixpkgs.overlays = [ (import ./overlay.nix) ];
|
nixpkgs.overlays = [ (import ./overlay.nix) ];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "armv7l-linux";
|
nixpkgs.hostPlatform.system = "armv7l-linux";
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ahci_mvebu" ];
|
boot.initrd.availableKernelModules = [ "ahci_mvebu" ];
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,4 @@
|
|||||||
|
|
||||||
# Cooling management
|
# Cooling management
|
||||||
services.thermald.enable = lib.mkDefault true;
|
services.thermald.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# tlp defaults to "powersave", which doesn't exist on this laptop
|
|
||||||
services.tlp.settings = {
|
|
||||||
CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,7 @@
|
|||||||
# remove all packages for amd igpu. I only removed amdgpu from
|
# remove all packages for amd igpu. I only removed amdgpu from
|
||||||
# services.xserver.videoDrivers by overriding. This is because the specialization
|
# services.xserver.videoDrivers by overriding. This is because the specialization
|
||||||
# of nix cannot implement such an operation as canceling an import.
|
# of nix cannot implement such an operation as canceling an import.
|
||||||
hardware =
|
hardware = {
|
||||||
{
|
|
||||||
nvidia.prime.offload.enable = false;
|
nvidia.prime.offload.enable = false;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
# This file was obtained from the display while "DDG" mode was enabled.
|
# This file was obtained from the display while "DDG" mode was enabled.
|
||||||
chip_edid = pkgs.runCommandNoCC "chip_edid" { } ''
|
chip_edid = pkgs.runCommand "chip_edid" { } ''
|
||||||
mkdir -p $out/lib/firmware/edid
|
mkdir -p $out/lib/firmware/edid
|
||||||
cp ${./16ach6h.bin} $out/lib/firmware/edid/16ach6h.bin
|
cp ${./16ach6h.bin} $out/lib/firmware/edid/16ach6h.bin
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
# remove all packages for amd igpu. I only removed amdgpu from
|
# remove all packages for amd igpu. I only removed amdgpu from
|
||||||
# services.xserver.videoDrivers by overriding. This is because the specialization
|
# services.xserver.videoDrivers by overriding. This is because the specialization
|
||||||
# of nix cannot implement such an operation as canceling an import.
|
# of nix cannot implement such an operation as canceling an import.
|
||||||
hardware =
|
hardware = {
|
||||||
{
|
|
||||||
nvidia.prime.offload.enable = false;
|
nvidia.prime.offload.enable = false;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = [ ../hybrid ];
|
imports = [ ../hybrid ];
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
hardware =
|
hardware = {
|
||||||
{
|
|
||||||
nvidia.prime.offload.enable = false;
|
nvidia.prime.offload.enable = false;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||||
|
|||||||
@@ -32,8 +32,4 @@
|
|||||||
|
|
||||||
# Avoid issues with modesetting causing blank screen
|
# Avoid issues with modesetting causing blank screen
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
|
||||||
# AMD has better battery life with PPD over TLP:
|
|
||||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,9 @@
|
|||||||
|
|
||||||
# amdgpu.backlight=0 makes the backlight work
|
# amdgpu.backlight=0 makes the backlight work
|
||||||
# acpi_backlight=none allows the backlight save/load systemd service to work on older kernel versions
|
# acpi_backlight=none allows the backlight save/load systemd service to work on older kernel versions
|
||||||
boot.kernelParams =
|
boot.kernelParams = [
|
||||||
[ "amdgpu.backlight=0" ]
|
"amdgpu.backlight=0"
|
||||||
|
]
|
||||||
++ lib.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.1.6") "acpi_backlight=none";
|
++ lib.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.1.6") "acpi_backlight=none";
|
||||||
|
|
||||||
# For mainline support of rtw89 wireless networking
|
# For mainline support of rtw89 wireless networking
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{ lib, config, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../../../common/cpu/intel/comet-lake
|
||||||
|
|
||||||
|
../.
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{ lib, config, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../../../../common/gpu/nvidia/pascal
|
||||||
|
../../../../../../common/gpu/nvidia/prime-sync.nix
|
||||||
|
|
||||||
|
../.
|
||||||
|
];
|
||||||
|
hardware = {
|
||||||
|
graphics = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
enable32Bit = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
nvidia = {
|
||||||
|
powerManagement.enable = lib.mkDefault true;
|
||||||
|
modesetting.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
dynamicBoost.enable = lib.mkForce false; # Dynamic boost is not supported on Pascal architeture
|
||||||
|
prime = {
|
||||||
|
# 00:02.0 VGA compatible controller: Intel Corporation CometLake-U GT2 [UHD Graphics] (rev 02)
|
||||||
|
intelBusId = lib.mkDefault "PCI:0:2:0";
|
||||||
|
# 2d:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX330] (rev a1)
|
||||||
|
nvidiaBusId = lib.mkDefault "PCI:45:0:0";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.thermald.enable = lib.mkDefault true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# Linglong Nova Studio
|
||||||
|
|
||||||
|
This is a configuration for [Linglong Nova Studio (玲珑星核)](https://www.firstarpc.com/).
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
import `<nixos-hardware/linglong/nova-studio>` (using configurations), or add `nixos-hardware.nixosModules.linglong-nova-studio` in modules (using Flakes).
|
||||||
|
|
||||||
|
This configuration will force to use Linux kernel that >= 6.14, otherwise it will be updated to the latest version. This part follows [Framework Desktop](../../framework/desktop/amd-ai-max-300-series), which is also a desktop computer using Ryzen AI Max 300 series processor.
|
||||||
|
|
||||||
|
## OpenCL and ROCm support
|
||||||
|
|
||||||
|
To setup OpenCL and ROCm environment, please add the following configuration:
|
||||||
|
|
||||||
|
```
|
||||||
|
# Tell packages that supports ROCm to enable the related supports.
|
||||||
|
nixpkgs.config.rocmSupport = true;
|
||||||
|
|
||||||
|
# Install ROCm and enable
|
||||||
|
hardware.amdgpu.opencl.enable = true;
|
||||||
|
|
||||||
|
# These tools can show the info related to ROCm and OpenCL.
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
rocmPackages.rocminfo
|
||||||
|
clinfo
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
After switching, to check whether the environment has been correctly setup, please run
|
||||||
|
|
||||||
|
```
|
||||||
|
clinfo
|
||||||
|
```
|
||||||
|
|
||||||
|
and
|
||||||
|
|
||||||
|
```
|
||||||
|
rocminfo
|
||||||
|
```
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../common/cpu/amd
|
||||||
|
../../common/cpu/amd/pstate.nix
|
||||||
|
../../common/cpu/amd/zenpower.nix
|
||||||
|
../../common/gpu/amd
|
||||||
|
../../common/pc/ssd
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.14") (
|
||||||
|
lib.mkDefault pkgs.linuxPackages_latest
|
||||||
|
);
|
||||||
|
boot.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
|
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
||||||
|
hardware.graphics.enable = lib.mkDefault true;
|
||||||
|
hardware.graphics.enable32Bit = lib.mkDefault true;
|
||||||
|
}
|
||||||
@@ -110,9 +110,6 @@ in
|
|||||||
kernelParams = mkDefault [ "mem_sleep_default=deep" ];
|
kernelParams = mkDefault [ "mem_sleep_default=deep" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# NOTE: Check the README before enabling TLP:
|
|
||||||
services.tlp.enable = mkDefault false;
|
|
||||||
|
|
||||||
# Needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364
|
# Needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364
|
||||||
hardware = {
|
hardware = {
|
||||||
enableRedistributableFirmware = mkDefault true;
|
enableRedistributableFirmware = mkDefault true;
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ let
|
|||||||
let
|
let
|
||||||
inherit (builtins) removeAttrs;
|
inherit (builtins) removeAttrs;
|
||||||
|
|
||||||
args' =
|
args' = {
|
||||||
{
|
|
||||||
inherit
|
inherit
|
||||||
src
|
src
|
||||||
version
|
version
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
boot.kernelPackages = pkgs.callPackage ./kernel.nix { };
|
||||||
|
boot.extraModulePackages = [ (config.boot.kernelPackages.callPackage ./lpc.nix { }) ];
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
reformDebianPackages,
|
||||||
|
kernelSource,
|
||||||
|
quilt,
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "mnt-dts-patch";
|
||||||
|
nativeBuildInputs = [ quilt ];
|
||||||
|
buildCommand = ''
|
||||||
|
cp -r --reflink=auto ${reformDebianPackages}/linux/* .
|
||||||
|
mkdir -p linux/debian/patches/reform
|
||||||
|
cp -r --reflink=auto ${kernelSource}/* linux
|
||||||
|
chmod +w -R .
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt new reform/dts.patch
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/fsl-ls1028a-mnt-reform2.dts
|
||||||
|
cp fsl-ls1028a-mnt-reform2.dts linux/arch/arm64/boot/dts/freescale/fsl-ls1028a-mnt-reform2.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2-hdmi.dts
|
||||||
|
cp imx8mq-mnt-reform2-hdmi.dts linux/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2-hdmi.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/Makefile
|
||||||
|
sed -i '/fsl-ls1028a-rdb.dtb/a dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
|
||||||
|
sed -i '/imx8mq-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/imx8mp-mnt-pocket-reform.dts
|
||||||
|
cp imx8mp-mnt-pocket-reform.dts linux/arch/arm64/boot/dts/freescale/imx8mp-mnt-pocket-reform.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/freescale/imx8mp-mnt-reform2.dts
|
||||||
|
cp imx8mp-mnt-reform2.dts linux/arch/arm64/boot/dts/freescale/imx8mp-mnt-reform2.dts
|
||||||
|
sed -i '/imx8mq-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
|
||||||
|
sed -i '/imx8mq-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb' linux/arch/arm64/boot/dts/freescale/Makefile
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts
|
||||||
|
cp meson-g12b-bananapi-cm4-mnt-pocket-reform.dts linux/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/amlogic/Makefile
|
||||||
|
sed -i '/meson-g12b-bananapi-cm4-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb' linux/arch/arm64/boot/dts/amlogic/Makefile
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2.dts
|
||||||
|
cp rk3588-mnt-reform2.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2-dsi.dts
|
||||||
|
cp rk3588-mnt-reform2-dsi.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-reform2-dsi.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-pocket-reform.dts
|
||||||
|
cp rk3588-mnt-pocket-reform.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-pocket-reform.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/rk3588-mnt-reform-next.dts
|
||||||
|
cp rk3588-mnt-reform-next.dts linux/arch/arm64/boot/dts/rockchip/rk3588-mnt-reform-next.dts
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt add arch/arm64/boot/dts/rockchip/Makefile
|
||||||
|
sed -i '/rk3588-mnt-reform2.dtb/a dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb' linux/arch/arm64/boot/dts/rockchip/Makefile
|
||||||
|
sed -i '/rk3588-mnt-reform2-dsi.dtb/a dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb' linux/arch/arm64/boot/dts/rockchip/Makefile
|
||||||
|
sed -i '/rk3588-mnt-reform-next.dtb/a dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb' linux/arch/arm64/boot/dts/rockchip/Makefile
|
||||||
|
env --chdir=linux QUILT_PATCHES=debian/patches quilt refresh
|
||||||
|
cp linux/debian/patches/reform/dts.patch $out
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
callPackage,
|
||||||
|
linuxPackagesFor,
|
||||||
|
kernelPatches,
|
||||||
|
fetchFromGitLab,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
modDirVersion = "6.16.5";
|
||||||
|
reformDebianPackages = fetchFromGitLab {
|
||||||
|
domain = "source.mnt.re";
|
||||||
|
owner = "reform";
|
||||||
|
repo = "reform-debian-packages";
|
||||||
|
rev = "830c94db42beef876dc58ea56711659ae7bd415d";
|
||||||
|
hash = "sha256-mdORgTOM7RJnEjY5G/iWMHf69wQkql11yRpQ/DrQKb4=";
|
||||||
|
};
|
||||||
|
linuxPkg =
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchzip,
|
||||||
|
buildLinux,
|
||||||
|
callPackage,
|
||||||
|
...
|
||||||
|
}@args:
|
||||||
|
buildLinux (
|
||||||
|
args
|
||||||
|
// rec {
|
||||||
|
version = "${modDirVersion}-mnt-reform";
|
||||||
|
inherit modDirVersion;
|
||||||
|
|
||||||
|
src = fetchzip {
|
||||||
|
url = "mirror://kernel/linux/kernel/v${lib.versions.major modDirVersion}.x/linux-${modDirVersion}.tar.xz";
|
||||||
|
hash = "sha256-XiTuH40b3VJqzwygZzU0FcvMDj41Rq6IsMbm+3+QxDY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
kernelPatches =
|
||||||
|
(map (patch: { inherit patch; }) (
|
||||||
|
lib.filesystem.listFilesRecursive "${reformDebianPackages}/linux/patches${lib.versions.majorMinor modDirVersion}"
|
||||||
|
))
|
||||||
|
++ [
|
||||||
|
{
|
||||||
|
patch = callPackage ./dtsPatch.nix {
|
||||||
|
inherit reformDebianPackages;
|
||||||
|
kernelSource = src;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
structuredExtraConfig = with lib.kernel; {
|
||||||
|
# configuration options from https://source.mnt.re/reform/reform-debian-packages/-/blob/7f31ba3a6742d60d8d502c1d86e63ef5df3916bf/linux/config
|
||||||
|
DRM_LVDS_CODEC = module;
|
||||||
|
DRM_CDNS_MHDP8546 = module;
|
||||||
|
DRM_CDNS_HDMI_CEC = module;
|
||||||
|
DRM_IMX_CDNS_MHDP = module;
|
||||||
|
DRM_IMX_DCSS = module;
|
||||||
|
# PHY_FSL_IMX8MQ_HDPTX = module; # configuration option does not exist
|
||||||
|
DRM_PANEL_LVDS = module;
|
||||||
|
I2C_IMX_LPI2C = module;
|
||||||
|
I2C_MUX_REG = module;
|
||||||
|
INTERCONNECT_IMX = yes;
|
||||||
|
INTERCONNECT_IMX8MQ = yes;
|
||||||
|
MFD_WM8994 = module;
|
||||||
|
MUX_GPIO = module;
|
||||||
|
MUX_MMIO = module;
|
||||||
|
RTC_DRV_PCF8523 = module;
|
||||||
|
USB_EHCI_FSL = module;
|
||||||
|
# NO_HZ_IDLE = yes; # conflicts with NO_HZ_FULL
|
||||||
|
SND_SOC_FSL_MICFIL = module;
|
||||||
|
SND_IMX_SOC = module;
|
||||||
|
SND_SOC_FSL_ASOC_CARD = module;
|
||||||
|
SND_SOC_IMX_AUDMIX = module;
|
||||||
|
SND_SOC_IMX_HDMI = module;
|
||||||
|
INPUT_JOYSTICK = yes;
|
||||||
|
JOYSTICK_XPAD = module;
|
||||||
|
JOYSTICK_XPAD_FF = yes;
|
||||||
|
JOYSTICK_XPAD_LEDS = yes;
|
||||||
|
|
||||||
|
INTERCONNECT_IMX8MP = yes;
|
||||||
|
SND_SOC_FSL_ASRC = yes;
|
||||||
|
DRM_IMX_LCDIF = yes;
|
||||||
|
DRM_IMX8MP_DW_HDMI_BRIDGE = yes;
|
||||||
|
DRM_IMX8MP_HDMI_PVI = yes;
|
||||||
|
IMX8MM_THERMAL = yes;
|
||||||
|
IMX2_WDT = yes;
|
||||||
|
DRM_SAMSUNG_DSIM = yes;
|
||||||
|
PHY_FSL_SAMSUNG_HDMI_PHY = yes;
|
||||||
|
DRM = yes;
|
||||||
|
DRM_PANEL_MNT_POCKET_REFORM = module;
|
||||||
|
IMX8M_BLK_CTRL = yes;
|
||||||
|
IMX_GPCV2_PM_DOMAINS = yes;
|
||||||
|
DRM_DISPLAY_CONNECTOR = yes;
|
||||||
|
DRM_FSL_LDB = yes;
|
||||||
|
BACKLIGHT_CLASS_DEVICE = yes;
|
||||||
|
BACKLIGHT_PWM = yes;
|
||||||
|
BACKLIGHT_GPIO = yes;
|
||||||
|
BACKLIGHT_LED = yes;
|
||||||
|
CPU_FREQ_GOV_PERFORMANCE = yes;
|
||||||
|
CPU_FREQ_GOV_POWERSAVE = yes;
|
||||||
|
CPU_FREQ_GOV_USERSPACE = yes;
|
||||||
|
CPU_FREQ_GOV_ONDEMAND = yes;
|
||||||
|
CPU_FREQ_GOV_CONSERVATIVE = yes;
|
||||||
|
CPU_FREQ_GOV_SCHEDUTIL = yes;
|
||||||
|
ARM_IMX_CPUFREQ_DT = yes;
|
||||||
|
ARM_IMX_BUS_DEVFREQ = yes;
|
||||||
|
IMX_IRQSTEER = yes;
|
||||||
|
|
||||||
|
PCI_MESON = yes;
|
||||||
|
DWMAC_MESON = module;
|
||||||
|
MDIO_BUS_MUX_MESON_G12A = yes;
|
||||||
|
I2C_MESON = yes;
|
||||||
|
PWM_MESON = yes;
|
||||||
|
USB_DWC3_MESON_G12A = yes;
|
||||||
|
MMC_MESON_GX = yes;
|
||||||
|
MMC_MESON_MX_SDIO = yes;
|
||||||
|
MESON_DDR_PMU = yes;
|
||||||
|
RTW88_8822CS = module;
|
||||||
|
|
||||||
|
PWM_FSL_FTM = yes;
|
||||||
|
FSL_RCPM = yes;
|
||||||
|
|
||||||
|
ARCH_ROCKCHIP = yes;
|
||||||
|
# ARM_ROCKCHIP_CPUFREQ = module; # configuration option does not exist
|
||||||
|
DRM_PANTHOR = module;
|
||||||
|
NVMEM_ROCKCHIP_OTP = yes;
|
||||||
|
PHY_ROCKCHIP_SAMSUNG_HDPTX = module;
|
||||||
|
PHY_ROCKCHIP_USBDP = module;
|
||||||
|
REGULATOR = yes;
|
||||||
|
# ROCKCHIP_REGULATOR_COUPLER = yes; # configuration option does not exist
|
||||||
|
SPI_ROCKCHIP = yes;
|
||||||
|
SPI_ROCKCHIP_SFC = module;
|
||||||
|
ARM_SCMI_CPUFREQ = module;
|
||||||
|
VIDEO_ROCKCHIP_VDEC2 = module;
|
||||||
|
ROCKCHIP_DW_HDMI_QP = yes;
|
||||||
|
ROCKCHIP_DW_MIPI_DSI2 = yes;
|
||||||
|
PHY_ROCKCHIP_SAMSUNG_DCPHY = yes;
|
||||||
|
REGULATOR_FIXED_VOLTAGE = yes;
|
||||||
|
GPIO_ROCKCHIP = yes;
|
||||||
|
PL330_DMA = yes;
|
||||||
|
|
||||||
|
DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW = no; # patches for 6.16 break this driver
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// (args.argsOverride or { })
|
||||||
|
);
|
||||||
|
|
||||||
|
in
|
||||||
|
lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { }))
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
lib,
|
||||||
|
fetchFromGitLab,
|
||||||
|
kernel,
|
||||||
|
kernelModuleMakeFlags,
|
||||||
|
kmod,
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "lpc";
|
||||||
|
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
domain = "source.mnt.re";
|
||||||
|
owner = "reform";
|
||||||
|
repo = "reform-tools";
|
||||||
|
rev = "45f930403492aa2156522bfe30edb02e33494b69";
|
||||||
|
hash = "sha256-no33CsV69nu1TR0cqxQDd1bFXqhjqOW9IUDxds0fyxE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
sourceRoot = "source/lpc";
|
||||||
|
hardeningDisable = [
|
||||||
|
"pic"
|
||||||
|
"format"
|
||||||
|
];
|
||||||
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
make -C "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" M="$(pwd)" INSTALL_MOD_PATH=$out modules_install $makeFlags
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = kernelModuleMakeFlags ++ [
|
||||||
|
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
|
"INSTALL_MOD_PATH=${placeholder "out"}"
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# MNT Reform Laptop with RK3588 CPU module
|
||||||
|
|
||||||
|
## Creating an installer SD-Image
|
||||||
|
|
||||||
|
Create and configure the `flake.nix` file:
|
||||||
|
``` nix
|
||||||
|
{
|
||||||
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
inputs.nixos-hardware.url = "github:nixos/nixos-hardware";
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, nixos-hardware, flake-utils, ... }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
rec {
|
||||||
|
packages.default = packages.installer;
|
||||||
|
packages.installer = (import "${nixpkgs}/nixos" {
|
||||||
|
configuration =
|
||||||
|
{ config, ... }: {
|
||||||
|
imports = [
|
||||||
|
"${nixos-hardware}/mnt/reform/rk3588/installer.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
# If you want to use ssh set a password
|
||||||
|
# users.users.nixos.password = "super secure password";
|
||||||
|
# OR add your public ssh key
|
||||||
|
# users.users.nixos.openssh.authorizedKeys.keys = [ "ssh-rsa ..." ];
|
||||||
|
|
||||||
|
# Additional configuration goes here
|
||||||
|
|
||||||
|
# Only used when cross compiling
|
||||||
|
nixpkgs.crossSystem = {
|
||||||
|
config = "aarch64-unknown-linux-gnu";
|
||||||
|
system = "aarch64-linux";
|
||||||
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "23.05";
|
||||||
|
};
|
||||||
|
inherit system;
|
||||||
|
}).config.system.build.image;;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Build the installer image.
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
nix build .#
|
||||||
|
```
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [ ../. ];
|
||||||
|
boot = {
|
||||||
|
# kernelParams = [ "console=ttyS2,1500000n8" ];
|
||||||
|
kernelParams = [
|
||||||
|
"no_console_suspend"
|
||||||
|
"console=tty1"
|
||||||
|
];
|
||||||
|
# kernel modules needed for the virtual console
|
||||||
|
initrd.availableKernelModules = [
|
||||||
|
"panel-edp"
|
||||||
|
"phy-rockchip-samsung-hdptx"
|
||||||
|
"rockchipdrm"
|
||||||
|
"ti-sn65dsi86"
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
boot.loader = {
|
||||||
|
grub.enable = false;
|
||||||
|
generic-extlinux-compatible.enable = true;
|
||||||
|
};
|
||||||
|
hardware.alsa.enablePersistence = true;
|
||||||
|
system.activationScripts.asound = ''
|
||||||
|
if [ ! -e "/var/lib/alsa/asound.state" ]; then
|
||||||
|
mkdir -p /var/lib/alsa
|
||||||
|
cp ${./initial-asound.state} /var/lib/alsa/asound.state
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
runCommand,
|
||||||
|
uboot,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
# script from https://source.mnt.re/reform/reform-rk3588-uboot/-/blob/b530d65f4a878c0329a594fa248ba8da59d2e05f/build.sh
|
||||||
|
runCommand "mnt-reform-firmware-rk3855${uboot.variant}" { } ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r ${uboot} u-boot
|
||||||
|
cp -r ${uboot.rkbin} rkbin
|
||||||
|
chmod -R +rw u-boot
|
||||||
|
chmod -R +rw rkbin
|
||||||
|
cd u-boot
|
||||||
|
mkdir spl
|
||||||
|
mv u-boot-spl.bin spl
|
||||||
|
../rkbin/tools/boot_merger rock5b-rk3588.ini
|
||||||
|
cd ..
|
||||||
|
# rkbin stuff
|
||||||
|
cd rkbin
|
||||||
|
./tools/boot_merger RKBOOT/RK3588MINIALL.ini
|
||||||
|
# concatenate
|
||||||
|
cd ..
|
||||||
|
cp u-boot/idbloader.img $out/mnt-reform2-rk3588${uboot.variant}-flash.bin
|
||||||
|
dd if=u-boot/u-boot.itb of=$out/mnt-reform2-rk3588${uboot.variant}-flash.bin seek=16320
|
||||||
|
''
|
||||||
@@ -0,0 +1,702 @@
|
|||||||
|
state.rk3588wm8960 {
|
||||||
|
control.1 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Capture Volume'
|
||||||
|
value.0 39
|
||||||
|
value.1 39
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 2
|
||||||
|
range '0 - 63'
|
||||||
|
dbmin -1725
|
||||||
|
dbmax 3000
|
||||||
|
dbvalue.0 1200
|
||||||
|
dbvalue.1 1200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.2 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Capture Volume ZC Switch'
|
||||||
|
value.0 false
|
||||||
|
value.1 false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.3 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Capture Switch'
|
||||||
|
value.0 true
|
||||||
|
value.1 true
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.4 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Input Boost Mixer LINPUT3 Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 600
|
||||||
|
dbvalue.0 -9999999
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.5 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Input Boost Mixer LINPUT2 Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 600
|
||||||
|
dbvalue.0 -9999999
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.6 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Input Boost Mixer RINPUT3 Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 600
|
||||||
|
dbvalue.0 -9999999
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.7 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Input Boost Mixer RINPUT2 Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 600
|
||||||
|
dbvalue.0 -9999999
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.8 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Input Boost Mixer RINPUT1 Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 3'
|
||||||
|
dbmin 0
|
||||||
|
dbmax 2900
|
||||||
|
dbvalue.0 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.9 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Input Boost Mixer LINPUT1 Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 3'
|
||||||
|
dbmin 0
|
||||||
|
dbmax 2900
|
||||||
|
dbvalue.0 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.10 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Playback Volume'
|
||||||
|
value.0 215
|
||||||
|
value.1 215
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 2
|
||||||
|
range '0 - 255'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 0
|
||||||
|
dbvalue.0 -2000
|
||||||
|
dbvalue.1 -2000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.11 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Headphone Playback Volume'
|
||||||
|
value.0 0
|
||||||
|
value.1 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 2
|
||||||
|
range '0 - 127'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 600
|
||||||
|
dbvalue.0 -9999999
|
||||||
|
dbvalue.1 -9999999
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.12 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Headphone Playback ZC Switch'
|
||||||
|
value.0 false
|
||||||
|
value.1 false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.13 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Speaker Playback Volume'
|
||||||
|
value.0 109
|
||||||
|
value.1 109
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 2
|
||||||
|
range '0 - 127'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 600
|
||||||
|
dbvalue.0 -1200
|
||||||
|
dbvalue.1 -1200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.14 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Speaker Playback ZC Switch'
|
||||||
|
value.0 false
|
||||||
|
value.1 false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.15 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Speaker DC Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 5'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.16 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Speaker AC Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 5'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.17 {
|
||||||
|
iface MIXER
|
||||||
|
name 'PCM Playback -6dB Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.18 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ADC Polarity'
|
||||||
|
value 'No Inversion'
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 'No Inversion'
|
||||||
|
item.1 'Left Inverted'
|
||||||
|
item.2 'Right Inverted'
|
||||||
|
item.3 'Stereo Inversion'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.19 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ADC High Pass Filter Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.20 {
|
||||||
|
iface MIXER
|
||||||
|
name 'DAC Polarity'
|
||||||
|
value 'No Inversion'
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 'No Inversion'
|
||||||
|
item.1 'Left Inverted'
|
||||||
|
item.2 'Right Inverted'
|
||||||
|
item.3 'Stereo Inversion'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.21 {
|
||||||
|
iface MIXER
|
||||||
|
name 'DAC Deemphasis Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.22 {
|
||||||
|
iface MIXER
|
||||||
|
name '3D Filter Upper Cut-Off'
|
||||||
|
value High
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 High
|
||||||
|
item.1 Low
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.23 {
|
||||||
|
iface MIXER
|
||||||
|
name '3D Filter Lower Cut-Off'
|
||||||
|
value Low
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 Low
|
||||||
|
item.1 High
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.24 {
|
||||||
|
iface MIXER
|
||||||
|
name '3D Volume'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 15'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.25 {
|
||||||
|
iface MIXER
|
||||||
|
name '3D Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.26 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Function'
|
||||||
|
value Off
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 Off
|
||||||
|
item.1 Right
|
||||||
|
item.2 Left
|
||||||
|
item.3 Stereo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.27 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Max Gain'
|
||||||
|
value 7
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.28 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Target'
|
||||||
|
value 4
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 15'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.29 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Min Gain'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.30 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Hold Time'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 15'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.31 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Mode'
|
||||||
|
value ALC
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 ALC
|
||||||
|
item.1 Limiter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.32 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Decay'
|
||||||
|
value 3
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 15'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.33 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ALC Attack'
|
||||||
|
value 2
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 15'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.34 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Noise Gate Threshold'
|
||||||
|
value 0
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 31'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.35 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Noise Gate Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.36 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ADC PCM Capture Volume'
|
||||||
|
value.0 195
|
||||||
|
value.1 195
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 2
|
||||||
|
range '0 - 255'
|
||||||
|
dbmin -9999999
|
||||||
|
dbmax 3000
|
||||||
|
dbvalue.0 0
|
||||||
|
dbvalue.1 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.37 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Output Mixer Boost Bypass Volume'
|
||||||
|
value 2
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -2100
|
||||||
|
dbmax 0
|
||||||
|
dbvalue.0 -1500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.38 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Output Mixer LINPUT3 Volume'
|
||||||
|
value 2
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -2100
|
||||||
|
dbmax 0
|
||||||
|
dbvalue.0 -1500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.39 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Output Mixer Boost Bypass Volume'
|
||||||
|
value 2
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -2100
|
||||||
|
dbmax 0
|
||||||
|
dbvalue.0 -1500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.40 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Output Mixer RINPUT3 Volume'
|
||||||
|
value 2
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type INTEGER
|
||||||
|
count 1
|
||||||
|
range '0 - 7'
|
||||||
|
dbmin -2100
|
||||||
|
dbmax 0
|
||||||
|
dbvalue.0 -1500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.41 {
|
||||||
|
iface MIXER
|
||||||
|
name 'ADC Data Output Select'
|
||||||
|
value 'Left Data = Left ADC; Right Data = Right ADC'
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 'Left Data = Left ADC; Right Data = Right ADC'
|
||||||
|
item.1 'Left Data = Left ADC; Right Data = Left ADC'
|
||||||
|
item.2 'Left Data = Right ADC; Right Data = Right ADC'
|
||||||
|
item.3 'Left Data = Right ADC; Right Data = Left ADC'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.42 {
|
||||||
|
iface MIXER
|
||||||
|
name 'DAC Mono Mix'
|
||||||
|
value Stereo
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 Stereo
|
||||||
|
item.1 Mono
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.43 {
|
||||||
|
iface MIXER
|
||||||
|
name 'DAC Filter Characteristics'
|
||||||
|
value Normal
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type ENUMERATED
|
||||||
|
count 1
|
||||||
|
item.0 Normal
|
||||||
|
item.1 Sloping
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.44 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Boost Mixer LINPUT2 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.45 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Boost Mixer LINPUT3 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.46 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Boost Mixer LINPUT1 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.47 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Boost Mixer RINPUT2 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.48 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Boost Mixer RINPUT3 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.49 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Boost Mixer RINPUT1 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.50 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Input Mixer Boost Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.51 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Input Mixer Boost Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.52 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Output Mixer PCM Playback Switch'
|
||||||
|
value true
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.53 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Output Mixer LINPUT3 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.54 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Left Output Mixer Boost Bypass Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.55 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Output Mixer PCM Playback Switch'
|
||||||
|
value true
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.56 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Output Mixer RINPUT3 Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.57 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Right Output Mixer Boost Bypass Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.58 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Mono Output Mixer Left Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
control.59 {
|
||||||
|
iface MIXER
|
||||||
|
name 'Mono Output Mixer Right Switch'
|
||||||
|
value false
|
||||||
|
comment {
|
||||||
|
access 'read write'
|
||||||
|
type BOOLEAN
|
||||||
|
count 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,239 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
"${modulesPath}/image/file-options.nix"
|
||||||
|
"${modulesPath}/profiles/installation-device.nix"
|
||||||
|
./.
|
||||||
|
];
|
||||||
|
|
||||||
|
options.installerImage = {
|
||||||
|
compressImage = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = ''
|
||||||
|
Whether the installer image should be compressed using
|
||||||
|
{command}`zstd`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
squashfsCompression = lib.mkOption {
|
||||||
|
default = "zstd -Xcompression-level 19";
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
description = ''
|
||||||
|
Compression settings to use for the squashfs nix store.
|
||||||
|
`null` disables compression.
|
||||||
|
'';
|
||||||
|
example = "zstd -Xcompression-level 6";
|
||||||
|
};
|
||||||
|
storeContents = lib.mkOption {
|
||||||
|
example = lib.literalExpression "[ pkgs.stdenv ]";
|
||||||
|
description = ''
|
||||||
|
This option lists additional derivations to be included in the
|
||||||
|
Nix store in the generated installer image.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config =
|
||||||
|
let
|
||||||
|
squashfs = pkgs.callPackage "${modulesPath}/../lib/make-squashfs.nix" {
|
||||||
|
storeContents = config.installerImage.storeContents;
|
||||||
|
comp = config.installerImage.squashfsCompression;
|
||||||
|
};
|
||||||
|
uboot = pkgs.callPackage ./uboot.nix { };
|
||||||
|
firmware = pkgs.callPackage ./firmware.nix { inherit uboot; };
|
||||||
|
content = pkgs.callPackage (
|
||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
e2fsprogs,
|
||||||
|
libfaketime,
|
||||||
|
fakeroot,
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "ext4-fs.img";
|
||||||
|
nativeBuildInputs = [
|
||||||
|
e2fsprogs.bin
|
||||||
|
libfaketime
|
||||||
|
fakeroot
|
||||||
|
];
|
||||||
|
buildCommand = ''
|
||||||
|
img=$out
|
||||||
|
mkdir -p ./files
|
||||||
|
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./rootImage/boot
|
||||||
|
(
|
||||||
|
GLOBIGNORE=".:.."
|
||||||
|
shopt -u dotglob
|
||||||
|
|
||||||
|
for f in ./files/*; do
|
||||||
|
cp -a --reflink=auto -t ./rootImage/ "$f"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
cp -a --reflink=auto ${squashfs} ./rootImage/nix-store.squashfs
|
||||||
|
|
||||||
|
|
||||||
|
# Make a crude approximation of the size of the target image.
|
||||||
|
# If the script starts failing, increase the fudge factors here.
|
||||||
|
numInodes=$(find ./rootImage | wc -l)
|
||||||
|
numDataBlocks=$(du -s -c -B 4096 --apparent-size ./rootImage | tail -1 | awk '{ print int($1 * 1.20) }')
|
||||||
|
bytes=$((2 * 4096 * $numInodes + 4096 * $numDataBlocks))
|
||||||
|
echo "Creating an EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks)"
|
||||||
|
|
||||||
|
mebibyte=$(( 1024 * 1024 ))
|
||||||
|
# Round up to the nearest mebibyte.
|
||||||
|
# This ensures whole 512 bytes sector sizes in the disk image
|
||||||
|
# and helps towards aligning partitions optimally.
|
||||||
|
if (( bytes % mebibyte )); then
|
||||||
|
bytes=$(( ( bytes / mebibyte + 1) * mebibyte ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
truncate -s $bytes $img
|
||||||
|
|
||||||
|
faketime -f "1970-01-01 00:00:01" fakeroot mkfs.ext4 -L NIXOS_ROOT -U 44444444-4444-4444-8888-888888888888 -d ./rootImage $img
|
||||||
|
|
||||||
|
export EXT2FS_NO_MTAB_OK=yes
|
||||||
|
# I have ended up with corrupted images sometimes, I suspect that happens when the build machine's disk gets full during the build.
|
||||||
|
if ! fsck.ext4 -n -f $img; then
|
||||||
|
echo "--- Fsck failed for EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks) ---"
|
||||||
|
cat errorlog
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We may want to shrink the file system and resize the image to
|
||||||
|
# get rid of the unnecessary slack here--but see
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/125121 for caveats.
|
||||||
|
|
||||||
|
# shrink to fit
|
||||||
|
resize2fs -M $img
|
||||||
|
|
||||||
|
# Add 16 MebiByte to the current_size
|
||||||
|
new_size=$(dumpe2fs -h $img | awk -F: \
|
||||||
|
'/Block count/{count=$2} /Block size/{size=$2} END{print (count*size+16*2**20)/size}')
|
||||||
|
|
||||||
|
resize2fs $img $new_size
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
) { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
fileSystems = {
|
||||||
|
"/" = lib.mkImageMediaOverride {
|
||||||
|
fsType = "tmpfs";
|
||||||
|
options = [ "mode=0755" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/iso" = lib.mkImageMediaOverride {
|
||||||
|
device = "/dev/disk/by-label/NIXOS_ROOT";
|
||||||
|
neededForBoot = true;
|
||||||
|
noCheck = true;
|
||||||
|
options = [ "ro" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# In stage 1, mount a tmpfs on top of /nix/store (the squashfs
|
||||||
|
# image) to make this a live CD.
|
||||||
|
"/nix/.ro-store" = lib.mkImageMediaOverride {
|
||||||
|
fsType = "squashfs";
|
||||||
|
device = "/iso/nix-store.squashfs";
|
||||||
|
options = [
|
||||||
|
"loop"
|
||||||
|
]
|
||||||
|
++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi";
|
||||||
|
neededForBoot = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"/nix/.rw-store" = lib.mkImageMediaOverride {
|
||||||
|
fsType = "tmpfs";
|
||||||
|
options = [ "mode=0755" ];
|
||||||
|
neededForBoot = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"/nix/store" = lib.mkImageMediaOverride {
|
||||||
|
fsType = "overlay";
|
||||||
|
device = "overlay";
|
||||||
|
options = [
|
||||||
|
"lowerdir=/nix/.ro-store"
|
||||||
|
"upperdir=/nix/.rw-store/store"
|
||||||
|
"workdir=/nix/.rw-store/work"
|
||||||
|
];
|
||||||
|
depends = [
|
||||||
|
"/nix/.ro-store"
|
||||||
|
"/nix/.rw-store/store"
|
||||||
|
"/nix/.rw-store/work"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
initrd.availableKernelModules = [
|
||||||
|
"squashfs"
|
||||||
|
"uas"
|
||||||
|
"overlay"
|
||||||
|
];
|
||||||
|
initrd.kernelModules = [
|
||||||
|
"loop"
|
||||||
|
"overlay"
|
||||||
|
];
|
||||||
|
loader.timeout = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
image.extension = if config.installerImage.compressImage then "img.zst" else "img";
|
||||||
|
image.filePath = "installer-image/${config.image.fileName}";
|
||||||
|
|
||||||
|
installerImage.storeContents = [ config.system.build.toplevel ];
|
||||||
|
|
||||||
|
system.build.image = pkgs.callPackage (
|
||||||
|
{ stdenv, util-linux }:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = config.image.fileName;
|
||||||
|
nativeBuildInputs = [ util-linux ];
|
||||||
|
inherit (config.installerImage) compressImage;
|
||||||
|
buildCommand = ''
|
||||||
|
mkdir -p $out/nix-support $out/installer-image
|
||||||
|
img=$out/installer-image/${config.image.baseName}.img
|
||||||
|
|
||||||
|
echo "${stdenv.buildPlatform.system}" > $out/nix-support/system
|
||||||
|
if test -n "$compressImage"; then
|
||||||
|
echo "file installer-image $img.zst" >> $out/nix-support/hydra-build-products
|
||||||
|
else
|
||||||
|
echo "file installer-image $img" >> $out/nix-support/hydra-build-products
|
||||||
|
fi
|
||||||
|
|
||||||
|
sectors=$((($(stat -c '%s' ${content})+511)/512))
|
||||||
|
# create disk image
|
||||||
|
truncate -s $((($sectors + 32768 + 2048)*512)) $img
|
||||||
|
sfdisk $img <<EOF
|
||||||
|
label: gpt
|
||||||
|
unit: sectors
|
||||||
|
sector-size: 512
|
||||||
|
|
||||||
|
start=32768, size=$sectors, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, attrs="LegacyBIOSBootable"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
eval $(partx $img -o START,SECTORS --nr 1 --pairs)
|
||||||
|
dd conv=notrunc if=${content} of=$img seek=$START count=$SECTORS
|
||||||
|
|
||||||
|
dd conv=notrunc if=${firmware}/mnt-reform2-rk3588-dsi-flash.bin of=$img seek=64
|
||||||
|
|
||||||
|
if test -n "$compressImage"; then
|
||||||
|
zstd -T$NIX_BUILD_CORES --rm $img
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
) { };
|
||||||
|
|
||||||
|
boot.postBootCommands = ''
|
||||||
|
# After booting, register the contents of the Nix store on the
|
||||||
|
# CD in the Nix database in the tmpfs.
|
||||||
|
${config.nix.package.out}/bin/nix-store --load-db < /nix/store/nix-path-registration
|
||||||
|
|
||||||
|
# nixos-rebuild also requires a "system" profile and an
|
||||||
|
# /etc/NIXOS tag.
|
||||||
|
touch /etc/NIXOS
|
||||||
|
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
|
||||||
|
'';
|
||||||
|
boot.initrd.supportedFilesystems = [ "ext4" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
buildUBoot,
|
||||||
|
python3,
|
||||||
|
armTrustedFirmwareRK3588,
|
||||||
|
fetchFromGitLab,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
mntPatches = fetchFromGitLab {
|
||||||
|
domain = "source.mnt.re";
|
||||||
|
owner = "reform";
|
||||||
|
repo = "reform-rk3588-uboot";
|
||||||
|
rev = "55bca0174e7bb449e96028d64ad8348f5af35977";
|
||||||
|
hash = "sha256-A3u1afGK65cGOwENQtu8Hh+fLsSDNxc3rEebkd3QOic=";
|
||||||
|
};
|
||||||
|
rkbin = fetchFromGitHub {
|
||||||
|
owner = "rockchip-linux";
|
||||||
|
repo = "rkbin";
|
||||||
|
rev = "f43a462e7a1429a9d407ae52b4745033034a6cf9";
|
||||||
|
hash = "sha256-geESfZP8ynpUz/i/thpaimYo3kzqkBX95gQhMBzNbmk=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
buildUBoot rec {
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
domain = "gitlab.collabora.com";
|
||||||
|
owner = "hardware-enablement";
|
||||||
|
repo = "rockchip-3588/u-boot";
|
||||||
|
rev = "424c714eb24731e16509231a817c76d4a6ae0ecc";
|
||||||
|
hash = "sha256-26XLcPundNjRcXrSq2V5PaW6M269rsouOV56ymsptzc=";
|
||||||
|
};
|
||||||
|
version = "424c714eb24731e16509231a817c76d4a6ae0ecc";
|
||||||
|
patches = [
|
||||||
|
"${mntPatches}/0001-ini-ddrbin-bump.patch"
|
||||||
|
"${mntPatches}/0002-add-target-init-mnt-reform-series.patch"
|
||||||
|
];
|
||||||
|
prePatch = ''
|
||||||
|
cp ${mntPatches}/*.dts arch/arm/dts/
|
||||||
|
cp ${mntPatches}/*_defconfig configs/
|
||||||
|
''; # postPatch is already occupied
|
||||||
|
|
||||||
|
filesToInstall = [
|
||||||
|
"idbloader.img"
|
||||||
|
"u-boot.itb"
|
||||||
|
"rock5b-rk3588.ini"
|
||||||
|
"spl/u-boot-spl.bin"
|
||||||
|
];
|
||||||
|
variant = "-dsi";
|
||||||
|
defconfig = "mnt-reform2-rk3588${variant}_defconfig";
|
||||||
|
extraMakeFlags = [
|
||||||
|
"BL31=${armTrustedFirmwareRK3588}/bl31.elf"
|
||||||
|
"ROCKCHIP_TPL=${rkbin}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.18.bin"
|
||||||
|
];
|
||||||
|
passthru.rkbin = rkbin;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../common/cpu/amd
|
||||||
|
../../common/pc/ssd
|
||||||
|
../../common/pc
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||||
|
nct6687d
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelModules = [ "nct6687d" ];
|
||||||
|
}
|
||||||
+53
-3
@@ -21,19 +21,69 @@ Code snippet example that enables imx8qm configuration:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2.2 For imx8mq-evk/imx8mp-evk
|
### 2.2 For imx8mq-evk/imx8mp-evk/imx93-evk
|
||||||
This NXP overlay is used for generating sdimage.
|
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.
|
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 in imx8m platform.
|
||||||
|
|
||||||
Code snippet example that enables 'imx8mp-evk/emx8mq-evk' configuration:
|
Code snippet example that enables 'imx8mp-evk/imx8mq-evk/imx93-evk' configuration:
|
||||||
|
|
||||||
```
|
```
|
||||||
{ nixos-hardware, }: {
|
{ nixos-hardware, }: {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
nixos-hardware.nixosModules.imx8mp-evk #For imx8mp-evk
|
nixos-hardware.nixosModules.imx8mp-evk #For imx8mp-evk
|
||||||
|
#nixos-hardware.nixosModules.imx93-evk #For imx93-evk
|
||||||
#nixos-hardware.nixosModules.imx8mq-evk #For imx8mq-evk
|
#nixos-hardware.nixosModules.imx8mq-evk #For imx8mq-evk
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 2.3 Building Boot Images
|
||||||
|
|
||||||
|
Boot images for flashing to SD cards can be built directly from the flake:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build boot image for i.MX8MP EVK
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.imx8mp-boot
|
||||||
|
|
||||||
|
# Build boot image for i.MX8MQ EVK
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.imx8mq-boot
|
||||||
|
|
||||||
|
# Build boot image for i.MX93 EVK
|
||||||
|
nix build github:NixOS/nixos-hardware#packages.aarch64-linux.imx93-boot
|
||||||
|
|
||||||
|
# Or from a local checkout
|
||||||
|
nix build .#packages.aarch64-linux.imx8mp-boot
|
||||||
|
```
|
||||||
|
|
||||||
|
The boot image will be available at `./result/image/flash.bin`.
|
||||||
|
|
||||||
|
**Note:** These packages target `aarch64-linux`. If you're on a different architecture (e.g., x86_64-linux), you'll need remote builders configured for aarch64-linux.
|
||||||
|
|
||||||
|
### 2.4 Flashing to SD Card
|
||||||
|
|
||||||
|
Once built, you can flash the boot image to an SD card:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# For i.MX8MP and i.MX93 (32KB offset):
|
||||||
|
sudo dd if=./result/image/flash.bin of=/dev/sdX bs=1k seek=32 conv=fsync
|
||||||
|
|
||||||
|
# For i.MX8MQ (33KB offset):
|
||||||
|
sudo dd if=./result/image/flash.bin of=/dev/sdX bs=1k seek=33 conv=fsync
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** Different i.MX processors require different offsets. i.MX8MP and i.MX93 use 32KB (seek=32), while i.MX8MQ uses 33KB (seek=33).
|
||||||
|
|
||||||
|
**Warning:** Double-check the device path to avoid overwriting the wrong disk!
|
||||||
|
|
||||||
|
## 3. Upstream Documentation
|
||||||
|
|
||||||
|
### U-Boot Board Documentation
|
||||||
|
- [NXP i.MX8MP EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx8mp_evk.html)
|
||||||
|
- [NXP i.MX8MQ EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx8mq_evk.html)
|
||||||
|
- [NXP i.MX93 11x11 EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx93_11x11_evk.html)
|
||||||
|
- [NXP i.MX95 EVK U-Boot Documentation](https://docs.u-boot.org/en/latest/board/nxp/imx95_evk.html)
|
||||||
|
|
||||||
|
### Additional Resources
|
||||||
|
- [NXP i.MX 8M Series TF-A Documentation](https://trustedfirmware-a.readthedocs.io/en/latest/plat/imx8m.html)
|
||||||
|
|
||||||
@@ -47,8 +47,7 @@ pkgs.stdenv.mkDerivation rec {
|
|||||||
${firmwareSeco} --auto-accept --force
|
${firmwareSeco} --auto-accept --force
|
||||||
'';
|
'';
|
||||||
|
|
||||||
filesToInstall =
|
filesToInstall = [
|
||||||
[
|
|
||||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin"
|
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin"
|
||||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin"
|
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# Parameterized Linux kernel builder for i.MX platforms
|
||||||
|
# This builder is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{ lib, pkgs, ... }@args:
|
||||||
|
let
|
||||||
|
inherit (pkgs) buildLinux;
|
||||||
|
|
||||||
|
# Import common kernel configuration
|
||||||
|
kernelConfig = import ../lib/kernel-config.nix;
|
||||||
|
in
|
||||||
|
# Platform-specific parameters
|
||||||
|
{
|
||||||
|
pname,
|
||||||
|
version,
|
||||||
|
src,
|
||||||
|
defconfig ? "imx_v8_defconfig",
|
||||||
|
# Optional parameters
|
||||||
|
extraConfig ? "",
|
||||||
|
kernelPatches ? [ ],
|
||||||
|
autoModules ? false,
|
||||||
|
ignoreConfigErrors ? true,
|
||||||
|
extraMeta ? { },
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Combine common i.MX kernel config with platform-specific config
|
||||||
|
finalExtraConfig = kernelConfig.imxCommonKernelConfig + extraConfig;
|
||||||
|
in
|
||||||
|
buildLinux (
|
||||||
|
args
|
||||||
|
// rec {
|
||||||
|
inherit
|
||||||
|
version
|
||||||
|
defconfig
|
||||||
|
kernelPatches
|
||||||
|
autoModules
|
||||||
|
ignoreConfigErrors
|
||||||
|
;
|
||||||
|
name = pname;
|
||||||
|
|
||||||
|
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
||||||
|
modDirVersion = version;
|
||||||
|
|
||||||
|
extraConfig = finalExtraConfig;
|
||||||
|
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
meta =
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
homepage = "https://github.com/nxp-imx/linux-imx";
|
||||||
|
license = [ licenses.gpl2Only ];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
}
|
||||||
|
// extraMeta;
|
||||||
|
}
|
||||||
|
// (args.argsOverride or { })
|
||||||
|
)
|
||||||
@@ -16,12 +16,12 @@ pkgs.stdenv.mkDerivation rec {
|
|||||||
--replace 'CC = gcc' 'CC = clang'
|
--replace 'CC = gcc' 'CC = clang'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
depsBuildBuild = [
|
||||||
clang
|
pkgs.buildPackages.stdenv.cc
|
||||||
git
|
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
nativeBuildInputs = [
|
||||||
|
clang
|
||||||
git
|
git
|
||||||
glibc.static
|
glibc.static
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
# Parameterized OP-TEE OS builder for i.MX platforms
|
||||||
|
# This builder is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
# Platform-specific parameters
|
||||||
|
pname,
|
||||||
|
version,
|
||||||
|
platformFlavor,
|
||||||
|
src,
|
||||||
|
# Optional parameters
|
||||||
|
meta ? { },
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (pkgs.buildPackages) python3;
|
||||||
|
toolchain = pkgs.stdenv.cc;
|
||||||
|
binutils = pkgs.stdenv.cc.bintools.bintools_bin;
|
||||||
|
cpp = pkgs.stdenv.cc;
|
||||||
|
|
||||||
|
# Determine PLATFORM and PLATFORM_FLAVOR from platformFlavor
|
||||||
|
# Format can be either "imx-mx93evk" (full platform string) or "mx8mpevk" (just flavor, platform is "imx")
|
||||||
|
# Check if it starts with "imx-" to determine if it's a full platform string or just a flavor
|
||||||
|
hasFullPlatform = lib.hasPrefix "imx-" platformFlavor;
|
||||||
|
platform = if hasFullPlatform then platformFlavor else "imx";
|
||||||
|
flavor = if hasFullPlatform then null else platformFlavor;
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
inherit pname version src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
python3
|
||||||
|
];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
|
pycryptodomex
|
||||||
|
pyelftools
|
||||||
|
cryptography
|
||||||
|
];
|
||||||
|
|
||||||
|
# Common postPatch for all i.MX platforms
|
||||||
|
# This is the major source of code duplication - ~60 lines of identical substitutions
|
||||||
|
postPatch = ''
|
||||||
|
# Patch all script shebangs automatically
|
||||||
|
patchShebangs scripts/
|
||||||
|
patchShebangs ta/
|
||||||
|
|
||||||
|
# Patch toolchain paths in mk/gcc.mk
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||||
|
substituteInPlace mk/gcc.mk \
|
||||||
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/${toolchain.targetPrefix}cpp
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"PLATFORM=${platform}"
|
||||||
|
]
|
||||||
|
++ lib.optionals (!hasFullPlatform) [
|
||||||
|
"PLATFORM_FLAVOR=${flavor}"
|
||||||
|
]
|
||||||
|
++ [
|
||||||
|
"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
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-optee-os";
|
||||||
|
license = [ lib.licenses.bsd2 ];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
}
|
||||||
|
// meta;
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ let
|
|||||||
cpp = pkgs.buildPackages.gcc;
|
cpp = pkgs.buildPackages.gcc;
|
||||||
|
|
||||||
in
|
in
|
||||||
pkgs.stdenv.mkDerivation rec {
|
pkgs.stdenv.mkDerivation {
|
||||||
|
|
||||||
pname = "imx-optee-os";
|
pname = "imx-optee-os";
|
||||||
version = "5.15.32_2.0.0";
|
version = "5.15.32_2.0.0";
|
||||||
@@ -41,25 +41,25 @@ pkgs.stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace scripts/arm32_sysreg.py \
|
substituteInPlace scripts/arm32_sysreg.py \
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
substituteInPlace scripts/gen_tee_bin.py \
|
substituteInPlace scripts/gen_tee_bin.py \
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
substituteInPlace scripts/pem_to_pub_c.py \
|
substituteInPlace scripts/pem_to_pub_c.py \
|
||||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
--replace-fail '/usr/bin/env python3' '${python3}/bin/python'
|
||||||
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
||||||
--replace '/bin/bash' '${pkgs.bash}/bin/bash'
|
--replace-fail '/bin/bash' '${pkgs.bash}/bin/bash'
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||||
substituteInPlace mk/gcc.mk \
|
substituteInPlace mk/gcc.mk \
|
||||||
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
|
--replace-fail "\$(CROSS_COMPILE_\$(sm))cpp" "${cpp}/bin/${toolchain.targetPrefix}cpp"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
# Parameterized U-Boot builder for i.MX platforms
|
||||||
|
# This builder is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
# Required dependencies
|
||||||
|
bison,
|
||||||
|
dtc,
|
||||||
|
flex,
|
||||||
|
gnutls,
|
||||||
|
libuuid,
|
||||||
|
ncurses,
|
||||||
|
openssl,
|
||||||
|
perl,
|
||||||
|
efitools,
|
||||||
|
which,
|
||||||
|
# Platform-specific parameters
|
||||||
|
pname,
|
||||||
|
version,
|
||||||
|
src,
|
||||||
|
defconfig,
|
||||||
|
ramdiskAddr,
|
||||||
|
fdtAddr,
|
||||||
|
dtbPath,
|
||||||
|
# Optional parameters
|
||||||
|
extraConfig ? "",
|
||||||
|
extraNativeBuildInputs ? [ ],
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Import common U-Boot configuration
|
||||||
|
ubootConfig = import ../lib/uboot-config.nix;
|
||||||
|
|
||||||
|
# Generate the common config with platform-specific memory addresses
|
||||||
|
commonConfig = ubootConfig.imxCommonUbootConfig {
|
||||||
|
inherit ramdiskAddr fdtAddr;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Combine common config with any platform-specific extra config
|
||||||
|
finalExtraConfig = commonConfig + extraConfig;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit pname version src;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs tools
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
bison
|
||||||
|
flex
|
||||||
|
openssl
|
||||||
|
which
|
||||||
|
ncurses
|
||||||
|
libuuid
|
||||||
|
gnutls
|
||||||
|
perl
|
||||||
|
efitools
|
||||||
|
]
|
||||||
|
++ extraNativeBuildInputs;
|
||||||
|
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"DTC=${lib.getExe buildPackages.dtc}"
|
||||||
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig = finalExtraConfig;
|
||||||
|
|
||||||
|
passAsFile = [ "extraConfig" ];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
make ${defconfig}
|
||||||
|
cat $extraConfigPath >> .config
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp ./u-boot-nodtb.bin $out
|
||||||
|
cp ./spl/u-boot-spl.bin $out
|
||||||
|
cp ${dtbPath} $out
|
||||||
|
cp .config $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
dontStrip = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Shared kernel configuration for i.MX platforms
|
||||||
|
# This configuration is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
# Common kernel extra configuration for i.MX platforms
|
||||||
|
# Includes: virtualization support, EFI boot, RAID, USB/IP, framebuffer settings
|
||||||
|
imxCommonKernelConfig = ''
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Shared U-Boot configuration for i.MX platforms
|
||||||
|
# This configuration is used across i.MX93, i.MX8MP, i.MX8MQ and similar platforms
|
||||||
|
{
|
||||||
|
# Generate common U-Boot extra configuration for i.MX platforms
|
||||||
|
# ramdiskAddr and fdtAddr are platform-specific memory addresses
|
||||||
|
imxCommonUbootConfig =
|
||||||
|
{ ramdiskAddr, fdtAddr }:
|
||||||
|
''
|
||||||
|
CONFIG_USE_BOOTCOMMAND=y
|
||||||
|
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r ${ramdiskAddr}; setenv fdt_addr_r ${fdtAddr}; 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
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Common U-Boot native build inputs for i.MX platforms
|
||||||
|
imxCommonUbootNativeBuildInputs = [
|
||||||
|
"bison"
|
||||||
|
"flex"
|
||||||
|
"openssl"
|
||||||
|
"which"
|
||||||
|
"ncurses"
|
||||||
|
"libuuid"
|
||||||
|
"gnutls"
|
||||||
|
"openssl"
|
||||||
|
"perl"
|
||||||
|
"efitools"
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/linux-imx8.nix { });
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/linux-imx8.nix { });
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
enable-tee ? true,
|
enable-tee ? true,
|
||||||
}:
|
}:
|
||||||
with pkgs;
|
|
||||||
let
|
let
|
||||||
fw-ver = "202006";
|
fw-ver = "202006";
|
||||||
cp-tee = if enable-tee then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin" else "";
|
cp-tee = if enable-tee then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin" else "";
|
||||||
@@ -22,7 +21,7 @@ let
|
|||||||
shortRev = builtins.substring 0 8 src.rev;
|
shortRev = builtins.substring 0 8 src.rev;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imx8m-boot = pkgs.stdenv.mkDerivation rec {
|
imx8m-boot = pkgs.buildPackages.stdenv.mkDerivation {
|
||||||
inherit src;
|
inherit src;
|
||||||
name = "imx8mp-mkimage";
|
name = "imx8mp-mkimage";
|
||||||
version = "lf-6.1.55-2.2.0";
|
version = "lf-6.1.55-2.2.0";
|
||||||
@@ -30,22 +29,16 @@ in
|
|||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace Makefile \
|
substituteInPlace Makefile \
|
||||||
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||||
substituteInPlace Makefile \
|
|
||||||
--replace 'CC = gcc' 'CC = clang'
|
|
||||||
patchShebangs scripts
|
patchShebangs scripts
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
clang
|
pkgs.buildPackages.stdenv.cc
|
||||||
git
|
pkgs.buildPackages.git
|
||||||
dtc
|
pkgs.buildPackages.dtc
|
||||||
];
|
pkgs.buildPackages.glibc.static
|
||||||
|
pkgs.buildPackages.zlib
|
||||||
buildInputs = [
|
pkgs.buildPackages.zlib.static
|
||||||
git
|
|
||||||
glibc.static
|
|
||||||
zlib
|
|
||||||
zlib.static
|
|
||||||
];
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@@ -54,7 +47,7 @@ in
|
|||||||
make bin
|
make bin
|
||||||
make SOC=iMX8MP mkimage_imx8
|
make SOC=iMX8MP mkimage_imx8
|
||||||
|
|
||||||
cp -v ${pkgs.ubootTools}/bin/mkimage ./iMX8M/mkimage_uboot
|
cp -v ${pkgs.buildPackages.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-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}/u-boot-nodtb.bin ./iMX8M/u-boot-nodtb.bin
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
${pkgs.bash}/bin/bash $src --auto-accept --force
|
${pkgs.buildPackages.bash}/bin/bash $src --auto-accept --force
|
||||||
mv firmware-imx-${version} $out
|
mv firmware-imx-${version} $out
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
@@ -1,56 +1,20 @@
|
|||||||
{ pkgs, ... }@args:
|
{ pkgs, ... }@args:
|
||||||
with pkgs;
|
(pkgs.callPackage ../../common/bsp/imx-linux-builder.nix args) {
|
||||||
buildLinux (
|
pname = "imx8mp-linux";
|
||||||
args
|
|
||||||
// rec {
|
|
||||||
version = "6.12.20";
|
version = "6.12.20";
|
||||||
name = "imx8mp-linux";
|
|
||||||
|
|
||||||
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
src = pkgs.fetchFromGitHub {
|
||||||
modDirVersion = version;
|
|
||||||
|
|
||||||
defconfig = "imx_v8_defconfig";
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/366004
|
|
||||||
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
|
||||||
ignoreConfigErrors = true;
|
|
||||||
|
|
||||||
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";
|
owner = "nxp-imx";
|
||||||
repo = "linux-imx";
|
repo = "linux-imx";
|
||||||
# tag: lf-6.12.20-2.0.0
|
# tag: lf-6.12.20-2.0.0
|
||||||
rev = "dfaf2136deb2af2e60b994421281ba42f1c087e0";
|
rev = "dfaf2136deb2af2e60b994421281ba42f1c087e0";
|
||||||
sha256 = "sha256-ITrmj3a5YfXh/PSRTi+Rlto5uEBIAWFWtkTsO1ATXIo=";
|
sha256 = "sha256-ITrmj3a5YfXh/PSRTi+Rlto5uEBIAWFWtkTsO1ATXIo=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Platform-specific configuration (if any)
|
||||||
|
extraConfig = "";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
}
|
}
|
||||||
// (args.argsOverride or { })
|
|
||||||
)
|
|
||||||
@@ -1,69 +1,13 @@
|
|||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
let
|
pkgs.callPackage ../../common/bsp/imx-optee-builder.nix {
|
||||||
inherit (pkgs.buildPackages) python3;
|
|
||||||
toolchain = pkgs.gccStdenv.cc;
|
|
||||||
binutils = pkgs.gccStdenv.cc.bintools.bintools_bin;
|
|
||||||
cpp = pkgs.gcc;
|
|
||||||
in
|
|
||||||
pkgs.stdenv.mkDerivation rec {
|
|
||||||
pname = "imx8mp-optee-os";
|
pname = "imx8mp-optee-os";
|
||||||
version = "lf-6.12.20-2.0.0";
|
version = "lf-6.12.20-2.0.0";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
propagatedBuildInputs = with python3.pkgs; [
|
|
||||||
pycryptodomex
|
|
||||||
pyelftools
|
|
||||||
cryptography
|
|
||||||
];
|
|
||||||
|
|
||||||
src = pkgs.fetchgit {
|
src = pkgs.fetchgit {
|
||||||
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||||
rev = "87964807d80baf1dcfd89cafc66de34a1cf16bf3";
|
rev = "87964807d80baf1dcfd89cafc66de34a1cf16bf3";
|
||||||
sha256 = "sha256-AMZUMgmmyi5l3BMT84uubwjU0lwNObs9XW6ZCbqfhmc=";
|
sha256 = "sha256-AMZUMgmmyi5l3BMT84uubwjU0lwNObs9XW6ZCbqfhmc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
platformFlavor = "mx8mpevk";
|
||||||
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 '/usr/bin/env bash' '${pkgs.bash}/bin/bash'
|
|
||||||
substituteInPlace ta/pkcs11/scripts/dump_ec_curve_params.sh \
|
|
||||||
--replace '/usr/bin/env 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
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
@@ -1,93 +1,17 @@
|
|||||||
{
|
{ pkgs, fetchgit }:
|
||||||
stdenv,
|
pkgs.callPackage ../../common/bsp/imx-uboot-builder.nix {
|
||||||
lib,
|
pname = "imx8mp-uboot";
|
||||||
bison,
|
version = "2025.04";
|
||||||
dtc,
|
|
||||||
fetchgit,
|
src = fetchgit {
|
||||||
flex,
|
|
||||||
gnutls,
|
|
||||||
libuuid,
|
|
||||||
ncurses,
|
|
||||||
openssl,
|
|
||||||
which,
|
|
||||||
perl,
|
|
||||||
buildPackages,
|
|
||||||
efitools,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
ubsrc = fetchgit {
|
|
||||||
url = "https://github.com/nxp-imx/uboot-imx.git";
|
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||||
# tag: lf-6.12.20-2.0.0
|
# tag: lf-6.12.20-2.0.0
|
||||||
rev = "9383f8387dc76524524da69992db96c22195a57c";
|
rev = "9383f8387dc76524524da69992db96c22195a57c";
|
||||||
sha256 = "sha256-httRSwN8NiKOdL7fZEvN/4AbypGQfegYtJgxKIea+Zg=";
|
sha256 = "sha256-httRSwN8NiKOdL7fZEvN/4AbypGQfegYtJgxKIea+Zg=";
|
||||||
};
|
};
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "imx8mp-uboot";
|
|
||||||
version = "2025.04";
|
|
||||||
src = ubsrc;
|
|
||||||
|
|
||||||
postPatch = ''
|
defconfig = "imx8mp_evk_defconfig";
|
||||||
patchShebangs tools
|
ramdiskAddr = "0x45000000";
|
||||||
patchShebangs scripts
|
fdtAddr = "0x44000000";
|
||||||
'';
|
dtbPath = "./dts/upstream/src/arm64/freescale/imx8mp-evk.dtb";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
bison
|
|
||||||
flex
|
|
||||||
openssl
|
|
||||||
which
|
|
||||||
ncurses
|
|
||||||
libuuid
|
|
||||||
gnutls
|
|
||||||
openssl
|
|
||||||
perl
|
|
||||||
efitools
|
|
||||||
];
|
|
||||||
|
|
||||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
||||||
hardeningDisable = [ "all" ];
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"DTC=${lib.getExe buildPackages.dtc}"
|
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
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
|
|
||||||
'';
|
|
||||||
|
|
||||||
passAsFile = [ "extraConfig" ];
|
|
||||||
|
|
||||||
configurePhase = ''
|
|
||||||
runHook preConfigure
|
|
||||||
|
|
||||||
make imx8mp_evk_defconfig
|
|
||||||
cat $extraConfigPath >> .config
|
|
||||||
|
|
||||||
runHook postConfigure
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
cp ./u-boot-nodtb.bin $out
|
|
||||||
cp ./spl/u-boot-spl.bin $out
|
|
||||||
cp ./dts/upstream/src/arm64/freescale/imx8mp-evk.dtb $out
|
|
||||||
cp .config $out
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontStrip = true;
|
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix { });
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix { });
|
||||||
|
|||||||
@@ -1,56 +1,20 @@
|
|||||||
{ pkgs, ... }@args:
|
{ pkgs, ... }@args:
|
||||||
with pkgs;
|
(pkgs.callPackage ../../common/bsp/imx-linux-builder.nix args) {
|
||||||
buildLinux (
|
pname = "imx8mq-linux";
|
||||||
args
|
|
||||||
// rec {
|
|
||||||
version = "6.1.55";
|
version = "6.1.55";
|
||||||
name = "imx8mq-linux";
|
|
||||||
|
|
||||||
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
src = pkgs.fetchFromGitHub {
|
||||||
modDirVersion = version;
|
|
||||||
|
|
||||||
defconfig = "imx_v8_defconfig";
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/366004
|
|
||||||
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
|
||||||
ignoreConfigErrors = true;
|
|
||||||
|
|
||||||
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";
|
owner = "nxp-imx";
|
||||||
repo = "linux-imx";
|
repo = "linux-imx";
|
||||||
# tag: lf-6.1.55-2.2.0
|
# tag: lf-6.1.55-2.2.0
|
||||||
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
|
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
|
||||||
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
|
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Platform-specific configuration (if any)
|
||||||
|
extraConfig = "";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
}
|
}
|
||||||
// (args.argsOverride or { })
|
|
||||||
)
|
|
||||||
@@ -1,67 +1,13 @@
|
|||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
let
|
pkgs.callPackage ../../common/bsp/imx-optee-builder.nix {
|
||||||
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";
|
pname = "imx8mq-optee-os";
|
||||||
version = "lf-6.1.55-2.2.0";
|
version = "lf-6.1.55-2.2.0";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
propagatedBuildInputs = with python3.pkgs; [
|
|
||||||
pycryptodomex
|
|
||||||
pyelftools
|
|
||||||
cryptography
|
|
||||||
];
|
|
||||||
|
|
||||||
src = pkgs.fetchgit {
|
src = pkgs.fetchgit {
|
||||||
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||||
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
|
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
|
||||||
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
|
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
platformFlavor = "mx8mqevk";
|
||||||
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
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
@@ -1,91 +1,17 @@
|
|||||||
{
|
{ pkgs, fetchgit }:
|
||||||
stdenv,
|
pkgs.callPackage ../../common/bsp/imx-uboot-builder.nix {
|
||||||
lib,
|
pname = "imx8mq-uboot";
|
||||||
bison,
|
version = "2023.04";
|
||||||
dtc,
|
|
||||||
fetchgit,
|
src = fetchgit {
|
||||||
flex,
|
|
||||||
gnutls,
|
|
||||||
libuuid,
|
|
||||||
ncurses,
|
|
||||||
openssl,
|
|
||||||
which,
|
|
||||||
perl,
|
|
||||||
buildPackages,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
ubsrc = fetchgit {
|
|
||||||
url = "https://github.com/nxp-imx/uboot-imx.git";
|
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||||
# tag: "lf-6.1.55-2.2.0"
|
# tag: "lf-6.1.55-2.2.0"
|
||||||
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
|
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
|
||||||
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
|
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
|
||||||
};
|
};
|
||||||
in
|
|
||||||
(stdenv.mkDerivation {
|
|
||||||
pname = "imx8mq-uboot";
|
|
||||||
version = "2023.04";
|
|
||||||
src = ubsrc;
|
|
||||||
|
|
||||||
postPatch = ''
|
defconfig = "imx8mq_evk_defconfig";
|
||||||
patchShebangs tools
|
ramdiskAddr = "0x45000000";
|
||||||
patchShebangs scripts
|
fdtAddr = "0x44000000";
|
||||||
'';
|
dtbPath = "./arch/arm/dts/imx8mq-evk.dtb";
|
||||||
|
}
|
||||||
nativeBuildInputs = [
|
|
||||||
bison
|
|
||||||
flex
|
|
||||||
openssl
|
|
||||||
which
|
|
||||||
ncurses
|
|
||||||
libuuid
|
|
||||||
gnutls
|
|
||||||
openssl
|
|
||||||
perl
|
|
||||||
];
|
|
||||||
|
|
||||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
||||||
hardeningDisable = [ "all" ];
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"DTC=${lib.getExe buildPackages.dtc}"
|
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
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
|
|
||||||
'';
|
|
||||||
|
|
||||||
passAsFile = [ "extraConfig" ];
|
|
||||||
|
|
||||||
configurePhase = ''
|
|
||||||
runHook preConfigure
|
|
||||||
|
|
||||||
make imx8mq_evk_defconfig
|
|
||||||
cat $extraConfigPath >> .config
|
|
||||||
|
|
||||||
runHook postConfigure
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
cp ./u-boot-nodtb.bin $out
|
|
||||||
cp ./spl/u-boot-spl.bin $out
|
|
||||||
cp ./arch/arm/dts/imx8mq-evk.dtb $out
|
|
||||||
cp .config $out
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontStrip = true;
|
|
||||||
})
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix { });
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix { });
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchgit,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
pkgsCross,
|
||||||
|
openssl,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
target-board = "imx93";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "imx93-atf";
|
||||||
|
version = "2.10.0";
|
||||||
|
platform = target-board;
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/imx-atf.git";
|
||||||
|
rev = "28affcae957cb8194917b5246276630f9e6343e1";
|
||||||
|
sha256 = "sha256-a8F+Lf8pwML+tCwawS0N/mrSXWPmFhlUeOg0MCRK3VE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Compiler dependencies
|
||||||
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
nativeBuildInputs = [ pkgsCross.aarch64-embedded.stdenv.cc ];
|
||||||
|
|
||||||
|
buildInputs = [ openssl ];
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"HOSTCC=$(CC_FOR_BUILD)"
|
||||||
|
"CROSS_COMPILE=${pkgsCross.aarch64-embedded.stdenv.cc.targetPrefix}"
|
||||||
|
"PLAT=${platform}"
|
||||||
|
"SPD=opteed"
|
||||||
|
"bl31"
|
||||||
|
"LDFLAGS=-no-warn-rwx-segments"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out
|
||||||
|
cp build/${target-board}/release/bl31.bin $out
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
hardeningDisable = [ "all" ];
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/nxp-imx/imx-atf";
|
||||||
|
description = "Reference implementation of secure world software for ARMv8-A";
|
||||||
|
license = [ licenses.bsd3 ];
|
||||||
|
maintainers = with maintainers; [ govindsi ];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
|
with pkgs;
|
||||||
|
let
|
||||||
|
|
||||||
|
imx93-atf = pkgs.callPackage ./imx93-atf.nix { };
|
||||||
|
imx93-firmware = pkgs.callPackage ./imx93-firmware.nix { };
|
||||||
|
imx93-uboot = pkgs.callPackage ./imx93-uboot.nix { };
|
||||||
|
imx93-optee-os = pkgs.callPackage ./imx93-optee-os.nix { };
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/imx-mkimage.git";
|
||||||
|
#tag: lf-6.12.3
|
||||||
|
rev = "4622115cbc037f79039c4522faeced4aabea986b";
|
||||||
|
sha256 = "sha256-2gz0GxlB3jwy8PC6+cP3+MpyUzqE1vDTw8nuxK6vo3g=";
|
||||||
|
};
|
||||||
|
shortRev = builtins.substring 0 8 src.rev;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imx93-boot = pkgs.stdenv.mkDerivation rec {
|
||||||
|
inherit src;
|
||||||
|
name = "imx93-mkimage";
|
||||||
|
version = "lf-6.12.3";
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace 'CC = gcc' 'CC = clang'
|
||||||
|
substituteInPlace iMX93/soc.mak \
|
||||||
|
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_fcb_gen.sh \
|
||||||
|
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||||
|
substituteInPlace scripts/fspi_packer.sh \
|
||||||
|
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||||
|
patchShebangs scripts
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
clang
|
||||||
|
git
|
||||||
|
dtc
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
git
|
||||||
|
glibc.static
|
||||||
|
zlib
|
||||||
|
zlib.static
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
make bin
|
||||||
|
# mkimage is common across imx8 and imx9
|
||||||
|
make SOC=iMX8M mkimage_imx8
|
||||||
|
|
||||||
|
if [ -f ${imx93-uboot}/u-boot.bin ]; then
|
||||||
|
install -m 0644 ${imx93-uboot}/u-boot.bin ./iMX93/u-boot.bin
|
||||||
|
else
|
||||||
|
cat ${imx93-uboot}/u-boot-nodtb.bin ${imx93-uboot}/imx93-11x11-evk.dtb > ./iMX93/u-boot.bin
|
||||||
|
fi
|
||||||
|
install -m 0644 ${imx93-uboot}/u-boot-spl.bin ./iMX93/u-boot-spl.bin
|
||||||
|
install -m 0644 ${imx93-uboot}/u-boot-nodtb.bin ./iMX93/u-boot-nodtb.bin
|
||||||
|
install -m 0644 ${imx93-uboot}/imx93-11x11-evk.dtb ./iMX93/imx93-11x11-evk.dtb
|
||||||
|
install -m 0644 ${imx93-optee-os}/tee.bin ./iMX93/tee.bin
|
||||||
|
install -m 0644 ${imx93-atf}/bl31.bin ./iMX93/bl31.bin
|
||||||
|
install -m 0644 ${imx93-firmware}/ddr/lpddr4* ./iMX93/
|
||||||
|
install -m 0644 ${imx93-firmware}/ahab/mx93a1-ahab-container.img ./iMX93/
|
||||||
|
|
||||||
|
make SOC=iMX9 flash_singleboot
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out/image
|
||||||
|
install -m 0644 ./iMX93/flash.bin $out/image
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs;
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "nxp-firmware";
|
||||||
|
version = "nxp-firmware-8.21-0.11";
|
||||||
|
|
||||||
|
ddrFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.21.bin";
|
||||||
|
sha256 = "sha256-w0R/D4E0FczqncLvEggMs6yLvAxnOSp0/H1ZIF61pnI=";
|
||||||
|
};
|
||||||
|
|
||||||
|
ahabFirmware = fetchurl {
|
||||||
|
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.11.bin";
|
||||||
|
sha256 = "sha256-JpSAQXqK6apMxBAauUcof8M0VakxAh29xNm621ISvOs=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
coreutils
|
||||||
|
bash
|
||||||
|
];
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
|
||||||
|
echo "Extracting DDR firmware..."
|
||||||
|
cp ${ddrFirmware} ./firmware-imx-8.21.bin
|
||||||
|
chmod +x firmware-imx-8.21.bin
|
||||||
|
./firmware-imx-8.21.bin --auto-accept
|
||||||
|
|
||||||
|
echo "Extracting AHAB firmware..."
|
||||||
|
cp ${ahabFirmware} ./firmware-sentinel-0.11.bin
|
||||||
|
chmod +x firmware-sentinel-0.11.bin
|
||||||
|
./firmware-sentinel-0.11.bin --auto-accept
|
||||||
|
|
||||||
|
echo "Copying DDR .bin files..."
|
||||||
|
mkdir -p $out/ddr
|
||||||
|
cp firmware-imx-8.21/firmware/ddr/synopsys/lpddr4*.bin $out/ddr/
|
||||||
|
|
||||||
|
echo "Copying AHAB container image..."
|
||||||
|
mkdir -p $out/ahab
|
||||||
|
cp firmware-sentinel-0.11/mx93a1-ahab-container.img $out/ahab/
|
||||||
|
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{ pkgs, ... }@args:
|
||||||
|
(pkgs.callPackage ../../common/bsp/imx-linux-builder.nix args) {
|
||||||
|
pname = "imx93-linux";
|
||||||
|
version = "6.12.3";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "nxp-imx";
|
||||||
|
repo = "linux-imx";
|
||||||
|
# tag: lf-6.12.3
|
||||||
|
rev = "37d02f4dcbbe6677dc9f5fc17f386c05d6a7bd7a";
|
||||||
|
sha256 = "sha256-1oJMbHR8Ho0zNritEJ+TMOAyYHCW0vwhPkDfLctrZa8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Platform-specific configuration (if any)
|
||||||
|
extraConfig = "";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/366004
|
||||||
|
# introduced a breaking change that if a module is declared but it is not being used it will faill.
|
||||||
|
ignoreConfigErrors = true;
|
||||||
|
|
||||||
|
extraMeta = {
|
||||||
|
maintainers = with pkgs.lib.maintainers; [ govindsi ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
pkgs.callPackage ../../common/bsp/imx-optee-builder.nix {
|
||||||
|
pname = "imx93-optee-os";
|
||||||
|
version = "lf-6.12.3_1.0.0";
|
||||||
|
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||||
|
rev = "8dd180b6d149c1e1314b5869697179f665bd9ca3";
|
||||||
|
sha256 = "sha256-PoolRscdyeGevrOa5YymPTQ36edVvReMM5WshRTz+uk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
platformFlavor = "imx-mx93evk";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
maintainers = with pkgs.lib.maintainers; [ govindsi ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{ pkgs, fetchgit }:
|
||||||
|
pkgs.callPackage ../../common/bsp/imx-uboot-builder.nix {
|
||||||
|
pname = "imx93-uboot";
|
||||||
|
version = "2024.04";
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||||
|
#lf_v2024.04
|
||||||
|
rev = "e3219a5a73445219df605d1492687918d488055c";
|
||||||
|
sha256 = "sha256-6pXwgNzq4/XUUEmJ6sGC5pII4J5uMvlDPE9QJxjJJbQ=";
|
||||||
|
};
|
||||||
|
|
||||||
|
defconfig = "imx93_11x11_evk_defconfig";
|
||||||
|
ramdiskAddr = "0x85000000";
|
||||||
|
fdtAddr = "0x84000000";
|
||||||
|
dtbPath = "./arch/arm/dts/imx93-11x11-evk.dtb";
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import ./overlay.nix)
|
||||||
|
];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./modules.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.grub.extraFiles = {
|
||||||
|
"imx93-11x11-evk.dtb" = "${
|
||||||
|
pkgs.callPackage ./bsp/imx93-linux.nix { }
|
||||||
|
}/dtbs/freescale/imx93-11x11-evk.dtb";
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.deviceTree = {
|
||||||
|
filter = "imx93-*.dtb";
|
||||||
|
name = "imx93-11x11-evk.dtb";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx93-linux.nix { });
|
||||||
|
initrd.includeDefaultModules = lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
disabledModules = [ "profiles/all-hardware.nix" ];
|
||||||
|
|
||||||
|
hardware.deviceTree.enable = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
final: _prev: {
|
||||||
|
inherit (final.callPackage ./bsp/imx93-boot.nix { pkgs = final; }) imx93-boot;
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
nixpkgs.hostPlatform.system = lib.mkDefault "aarch64-linux";
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../common/cpu/intel
|
||||||
|
../../../common/pc/laptop
|
||||||
|
../../../common/pc/ssd
|
||||||
|
];
|
||||||
|
|
||||||
|
# Force use of the intel_backlight driver for backlight control.
|
||||||
|
# This allows the backlight save/load systemd service to work.
|
||||||
|
boot.kernelParams = [ "acpi_backlight=video" ];
|
||||||
|
}
|
||||||
@@ -45,7 +45,8 @@ let
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
{ patch = ./irq-desc-to-data.patch; }
|
{ patch = ./irq-desc-to-data.patch; }
|
||||||
] ++ kernelPatches;
|
]
|
||||||
|
++ kernelPatches;
|
||||||
|
|
||||||
structuredExtraConfig = with lib.kernel; {
|
structuredExtraConfig = with lib.kernel; {
|
||||||
# A ton of stuff just does not build. We disable it all.
|
# A ton of stuff just does not build. We disable it all.
|
||||||
|
|||||||
@@ -5,7 +5,13 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
boot.kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi3;
|
boot = {
|
||||||
|
kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi3;
|
||||||
|
initrd.availableKernelModules = [
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# fix the following error :
|
# fix the following error :
|
||||||
# modprobe: FATAL: Module ahci not found in directory
|
# modprobe: FATAL: Module ahci not found in directory
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".audio = {
|
raspberry-pi."4".audio = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "configuration for audio";
|
||||||
configuration for audio
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".backlight = {
|
raspberry-pi."4".backlight = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "the backlight support for the Raspberry Pi official Touch Display";
|
||||||
Enable the backlight support for the Raspberry Pi official Touch Display
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".bluetooth = {
|
raspberry-pi."4".bluetooth = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "configuration for bluetooth";
|
||||||
configuration for bluetooth
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,15 +6,13 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".digi-amp-plus = {
|
raspberry-pi."4".digi-amp-plus = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "support for the IQaudIO DigiAMP+ Hat";
|
||||||
support for the IQaudIO DigiAMP+ Hat.
|
|
||||||
'';
|
|
||||||
|
|
||||||
unmuteAmp = lib.mkOption {
|
unmuteAmp = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
"one-shot" unmute when kernel module first loads.
|
Whether to "one-shot" unmute when kernel module first loads.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".dwc2 = {
|
raspberry-pi."4".dwc2 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = ''
|
||||||
Enable the UDC controller to support USB OTG gadget functions.
|
Enable the UDC controller to support USB OTG gadget functions.
|
||||||
|
|
||||||
In order to verify that this works, connect the Raspberry Pi with
|
In order to verify that this works, connect the Raspberry Pi with
|
||||||
@@ -24,6 +28,7 @@ in
|
|||||||
guides on how to test them, please refer to:
|
guides on how to test them, please refer to:
|
||||||
https://www.kernel.org/doc/Documentation/usb/gadget-testing.txt
|
https://www.kernel.org/doc/Documentation/usb/gadget-testing.txt
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
dr_mode = lib.mkOption {
|
dr_mode = lib.mkOption {
|
||||||
type = lib.types.enum [
|
type = lib.types.enum [
|
||||||
"host"
|
"host"
|
||||||
|
|||||||
@@ -31,28 +31,32 @@ in
|
|||||||
{
|
{
|
||||||
options.hardware.raspberry-pi."4" = {
|
options.hardware.raspberry-pi."4" = {
|
||||||
i2c0 = {
|
i2c0 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
Turn on the VideoCore I2C bus (maps to /dev/i2c-22) and enable access from the i2c group.
|
Turn on the VideoCore I2C bus (maps to /dev/i2c-22) and enable access from the i2c group.
|
||||||
After a reboot, i2c-tools (e.g. i2cdetect -F 22) should work for root or any user in i2c.
|
After a reboot, i2c-tools (e.g. i2cdetect -F 22) should work for root or any user in i2c.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
frequency = lib.mkOption {
|
frequency = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
interface clock-frequency
|
The interface clock-frequency to configure.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
i2c1 = {
|
i2c1 = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
Turn on the ARM I2C bus (/dev/i2c-1 on GPIO pins 3 and 5) and enable access from the i2c group.
|
Turn on the ARM I2C bus (/dev/i2c-1 on GPIO pins 3 and 5) and enable access from the i2c group.
|
||||||
After a reboot, i2c-tools (e.g. i2cdetect -F 1) should work for root or any user in i2c.
|
After a reboot, i2c-tools (e.g. i2cdetect -F 1) should work for root or any user in i2c.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
frequency = lib.mkOption {
|
frequency = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
interface clock-frequency
|
The interface clock-frequency to configure.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user