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,7 +1,7 @@
|
|||
{
|
||||
buildArmTrustedFirmware ,
|
||||
targetBoard ,
|
||||
fetchgit ,
|
||||
buildArmTrustedFirmware,
|
||||
targetBoard,
|
||||
fetchgit,
|
||||
}:
|
||||
|
||||
{
|
||||
|
|
@ -15,8 +15,11 @@
|
|||
platform = targetBoard;
|
||||
enableParallelBuilding = true;
|
||||
# To build with tee.bin use extraMakeFlags = [ "bl31 SPD=opteed" ];
|
||||
extraMakeFlags = [ "PIE_LDFLAGS=--no-warn-rwx-segments LDFLAGS=--no-warn-rwx-segments" "bl31" ];
|
||||
extraMeta.platforms = ["aarch64-linux"];
|
||||
filesToInstall = ["build/${targetBoard}/release/bl31.bin"];
|
||||
extraMakeFlags = [
|
||||
"PIE_LDFLAGS=--no-warn-rwx-segments LDFLAGS=--no-warn-rwx-segments"
|
||||
"bl31"
|
||||
];
|
||||
extraMeta.platforms = [ "aarch64-linux" ];
|
||||
filesToInstall = [ "build/${targetBoard}/release/bl31.bin" ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
pkgs ,
|
||||
pkgs,
|
||||
targetBoard,
|
||||
}:
|
||||
|
||||
|
|
@ -47,15 +47,21 @@ pkgs.stdenv.mkDerivation rec {
|
|||
${firmwareSeco} --auto-accept --force
|
||||
'';
|
||||
|
||||
filesToInstall = [
|
||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin"
|
||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin"
|
||||
] ++ pkgs.lib.optional ( targetBoard == "imx8qm" )
|
||||
("imx-sc-firmware-${fwScVersion}/mx8qm-mek-scfw-tcm.bin" + " " +
|
||||
"imx-seco-${fwSecoVersion}/firmware/seco/mx8qmb0-ahab-container.img")
|
||||
++ pkgs.lib.optional ( targetBoard == "imx8qxp" )
|
||||
("imx-sc-firmware-${fwScVersion}/mx8qx-mek-scfw-tcm.bin" + " " +
|
||||
"imx-seco-${fwSecoVersion}/firmware/seco/mx8qxc0-ahab-container.img");
|
||||
filesToInstall =
|
||||
[
|
||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin"
|
||||
"firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin"
|
||||
]
|
||||
++ pkgs.lib.optional (targetBoard == "imx8qm") (
|
||||
"imx-sc-firmware-${fwScVersion}/mx8qm-mek-scfw-tcm.bin"
|
||||
+ " "
|
||||
+ "imx-seco-${fwSecoVersion}/firmware/seco/mx8qmb0-ahab-container.img"
|
||||
)
|
||||
++ pkgs.lib.optional (targetBoard == "imx8qxp") (
|
||||
"imx-sc-firmware-${fwScVersion}/mx8qx-mek-scfw-tcm.bin"
|
||||
+ " "
|
||||
+ "imx-seco-${fwSecoVersion}/firmware/seco/mx8qxc0-ahab-container.img"
|
||||
);
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
let
|
||||
|
||||
pkgsCross = import <nixpkgs> {
|
||||
crossSystem = {
|
||||
config = "aarch64-unknown-linux-gnu";
|
||||
};
|
||||
crossSystem = {
|
||||
config = "aarch64-unknown-linux-gnu";
|
||||
};
|
||||
};
|
||||
|
||||
outdir = "out/arm-plat-imx/core";
|
||||
|
|
@ -18,7 +18,7 @@ let
|
|||
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
|
||||
|
||||
pname = "imx-optee-os";
|
||||
version = "5.15.32_2.0.0";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
{ pkgs ,
|
||||
{
|
||||
pkgs,
|
||||
targetBoard,
|
||||
}:
|
||||
|
||||
with pkgs; let
|
||||
with pkgs;
|
||||
let
|
||||
inherit buildUBoot;
|
||||
|
||||
imx8qxp-attrs = {
|
||||
|
|
@ -21,14 +23,25 @@ with pkgs; let
|
|||
patches = [ ../patches/0001-Add-UEFI-boot-for-imx8qm.patch ];
|
||||
};
|
||||
|
||||
imx8-attrs = if (targetBoard == "imx8qxp") then imx8qxp-attrs
|
||||
else if (targetBoard == "imx8qm") then imx8qm-attrs
|
||||
else {};
|
||||
imx8-attrs =
|
||||
if (targetBoard == "imx8qxp") then
|
||||
imx8qxp-attrs
|
||||
else if (targetBoard == "imx8qm") then
|
||||
imx8qm-attrs
|
||||
else
|
||||
{ };
|
||||
|
||||
inherit (callPackage ./imx-atf.nix { inherit buildArmTrustedFirmware; targetBoard = imx8-attrs.atf; }) armTrustedFirmwareiMX8;
|
||||
inherit
|
||||
(callPackage ./imx-atf.nix {
|
||||
inherit buildArmTrustedFirmware;
|
||||
targetBoard = imx8-attrs.atf;
|
||||
})
|
||||
armTrustedFirmwareiMX8
|
||||
;
|
||||
imx-firmware = callPackage ./imx-firmware.nix { inherit pkgs targetBoard; };
|
||||
imx-mkimage = buildPackages.callPackage ./imx-mkimage.nix { inherit pkgs; };
|
||||
in {
|
||||
in
|
||||
{
|
||||
ubootImx8 = buildUBoot {
|
||||
version = "2022.04";
|
||||
src = fetchgit {
|
||||
|
|
@ -41,7 +54,7 @@ in {
|
|||
patches = imx8-attrs.patches;
|
||||
enableParallelBuilding = true;
|
||||
defconfig = "${targetBoard}_mek_defconfig";
|
||||
extraMeta.platforms = ["aarch64-linux"];
|
||||
extraMeta.platforms = [ "aarch64-linux" ];
|
||||
preBuildPhases = [ "copyBinaries" ];
|
||||
|
||||
copyBinaries = ''
|
||||
|
|
@ -54,10 +67,9 @@ in {
|
|||
cat u-boot.bin head.hash > u-boot-hash.bin
|
||||
dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128
|
||||
${imx-mkimage} -soc ${imx8-attrs.soc} -rev B0 -append ahab-container.img -c -scfw ${imx8-attrs.scfw} -ap u-boot-atf.bin a35 0x80000000 -out flash.bin
|
||||
'';
|
||||
'';
|
||||
filesToInstall = [ "flash.bin" ];
|
||||
};
|
||||
|
||||
inherit imx-firmware;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = "imx8mq";
|
||||
in stdenv.mkDerivation rec {
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx8mq-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,25 +2,24 @@
|
|||
pkgs,
|
||||
enable-tee ? false,
|
||||
}:
|
||||
with pkgs; let
|
||||
cp-tee =
|
||||
if enable-tee
|
||||
then "install -m 0644 ${imx8mq-optee-os}/tee.bin ./iMX8M/tee.bin"
|
||||
else "";
|
||||
with pkgs;
|
||||
let
|
||||
cp-tee = if enable-tee then "install -m 0644 ${imx8mq-optee-os}/tee.bin ./iMX8M/tee.bin" else "";
|
||||
|
||||
imx8mq-atf = pkgs.callPackage ./imx8mq-atf.nix {
|
||||
inherit enable-tee;
|
||||
};
|
||||
imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix {};
|
||||
imx8mq-uboot = pkgs.callPackage ./imx8mq-uboot.nix {};
|
||||
imx8mq-optee-os = pkgs.callPackage ./imx8mq-optee-os.nix {};
|
||||
imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix { };
|
||||
imx8mq-uboot = pkgs.callPackage ./imx8mq-uboot.nix { };
|
||||
imx8mq-optee-os = pkgs.callPackage ./imx8mq-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 = "imx8mq-mkimage";
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
{pkgs, ...}:
|
||||
{ pkgs, ... }:
|
||||
with pkgs;
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx8mq-firmware";
|
||||
version = "8.22";
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "imx8mq-firmware";
|
||||
version = "8.22";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin";
|
||||
sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A=";
|
||||
};
|
||||
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,54 +1,56 @@
|
|||
{pkgs, ...} @ args:
|
||||
{ pkgs, ... }@args:
|
||||
with pkgs;
|
||||
buildLinux (args
|
||||
// rec {
|
||||
version = "6.1.55";
|
||||
name = "imx8mq-linux";
|
||||
buildLinux (
|
||||
args
|
||||
// rec {
|
||||
version = "6.1.55";
|
||||
name = "imx8mq-linux";
|
||||
|
||||
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
||||
modDirVersion = version;
|
||||
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
|
||||
modDirVersion = version;
|
||||
|
||||
defconfig = "imx_v8_defconfig";
|
||||
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;
|
||||
# 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 = [
|
||||
];
|
||||
kernelPatches = [
|
||||
];
|
||||
|
||||
autoModules = false;
|
||||
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
|
||||
'';
|
||||
extraConfig = ''
|
||||
CRYPTO_TLS m
|
||||
TLS y
|
||||
MD_RAID0 m
|
||||
MD_RAID1 m
|
||||
MD_RAID10 m
|
||||
MD_RAID456 m
|
||||
DM_VERITY m
|
||||
LOGO y
|
||||
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n
|
||||
FB_EFI n
|
||||
EFI_STUB y
|
||||
EFI y
|
||||
VIRTIO y
|
||||
VIRTIO_PCI y
|
||||
VIRTIO_BLK y
|
||||
DRM_VIRTIO_GPU y
|
||||
EXT4_FS y
|
||||
USBIP_CORE m
|
||||
USBIP_VHCI_HCD m
|
||||
USBIP_HOST m
|
||||
USBIP_VUDC m
|
||||
'';
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nxp-imx";
|
||||
repo = "linux-imx";
|
||||
# tag: lf-6.1.55-2.2.0
|
||||
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
|
||||
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
|
||||
};
|
||||
}
|
||||
// (args.argsOverride or {}))
|
||||
src = fetchFromGitHub {
|
||||
owner = "nxp-imx";
|
||||
repo = "linux-imx";
|
||||
# tag: lf-6.1.55-2.2.0
|
||||
rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e";
|
||||
sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0=";
|
||||
};
|
||||
}
|
||||
// (args.argsOverride or { })
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 = "imx8mq-optee-os";
|
||||
version = "lf-6.1.55-2.2.0";
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "imx8mq-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=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}"
|
||||
];
|
||||
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
|
||||
'';
|
||||
}
|
||||
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 = "imx8mq-uboot";
|
||||
version = "2023.04";
|
||||
src = ubsrc;
|
||||
(stdenv.mkDerivation {
|
||||
pname = "imx8mq-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 imx8mq_evk_defconfig
|
||||
cat $extraConfigPath >> .config
|
||||
make imx8mq_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/imx8mq-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/imx8mq-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 = {
|
||||
"imx8mq-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mq-linux.nix {}}/dtbs/freescale/imx8mq-evk.dtb";
|
||||
"imx8mq-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mq-linux.nix { }}/dtbs/freescale/imx8mq-evk.dtb";
|
||||
};
|
||||
|
||||
hardware.deviceTree = {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,16 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix {});
|
||||
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-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/imx8mq-boot.nix {pkgs = final;}) imx8m-boot;
|
||||
final: _prev: {
|
||||
inherit (final.callPackage ./bsp/imx8mq-boot.nix { pkgs = final; }) imx8m-boot;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@
|
|||
];
|
||||
|
||||
boot.loader.grub.extraFiles = {
|
||||
"imx8qm-mek.dtb" = "${pkgs.callPackage ../common/bsp/linux-imx8.nix { }}/dtbs/freescale/imx8qm-mek.dtb";
|
||||
"imx8qm-mek.dtb" = "${
|
||||
pkgs.callPackage ../common/bsp/linux-imx8.nix { }
|
||||
}/dtbs/freescale/imx8qm-mek.dtb";
|
||||
};
|
||||
|
||||
hardware.deviceTree = {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
final: prev: {
|
||||
inherit ( final.callPackage ../common/bsp/imx-uboot.nix { pkgs = final; targetBoard = "imx8qm"; }) ubootImx8 imx-firmware;
|
||||
final: _prev: {
|
||||
inherit
|
||||
(final.callPackage ../common/bsp/imx-uboot.nix {
|
||||
pkgs = final;
|
||||
targetBoard = "imx8qm";
|
||||
})
|
||||
ubootImx8
|
||||
imx-firmware
|
||||
;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
final: prev: {
|
||||
inherit ( final.callPackage ../common/bsp/imx-uboot.nix { pkgs = final; targetBoard = "imx8qxp"; }) ubootImx8 imx-firmware;
|
||||
final: _prev: {
|
||||
inherit
|
||||
(final.callPackage ../common/bsp/imx-uboot.nix {
|
||||
pkgs = final;
|
||||
targetBoard = "imx8qxp";
|
||||
})
|
||||
ubootImx8
|
||||
imx-firmware
|
||||
;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue