Files
nixos-hardware/compulab/ucm-imx95/bsp/ucm-imx95-oei-ddr.nix
Govind Singh 11ea8b8477 ucm-imx95: firmware: fetch firmware files from NXP release
Fetch AHAB container, M7 firmware, and DDR PHY firmware binaries
from the NXP release packages. The derivation extracts the correct
LPDDR5 PHY images and selects the appropriate AHAB container for
A0 or B0 silicon revisions.

Signed-off-by: Govind Singh <govind.singh@tii.ae>
2025-10-30 14:29:53 +01:00

65 lines
2.0 KiB
Nix

{
lib,
pkgs,
}:
pkgs.stdenv.mkDerivation rec {
pname = "imx95-imx-oei";
version = "lf-6.6.36-2.1.0";
nativeBuildInputs = [
pkgs.buildPackages.python3
pkgs.gcc-arm-embedded
];
src = pkgs.fetchFromGitHub {
owner = "nxp-imx";
repo = "imx-oei";
rev = "5fca9f47544d03c52ca371eadfffbfd2454e6925";
sha256 = "sha256-Sb6u1NlhJpDCOKBu3HqUb4BLEy0F8LYVnJE0tRSvzWc=";
};
patches = [
(pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
sha256 = "sha256-6ZpBOXw2aIhD2i9Wx368xfHq6NvdZghWHU9u8+gRTj8=";
})
(pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap/recipes-bsp/imx-oei/imx-oei/0002-board-mx95lp5-Fix-default-DDR_CONFIG-timing-name.patch";
sha256 = "sha256-WZ/vYaTC2iKIC+jnHtnPriCxK9gjRsOv2Uy13Ye4698=";
})
(pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap/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 "/bin/echo" "echo"
substituteInPlace Makefile \
--replace "/bin/echo" "echo"
'';
makeFlags = [
"board=mx95lp5"
"CROSS_COMPILE=${pkgs.gcc-arm-embedded}/bin/arm-none-eabi-"
"OEI_CROSS_COMPILE=${pkgs.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 = with maintainers; [ govindsi ];
platforms = [ "aarch64-linux" ];
};
}