Add support for UCM-iMX95 Evaluation Kit platform

The CompuLab UCM-iMX95 Evaluation Kit provides a platform for comprehensive
evaluation of the NXP i.MX95 application processor. This change adds support
in NixOS hardware to provide a template for customized i.MX95-based platforms.

UCM-iMX95: https://www.compulab.com/products/som-evaluation-kits/ucm-imx95-evaluation-kit/

Signed-off-by: Govind Singh <govind.singh@tii.ae>
This commit is contained in:
Govind Singh
2025-10-23 09:28:48 +04:00
committed by Jörg Thalheim
parent 43ffe9ac82
commit fe21eda733
13 changed files with 643 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
{
pkgs,
}:
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.fetchgit {
url = "https://github.com/nxp-imx/imx-mkimage.git";
#tag: lf-6.6.36
rev = "4622115cbc037f79039c4522faeced4aabea986b";
sha256 = "sha256-2gz0GxlB3jwy8PC6+cP3+MpyUzqE1vDTw8nuxK6vo3g=";
};
shortRev = builtins.substring 0 8 src.rev;
in
{
imx95-boot = pkgs.stdenv.mkDerivation rec {
inherit src;
name = "imx95-mkimage";
version = "lf-6.6.36";
postPatch = ''
substituteInPlace Makefile \
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
substituteInPlace Makefile \
--replace 'CC = gcc' 'CC = clang'
substituteInPlace iMX95/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
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}/ucm-imx95/lpddr5* ./iMX95/
install -m 0644 ${imx95-firmware}/ucm-imx95/mx95a0-ahab-container.img ./iMX95/
install -m 0644 ${imx95-firmware}/ucm-imx95/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
'';
};
}