mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-11-30 13:03:30 +01:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e60c66bd0b | ||
|
|
e4c6ee69e7 | ||
|
|
ae91411396 | ||
|
|
d48e8f0e16 | ||
|
|
eea20ba3b0 | ||
|
|
2e85ae1b70 | ||
|
|
8b72f74d80 | ||
|
|
655a6da8a8 | ||
|
|
bffe23e699 | ||
|
|
5ad68c5dff | ||
|
|
fad92f5f57 | ||
|
|
f2e49f279c | ||
|
|
2567706185 | ||
|
|
7467f155fc | ||
|
|
ddb27b7bba | ||
|
|
13cc234e37 | ||
|
|
37d0301b3c |
No files matched your search
+3
-2
@@ -14,8 +14,9 @@ For example:
|
||||
|
||||
```nix
|
||||
{ lib }: {
|
||||
# Using mkDefault, because the user might want to disable tlp
|
||||
services.tlp.enable = lib.mkDefault true;
|
||||
# Using mkDefault, because the user might want to disable power-profiles-daemon
|
||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||
|
||||
# No need to use mkDefault, because the setting will merge with the user's setting
|
||||
boot.kernelModules = [ "tmp_smapi" ];
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8")
|
||||
[ "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.
|
||||
# https://asus-linux.org/manual/asusctl-manual/
|
||||
services = {
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [ ../. ];
|
||||
|
||||
# Gnome 40 introduced a new way of managing power, without tlp.
|
||||
# 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
|
||||
);
|
||||
config.services.power-profiles-daemon.enable = lib.mkDefault (!config.services.tlp.enable);
|
||||
}
|
||||
+30
-2
@@ -23,7 +23,35 @@ Boot ROM initializes the SoC and loads OEI, which runs in TCM to perform early s
|
||||
}
|
||||
```
|
||||
|
||||
### 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 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/)
|
||||
@@ -1,17 +1,24 @@
|
||||
{
|
||||
pkgs,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
clang,
|
||||
git,
|
||||
dtc,
|
||||
glibc,
|
||||
zlib,
|
||||
vim,
|
||||
}:
|
||||
with pkgs;
|
||||
let
|
||||
|
||||
imx95-atf = pkgs.callPackage ./ucm-imx95-atf.nix { };
|
||||
imx95-firmware = pkgs.callPackage ./ucm-imx95-firmware.nix { };
|
||||
imx95-uboot = pkgs.callPackage ./ucm-imx95-uboot.nix { };
|
||||
imx95-optee-os = pkgs.callPackage ./ucm-imx95-optee-os.nix { };
|
||||
imx95-sm-fw = pkgs.callPackage ./ucm-imx95-sm-fw.nix { };
|
||||
imx95-oei-ddr = pkgs.callPackage ./ucm-imx95-oei-ddr.nix { };
|
||||
imx95-oei-tcm = pkgs.callPackage ./ucm-imx95-oei-tcm.nix { };
|
||||
src = pkgs.fetchFromGitHub {
|
||||
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
|
||||
@@ -21,7 +28,7 @@ let
|
||||
shortRev = builtins.substring 0 8 src.rev;
|
||||
in
|
||||
{
|
||||
imx95-boot = pkgs.stdenv.mkDerivation rec {
|
||||
imx95-boot = stdenv.mkDerivation rec {
|
||||
inherit src;
|
||||
name = "imx95-mkimage";
|
||||
version = "lf-6.6.52-2.2.1";
|
||||
@@ -32,11 +39,11 @@ in
|
||||
substituteInPlace Makefile \
|
||||
--replace-fail 'CC = gcc' 'CC = clang'
|
||||
substituteInPlace iMX95/soc.mak \
|
||||
--replace-fail 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||
substituteInPlace scripts/fspi_fcb_gen.sh \
|
||||
--replace-fail 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||
substituteInPlace scripts/fspi_packer.sh \
|
||||
--replace-fail 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
||||
--replace-fail 'xxd' "${vim.xxd}/bin/xxd"
|
||||
patchShebangs scripts
|
||||
'';
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
{
|
||||
pkgs,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
coreutils,
|
||||
bash,
|
||||
siliconRev ? "A0",
|
||||
...
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "nxp-firmware-imx95";
|
||||
version = "nxp-firmware-8.28-994fa14";
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{ lib, pkgs, ... }@args:
|
||||
with pkgs;
|
||||
{
|
||||
lib,
|
||||
buildLinux,
|
||||
fetchFromGitHub,
|
||||
...
|
||||
}@args:
|
||||
buildLinux (
|
||||
args
|
||||
// rec {
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
gcc-arm-embedded,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
}:
|
||||
let
|
||||
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx95-imx-oei";
|
||||
version = "lf-6.6.36-2.1.0";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.buildPackages.python3
|
||||
pkgs.gcc-arm-embedded
|
||||
buildPackages.python3
|
||||
gcc-arm-embedded
|
||||
];
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
src = fetchFromGitHub {
|
||||
owner = "nxp-imx";
|
||||
repo = "imx-oei";
|
||||
rev = "5fca9f47544d03c52ca371eadfffbfd2454e6925";
|
||||
@@ -22,15 +26,15 @@ pkgs.stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
patches = [
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
@@ -45,8 +49,8 @@ pkgs.stdenv.mkDerivation rec {
|
||||
|
||||
makeFlags = [
|
||||
"board=mx95lp5"
|
||||
"CROSS_COMPILE=${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"OEI_CROSS_COMPILE=${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"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"
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
gcc-arm-embedded,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
}:
|
||||
let
|
||||
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx95-imx-oei-tcm";
|
||||
version = "lf-6.6.36-2.1.0";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.buildPackages.python3
|
||||
pkgs.gcc-arm-embedded
|
||||
buildPackages.python3
|
||||
gcc-arm-embedded
|
||||
];
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
src = fetchFromGitHub {
|
||||
owner = "nxp-imx";
|
||||
repo = "imx-oei";
|
||||
rev = "5fca9f47544d03c52ca371eadfffbfd2454e6925";
|
||||
@@ -22,15 +26,15 @@ pkgs.stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
patches = [
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
@@ -45,8 +49,8 @@ pkgs.stdenv.mkDerivation rec {
|
||||
|
||||
makeFlags = [
|
||||
"board=mx95lp5"
|
||||
"CROSS_COMPILE=${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"OEI_CROSS_COMPILE=${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"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"
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
buildPackages,
|
||||
bash,
|
||||
}:
|
||||
let
|
||||
inherit (pkgs.buildPackages) python3;
|
||||
toolchain = pkgs.gccStdenv.cc;
|
||||
binutils = pkgs.gccStdenv.cc.bintools.bintools_bin;
|
||||
cpp = pkgs.gccStdenv.cc;
|
||||
inherit (buildPackages) python3;
|
||||
toolchain = stdenv.cc;
|
||||
binutils = stdenv.cc.bintools.bintools_bin;
|
||||
cpp = stdenv.cc;
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
stdenv.mkDerivation {
|
||||
pname = "imx95-optee-os";
|
||||
version = "lf-6.6.36_2.1.0";
|
||||
|
||||
@@ -24,7 +27,7 @@ pkgs.stdenv.mkDerivation {
|
||||
cryptography
|
||||
];
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
src = fetchFromGitHub {
|
||||
owner = "nxp-imx";
|
||||
repo = "imx-optee-os";
|
||||
rev = "612bc5a642a4608d282abeee2349d86de996d7ee";
|
||||
@@ -50,7 +53,7 @@ pkgs.stdenv.mkDerivation {
|
||||
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' '${pkgs.bash}/bin/bash'
|
||||
--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 \
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
gcc-arm-embedded,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
}:
|
||||
let
|
||||
metaBspImx95Rev = "224eed17cddc573061150e9d2ce6f9acb39ea50e"; # scarthgap-6.6.36-EVAL-UCM-iMX95-1.0
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx95-sm-fw";
|
||||
version = "lf-6.6.36-2.1.0";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.buildPackages.python3
|
||||
pkgs.gcc-arm-embedded
|
||||
buildPackages.python3
|
||||
gcc-arm-embedded
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with pkgs.buildPackages.python3.pkgs; [
|
||||
propagatedBuildInputs = with buildPackages.python3.pkgs; [
|
||||
pycryptodomex
|
||||
pyelftools
|
||||
cryptography
|
||||
];
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
src = fetchFromGitHub {
|
||||
owner = "nxp-imx";
|
||||
repo = "imx-sm";
|
||||
rev = "709deccd9338399eb39b5cf99a60eab4fa60d539";
|
||||
@@ -28,23 +32,23 @@ pkgs.stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
patches = [
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
(pkgs.fetchpatch {
|
||||
(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=";
|
||||
})
|
||||
@@ -52,7 +56,7 @@ pkgs.stdenv.mkDerivation rec {
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace sm/makefiles/gcc_cross.mak \
|
||||
--replace-fail "\$(SM_CROSS_COMPILE)objcopy" ${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-objcopy
|
||||
--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 \
|
||||
@@ -63,8 +67,8 @@ pkgs.stdenv.mkDerivation rec {
|
||||
makeFlags = [
|
||||
"config=mx95cust"
|
||||
"M=2"
|
||||
"CROSS_COMPILE=${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"CROSS_COMPILE64=${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"CROSS_COMPILE=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"CROSS_COMPILE64=${gcc-arm-embedded}/bin/arm-none-eabi-"
|
||||
"ARCH=arm"
|
||||
];
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/ucm-imx95-linux.nix { });
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
final: _prev: {
|
||||
inherit (final.callPackage ./bsp/ucm-imx95-boot.nix { pkgs = final; }) imx95-boot;
|
||||
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/)
|
||||
|
||||
`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,8 +6,6 @@
|
||||
../../../common/pc/laptop
|
||||
];
|
||||
|
||||
hardware.enableAllFirmware = lib.mkDefault true;
|
||||
|
||||
services = {
|
||||
fwupd.enable = lib.mkDefault true;
|
||||
thermald.enable = lib.mkDefault true;
|
||||
|
||||
@@ -462,11 +462,19 @@
|
||||
|
||||
# Add packages
|
||||
packages = eachSystem (
|
||||
pkgs: _system: {
|
||||
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`
|
||||
|
||||
@@ -18,8 +18,4 @@
|
||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||
"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;
|
||||
}
|
||||
@@ -18,8 +18,4 @@
|
||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||
"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;
|
||||
}
|
||||
@@ -10,11 +10,6 @@
|
||||
"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.
|
||||
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ in
|
||||
|
||||
nixpkgs.overlays = [ (import ./overlay.nix) ];
|
||||
|
||||
nixpkgs.hostPlatform = "armv7l-linux";
|
||||
nixpkgs.hostPlatform.system = "armv7l-linux";
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci_mvebu" ];
|
||||
|
||||
|
||||
@@ -17,9 +17,4 @@
|
||||
|
||||
# Cooling management
|
||||
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";
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
let
|
||||
# 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
|
||||
cp ${./16ach6h.bin} $out/lib/firmware/edid/16ach6h.bin
|
||||
'';
|
||||
|
||||
@@ -32,8 +32,4 @@
|
||||
|
||||
# Avoid issues with modesetting causing blank screen
|
||||
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;
|
||||
}
|
||||
@@ -110,9 +110,6 @@ in
|
||||
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
|
||||
hardware = {
|
||||
enableRedistributableFirmware = mkDefault true;
|
||||
|
||||
@@ -38,3 +38,52 @@ Code snippet example that enables 'imx8mp-evk/imx8mq-evk/imx93-evk' configuratio
|
||||
}
|
||||
```
|
||||
|
||||
### 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)
|
||||
|
||||
@@ -16,12 +16,12 @@ pkgs.stdenv.mkDerivation rec {
|
||||
--replace 'CC = gcc' 'CC = clang'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
clang
|
||||
git
|
||||
depsBuildBuild = [
|
||||
pkgs.buildPackages.stdenv.cc
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
clang
|
||||
git
|
||||
glibc.static
|
||||
];
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
}:
|
||||
let
|
||||
inherit (pkgs.buildPackages) python3;
|
||||
toolchain = pkgs.gccStdenv.cc;
|
||||
binutils = pkgs.gccStdenv.cc.bintools.bintools_bin;
|
||||
cpp = pkgs.gccStdenv.gcc;
|
||||
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")
|
||||
@@ -58,7 +58,7 @@ pkgs.stdenv.mkDerivation {
|
||||
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
|
||||
--replace-fail "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/${toolchain.targetPrefix}cpp
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/linux-imx8.nix { });
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
pkgs,
|
||||
enable-tee ? true,
|
||||
}:
|
||||
with pkgs;
|
||||
let
|
||||
fw-ver = "202006";
|
||||
cp-tee = if enable-tee then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin" else "";
|
||||
@@ -22,7 +21,7 @@ let
|
||||
shortRev = builtins.substring 0 8 src.rev;
|
||||
in
|
||||
{
|
||||
imx8m-boot = pkgs.stdenv.mkDerivation rec {
|
||||
imx8m-boot = pkgs.buildPackages.stdenv.mkDerivation {
|
||||
inherit src;
|
||||
name = "imx8mp-mkimage";
|
||||
version = "lf-6.1.55-2.2.0";
|
||||
@@ -30,22 +29,16 @@ in
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||
substituteInPlace Makefile \
|
||||
--replace 'CC = gcc' 'CC = clang'
|
||||
patchShebangs scripts
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
clang
|
||||
git
|
||||
dtc
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
git
|
||||
glibc.static
|
||||
zlib
|
||||
zlib.static
|
||||
pkgs.buildPackages.stdenv.cc
|
||||
pkgs.buildPackages.git
|
||||
pkgs.buildPackages.dtc
|
||||
pkgs.buildPackages.glibc.static
|
||||
pkgs.buildPackages.zlib
|
||||
pkgs.buildPackages.zlib.static
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
@@ -54,7 +47,7 @@ in
|
||||
make bin
|
||||
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-nodtb.bin ./iMX8M/u-boot-nodtb.bin
|
||||
|
||||
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
${pkgs.bash}/bin/bash $src --auto-accept --force
|
||||
${pkgs.buildPackages.bash}/bin/bash $src --auto-accept --force
|
||||
mv firmware-imx-${version} $out
|
||||
'';
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix { });
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix { });
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx93-linux.nix { });
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
nixpkgs.hostPlatform.system = lib.mkDefault "aarch64-linux";
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
}
|
||||
@@ -21,6 +21,11 @@ let
|
||||
"raspberry-pi-3"
|
||||
"raspberry-pi-4"
|
||||
"raspberry-pi-5"
|
||||
"nxp-imx8mp-evk"
|
||||
"nxp-imx8mq-evk"
|
||||
"nxp-imx8qm-mek"
|
||||
"nxp-imx93-evk"
|
||||
"ucm-imx95"
|
||||
];
|
||||
|
||||
matchArch =
|
||||
|
||||
Reference in new issue
Block a user