mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-08 19:46:10 +01:00
chore: format repo using treefmt-nix and nixfmt-rfc-style
This commit is contained in:
parent
fc7c471412
commit
51e51e6014
266 changed files with 3721 additions and 2733 deletions
|
|
@ -1,8 +1,17 @@
|
|||
{ lib, fetchgit, enable-tee, stdenv, buildPackages, pkgsCross, openssl, }:
|
||||
{
|
||||
lib,
|
||||
fetchgit,
|
||||
enable-tee,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
pkgsCross,
|
||||
openssl,
|
||||
}:
|
||||
let
|
||||
opteedflag = if enable-tee then "SPD=opteed" else "";
|
||||
target-board = "imx8mp";
|
||||
in stdenv.mkDerivation rec {
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx8mp-atf";
|
||||
version = "lf6.1.55_2.2.0";
|
||||
platform = target-board;
|
||||
|
|
@ -48,8 +57,7 @@ in stdenv.mkDerivation rec {
|
|||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/nxp-imx/imx-atf";
|
||||
description =
|
||||
"Reference implementation of secure world software for ARMv8-A";
|
||||
description = "Reference implementation of secure world software for ARMv8-A";
|
||||
license = [ licenses.bsd3 ];
|
||||
maintainers = with maintainers; [ gngram ];
|
||||
platforms = [ "aarch64-linux" ];
|
||||
|
|
|
|||
|
|
@ -2,26 +2,25 @@
|
|||
pkgs,
|
||||
enable-tee ? true,
|
||||
}:
|
||||
with pkgs; let
|
||||
with pkgs;
|
||||
let
|
||||
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 "";
|
||||
|
||||
imx8mp-atf = pkgs.callPackage ./imx8mp-atf.nix {
|
||||
inherit enable-tee;
|
||||
};
|
||||
imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix {};
|
||||
imx8mp-uboot = pkgs.callPackage ./imx8mp-uboot.nix {};
|
||||
imx8mp-optee-os = pkgs.callPackage ./imx8mp-optee-os.nix {};
|
||||
imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix { };
|
||||
imx8mp-uboot = pkgs.callPackage ./imx8mp-uboot.nix { };
|
||||
imx8mp-optee-os = pkgs.callPackage ./imx8mp-optee-os.nix { };
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/nxp-imx/imx-mkimage.git";
|
||||
rev = "c4365450fb115d87f245df2864fee1604d97c06a";
|
||||
sha256 = "sha256-KVIVHwBpAwd1RKy3RrYxGIniE45CDlN5RQTXsMg1Jwk=";
|
||||
};
|
||||
shortRev = builtins.substring 0 8 src.rev;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imx8m-boot = pkgs.stdenv.mkDerivation rec {
|
||||
inherit src;
|
||||
name = "imx8mp-mkimage";
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
{pkgs, ...}:
|
||||
{ pkgs, ... }:
|
||||
with pkgs;
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx8mp-firmware";
|
||||
version = "8.22";
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx8mp-firmware";
|
||||
version = "8.22";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin";
|
||||
sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A=";
|
||||
};
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin";
|
||||
sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
dontStrip = true;
|
||||
dontUnpack = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
${pkgs.bash}/bin/bash $src --auto-accept --force
|
||||
mv firmware-imx-${version} $out
|
||||
'';
|
||||
}
|
||||
installPhase = ''
|
||||
${pkgs.bash}/bin/bash $src --auto-accept --force
|
||||
mv firmware-imx-${version} $out
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,66 +1,67 @@
|
|||
{pkgs}: let
|
||||
{ pkgs }:
|
||||
let
|
||||
python3 = pkgs.buildPackages.python3;
|
||||
toolchain = pkgs.gcc9Stdenv.cc;
|
||||
binutils = pkgs.gcc9Stdenv.cc.bintools.bintools_bin;
|
||||
cpp = pkgs.gcc;
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "imx8mp-optee-os";
|
||||
version = "lf-6.1.55-2.2.0";
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "imx8mp-optee-os";
|
||||
version = "lf-6.1.55-2.2.0";
|
||||
|
||||
nativeBuildInputs = [
|
||||
python3
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
python3
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
pycryptodomex
|
||||
pyelftools
|
||||
cryptography
|
||||
];
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
pycryptodomex
|
||||
pyelftools
|
||||
cryptography
|
||||
];
|
||||
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
|
||||
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
|
||||
};
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/nxp-imx/imx-optee-os.git";
|
||||
rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee";
|
||||
sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace scripts/arm32_sysreg.py \
|
||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
||||
substituteInPlace scripts/gen_tee_bin.py \
|
||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
||||
substituteInPlace scripts/pem_to_pub_c.py \
|
||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
||||
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
||||
--replace '/bin/bash' '${pkgs.bash}/bin/bash'
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
|
||||
'';
|
||||
postPatch = ''
|
||||
substituteInPlace scripts/arm32_sysreg.py \
|
||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
||||
substituteInPlace scripts/gen_tee_bin.py \
|
||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
||||
substituteInPlace scripts/pem_to_pub_c.py \
|
||||
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
||||
substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \
|
||||
--replace '/bin/bash' '${pkgs.bash}/bin/bash'
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar
|
||||
substituteInPlace mk/gcc.mk \
|
||||
--replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
"PLATFORM=imx"
|
||||
"PLATFORM_FLAVOR=mx8mpevk"
|
||||
"CFG_ARM64_core=y"
|
||||
"CFG_TEE_TA_LOG_LEVEL=0"
|
||||
"CFG_TEE_CORE_LOG_LEVEL=0"
|
||||
"CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}"
|
||||
"CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}"
|
||||
];
|
||||
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
|
||||
'';
|
||||
}
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,90 +1,91 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, bison
|
||||
, dtc
|
||||
, fetchgit
|
||||
, flex
|
||||
, gnutls
|
||||
, libuuid
|
||||
, ncurses
|
||||
, openssl
|
||||
, which
|
||||
, perl
|
||||
, buildPackages
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
bison,
|
||||
dtc,
|
||||
fetchgit,
|
||||
flex,
|
||||
gnutls,
|
||||
libuuid,
|
||||
ncurses,
|
||||
openssl,
|
||||
which,
|
||||
perl,
|
||||
buildPackages,
|
||||
}:
|
||||
let
|
||||
ubsrc = fetchgit {
|
||||
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||
# tag: "lf-6.1.55-2.2.0"
|
||||
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
|
||||
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
|
||||
};
|
||||
url = "https://github.com/nxp-imx/uboot-imx.git";
|
||||
# tag: "lf-6.1.55-2.2.0"
|
||||
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
|
||||
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
|
||||
};
|
||||
in
|
||||
(stdenv.mkDerivation {
|
||||
pname = "imx8mp-uboot";
|
||||
version = "2023.04";
|
||||
src = ubsrc;
|
||||
(stdenv.mkDerivation {
|
||||
pname = "imx8mp-uboot";
|
||||
version = "2023.04";
|
||||
src = ubsrc;
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs tools
|
||||
patchShebangs scripts
|
||||
'';
|
||||
postPatch = ''
|
||||
patchShebangs tools
|
||||
patchShebangs scripts
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
bison
|
||||
flex
|
||||
openssl
|
||||
which
|
||||
ncurses
|
||||
libuuid
|
||||
gnutls
|
||||
openssl
|
||||
perl
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
bison
|
||||
flex
|
||||
openssl
|
||||
which
|
||||
ncurses
|
||||
libuuid
|
||||
gnutls
|
||||
openssl
|
||||
perl
|
||||
];
|
||||
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
hardeningDisable = [ "all" ];
|
||||
enableParallelBuilding = true;
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
hardeningDisable = [ "all" ];
|
||||
enableParallelBuilding = true;
|
||||
|
||||
makeFlags = [
|
||||
"DTC=${lib.getExe buildPackages.dtc}"
|
||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||
];
|
||||
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
|
||||
'';
|
||||
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" ];
|
||||
passAsFile = [ "extraConfig" ];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
make imx8mp_evk_defconfig
|
||||
cat $extraConfigPath >> .config
|
||||
make imx8mp_evk_defconfig
|
||||
cat $extraConfigPath >> .config
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
cp ./u-boot-nodtb.bin $out
|
||||
cp ./spl/u-boot-spl.bin $out
|
||||
cp ./arch/arm/dts/imx8mp-evk.dtb $out
|
||||
cp .config $out
|
||||
mkdir -p $out
|
||||
cp ./u-boot-nodtb.bin $out
|
||||
cp ./spl/u-boot-spl.bin $out
|
||||
cp ./arch/arm/dts/imx8mp-evk.dtb $out
|
||||
cp .config $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
})
|
||||
dontStrip = true;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(import ./overlay.nix)
|
||||
];
|
||||
|
|
@ -8,7 +9,7 @@
|
|||
];
|
||||
|
||||
boot.loader.grub.extraFiles = {
|
||||
"imx8mp-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mp-linux.nix {}}/dtbs/freescale/imx8mp-evk.dtb";
|
||||
"imx8mp-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mp-linux.nix { }}/dtbs/freescale/imx8mp-evk.dtb";
|
||||
};
|
||||
|
||||
hardware.deviceTree = {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,16 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix {});
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix { });
|
||||
initrd.includeDefaultModules = lib.mkForce false;
|
||||
};
|
||||
|
||||
disabledModules = ["profiles/all-hardware.nix"];
|
||||
disabledModules = [ "profiles/all-hardware.nix" ];
|
||||
|
||||
hardware.deviceTree.enable = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
final: prev: {
|
||||
inherit (final.callPackage ./bsp/imx8mp-boot.nix {pkgs = final;}) imx8m-boot;
|
||||
final: _prev: {
|
||||
inherit (final.callPackage ./bsp/imx8mp-boot.nix { pkgs = final; }) imx8m-boot;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue