Skip to content

Commit a2bc098

Browse files
committed
ucm-imx95: various changes
- Move openssl to nativeBuildInputs in ATF build for proper cross-compilation - Add explicit SILICON validation with clear error messages in firmware build - Fix fragile wildcard patterns in firmware DDR file copying - Replace mutable branch URLs with pinned commit hashes for patch stability - Add U-Boot config merge step (make olddefconfig) after extra config - Fix cross-compilation toolchain coherence (cpp in optee-os) - Standardize license format (single value instead of single-element list) - Update maintainer references with inline name/email format - Fix typos and grammar in documentation and comments
1 parent 86d9291 commit a2bc098

File tree

10 files changed

+82
-33
lines changed

10 files changed

+82
-33
lines changed

compulab/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ Boot ROM initializes the SoC and loads OEI, which runs in TCM to perform early s
2424
```
2525

2626
### Notes
27-
- The configuration includes device-tree, kernel, and bootloader components are optimized for the UCM-iMX95 SoM and evk.
27+
- The configuration, including device-tree, kernel, and bootloader components, is optimized for the UCM-iMX95 SoM and EVK.
2828
- The generated NixOS image supports booting from SD card or eMMC, depending on the hardware configuration.
2929
- The boot components (OEI in TCM/DDR, SM, ATF, U-Boot) follow the standard NXP release layout for i.MX95 platforms.

compulab/ucm-imx95/bsp/ucm-imx95-atf.nix

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ stdenv.mkDerivation rec {
2525

2626
# Compiler dependencies
2727
depsBuildBuild = [ buildPackages.stdenv.cc ];
28-
nativeBuildInputs = [ pkgsCross.aarch64-embedded.stdenv.cc ];
29-
30-
buildInputs = [ openssl ];
28+
nativeBuildInputs = [
29+
pkgsCross.aarch64-embedded.stdenv.cc
30+
openssl
31+
];
3132

3233
makeFlags = [
3334
"HOSTCC=$(CC_FOR_BUILD)"
@@ -51,8 +52,13 @@ stdenv.mkDerivation rec {
5152
meta = with lib; {
5253
homepage = "https://github.com/nxp-imx/imx-atf";
5354
description = "Reference implementation of secure world software for ARMv8-A";
54-
license = [ licenses.bsd3 ];
55-
maintainers = with maintainers; [ govindsi ];
55+
license = licenses.bsd3;
56+
maintainers = [
57+
{
58+
name = "Govind Singh";
59+
email = "[email protected]";
60+
}
61+
];
5662
platforms = [ "aarch64-linux" ];
5763
};
5864
}

compulab/ucm-imx95/bsp/ucm-imx95-boot.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ in
2424
imx95-boot = pkgs.stdenv.mkDerivation rec {
2525
inherit src;
2626
name = "imx95-mkimage";
27-
version = "lf-6.6.36";
27+
version = "lf-6.6.52-2.2.1";
2828

2929
postPatch = ''
3030
substituteInPlace Makefile \
@@ -47,7 +47,6 @@ in
4747
];
4848

4949
buildInputs = [
50-
git
5150
glibc.static
5251
zlib
5352
zlib.static

compulab/ucm-imx95/bsp/ucm-imx95-firmware.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ stdenv.mkDerivation rec {
4646
./firmware-imx-8.28-994fa14.bin --auto-accept
4747
4848
mkdir -p $out/ddr
49-
cp firmware-imx-8.28-994fa14/firmware/ddr/synopsys/lpddr5*v202409.bin $out/ddr/
49+
# Resolve wildcard and verify at least one file matches
50+
lpddr5_files=(firmware-imx-8.28-994fa14/firmware/ddr/synopsys/lpddr5*v202409.bin)
51+
if [ ''${#lpddr5_files[@]} -eq 0 ]; then
52+
echo "ERROR: No lpddr5*v202409.bin file found in firmware/ddr/synopsys/" >&2
53+
exit 1
54+
fi
55+
cp "''${lpddr5_files[@]}" $out/ddr/
5056
5157
# AHAB container
5258
cp ${ahabFirmware} ./firmware-ele-imx-2.0.2-89161a8.bin
@@ -56,8 +62,11 @@ stdenv.mkDerivation rec {
5662
mkdir -p $out/ahab
5763
if [ "$SILICON" = "A0" ]; then
5864
cp firmware-ele-imx-2.0.2-89161a8/mx95a0-ahab-container.img $out/ahab/
59-
else
65+
elif [ "$SILICON" = "B0" ]; then
6066
cp firmware-ele-imx-2.0.2-89161a8/mx95b0-ahab-container.img $out/ahab/
67+
else
68+
echo "ERROR: Invalid SILICON value '$SILICON'. Must be 'A0' or 'B0'." >&2
69+
exit 1
6170
fi
6271
'';
6372
}

compulab/ucm-imx95/bsp/ucm-imx95-linux.nix

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildLinux (
1212
defconfig = "compulab-mx95_defconfig";
1313

1414
# https://github.com/NixOS/nixpkgs/pull/366004
15-
# introduced a breaking change that if a module is declared but it is not being used it will faill.
15+
# introduced a breaking change that if a module is declared but it is not being used it will fail.
1616
ignoreConfigErrors = true;
1717

1818
kernelPatches = [
@@ -53,8 +53,13 @@ buildLinux (
5353
};
5454
meta = with lib; {
5555
homepage = "https://github.com/compulab-yokneam/linux-compulab";
56-
license = [ licenses.gpl2Only ];
57-
maintainers = with maintainers; [ govindsi ];
56+
license = licenses.gpl2Only;
57+
maintainers = [
58+
{
59+
name = "Govind Singh";
60+
email = "[email protected]";
61+
}
62+
];
5863
platforms = [ "aarch64-linux" ];
5964
};
6065
}

compulab/ucm-imx95/bsp/ucm-imx95-oei-ddr.nix

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
lib,
33
pkgs,
44
}:
5+
let
6+
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
7+
in
58
pkgs.stdenv.mkDerivation rec {
69
pname = "imx95-imx-oei";
710
version = "lf-6.6.36-2.1.0";
@@ -20,15 +23,15 @@ pkgs.stdenv.mkDerivation rec {
2023

2124
patches = [
2225
(pkgs.fetchpatch {
23-
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
26+
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
2427
sha256 = "sha256-6ZpBOXw2aIhD2i9Wx368xfHq6NvdZghWHU9u8+gRTj8=";
2528
})
2629
(pkgs.fetchpatch {
27-
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";
30+
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";
2831
sha256 = "sha256-WZ/vYaTC2iKIC+jnHtnPriCxK9gjRsOv2Uy13Ye4698=";
2932
})
3033
(pkgs.fetchpatch {
31-
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";
34+
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";
3235
sha256 = "sha256-yyierv2USZlM8Cuxf4FDj4+UtILvJQH9BJSj+fmayL8=";
3336
})
3437
];
@@ -57,8 +60,13 @@ pkgs.stdenv.mkDerivation rec {
5760
meta = with lib; {
5861
homepage = "https://github.com/nxp-imx/imx-oei";
5962
description = "Optional Executable Image assembler for i.MX95 processors";
60-
license = [ licenses.bsd3 ];
61-
maintainers = with maintainers; [ govindsi ];
63+
license = licenses.bsd3;
64+
maintainers = [
65+
{
66+
name = "Govind Singh";
67+
email = "[email protected]";
68+
}
69+
];
6270
platforms = [ "aarch64-linux" ];
6371
};
6472
}

compulab/ucm-imx95/bsp/ucm-imx95-oei-tcm.nix

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
lib,
33
pkgs,
44
}:
5+
let
6+
metaBspImx95Rev = "5f4c7b5db846fa3a75055054e32215089d15a7b7"; # scarthgap
7+
in
58
pkgs.stdenv.mkDerivation rec {
69
pname = "imx95-imx-oei-tcm";
710
version = "lf-6.6.36-2.1.0";
@@ -20,15 +23,15 @@ pkgs.stdenv.mkDerivation rec {
2023

2124
patches = [
2225
(pkgs.fetchpatch {
23-
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
26+
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-oei/imx-oei/0001-Add-CompuLab-lpddr5_timing.c.patch";
2427
sha256 = "sha256-6ZpBOXw2aIhD2i9Wx368xfHq6NvdZghWHU9u8+gRTj8=";
2528
})
2629
(pkgs.fetchpatch {
27-
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";
30+
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";
2831
sha256 = "sha256-WZ/vYaTC2iKIC+jnHtnPriCxK9gjRsOv2Uy13Ye4698=";
2932
})
3033
(pkgs.fetchpatch {
31-
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";
34+
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";
3235
sha256 = "sha256-yyierv2USZlM8Cuxf4FDj4+UtILvJQH9BJSj+fmayL8=";
3336
})
3437
];
@@ -57,8 +60,13 @@ pkgs.stdenv.mkDerivation rec {
5760
meta = with lib; {
5861
homepage = "https://github.com/nxp-imx/imx-oei";
5962
description = "Optional Executable Image assembler for i.MX95 processors";
60-
license = [ licenses.bsd3 ];
61-
maintainers = with maintainers; [ govindsi ];
63+
license = licenses.bsd3;
64+
maintainers = [
65+
{
66+
name = "Govind Singh";
67+
email = "[email protected]";
68+
}
69+
];
6270
platforms = [ "aarch64-linux" ];
6371
};
6472
}

compulab/ucm-imx95/bsp/ucm-imx95-optee-os.nix

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let
66
inherit (pkgs.buildPackages) python3;
77
toolchain = pkgs.gccStdenv.cc;
88
binutils = pkgs.gccStdenv.cc.bintools.bintools_bin;
9-
cpp = pkgs.gcc;
9+
cpp = pkgs.gccStdenv.cc;
1010
in
1111
pkgs.stdenv.mkDerivation rec {
1212
pname = "imx95-optee-os";
@@ -32,8 +32,13 @@ pkgs.stdenv.mkDerivation rec {
3232
};
3333
meta = with lib; {
3434
homepage = "https://github.com/nxp-imx/imx-optee-os";
35-
license = [ licenses.bsd2 ];
36-
maintainers = with maintainers; [ govindsi ];
35+
license = licenses.bsd2;
36+
maintainers = [
37+
{
38+
name = "Govind Singh";
39+
email = "[email protected]";
40+
}
41+
];
3742
platforms = [ "aarch64-linux" ];
3843
};
3944

compulab/ucm-imx95/bsp/ucm-imx95-sm-fw.nix

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
lib,
33
pkgs,
44
}:
5+
let
6+
metaBspImx95Rev = "224eed17cddc573061150e9d2ce6f9acb39ea50e"; # scarthgap-6.6.36-EVAL-UCM-iMX95-1.0
7+
in
58
pkgs.stdenv.mkDerivation rec {
69
pname = "imx95-sm-fw";
710
version = "lf-6.6.36-2.1.0";
@@ -26,23 +29,23 @@ pkgs.stdenv.mkDerivation rec {
2629

2730
patches = [
2831
(pkgs.fetchpatch {
29-
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap-6.6.36-EVAL-UCM-iMX95-1.0/recipes-bsp/imx-system-manager/imx-system-manager/0001-Add-mcimx95cust-board.patch";
32+
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/${metaBspImx95Rev}/recipes-bsp/imx-system-manager/imx-system-manager/0001-Add-mcimx95cust-board.patch";
3033
sha256 = "sha256-zvZ4bNew+yRPmaZQMrAH087KpCLRqz6zdElfe72Dtuc=";
3134
})
3235
(pkgs.fetchpatch {
33-
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap-6.6.36-EVAL-UCM-iMX95-1.0/recipes-bsp/imx-system-manager/imx-system-manager/0002-Fix-null-pionter-except.patch";
36+
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";
3437
sha256 = "sha256-q72VEvJqm2CmOxdWMqGibgXS5lY08mC4srEcy00QdrE=";
3538
})
3639
(pkgs.fetchpatch {
37-
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap-6.6.36-EVAL-UCM-iMX95-1.0/recipes-bsp/imx-system-manager/imx-system-manager/0001-update-for-yocto-6.6.36-compatibility.patch";
40+
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";
3841
sha256 = "sha256-JzHqDiD/ZOu6VQQI0JxY17RQ3bA2t1aP3O1sjLPguWs=";
3942
})
4043
(pkgs.fetchpatch {
41-
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap-6.6.36-EVAL-UCM-iMX95-1.0/recipes-bsp/imx-system-manager/imx-system-manager/0003-sm-Disable-GPIO1-10-interrupt.patch";
44+
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";
4245
sha256 = "sha256-dhcDv7Uq856+MBonczMPznk+tuqUFxTcHiKLX+myCVA=";
4346
})
4447
(pkgs.fetchpatch {
45-
url = "https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx95/scarthgap-6.6.36-EVAL-UCM-iMX95-1.0/recipes-bsp/imx-system-manager/imx-system-manager/0004-configs-mx95cust-change-LPTPM1-ownership.patch";
48+
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";
4649
sha256 = "sha256-NcLu6+zXpiSz1bHKW14Zuf6F/4pzKsekb+zaRtKjSTY=";
4750
})
4851
];
@@ -73,8 +76,13 @@ pkgs.stdenv.mkDerivation rec {
7376
meta = with lib; {
7477
homepage = "https://github.com/nxp-imx/imx-sm";
7578
description = "System Manager firmware for i.MX processors";
76-
license = [ licenses.bsd3 ];
77-
maintainers = with maintainers; [ govindsi ];
79+
license = licenses.bsd3;
80+
maintainers = [
81+
{
82+
name = "Govind Singh";
83+
email = "[email protected]";
84+
}
85+
];
7886
platforms = [ "aarch64-linux" ];
7987
};
8088
}

compulab/ucm-imx95/bsp/ucm-imx95-uboot.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ stdenv.mkDerivation {
7474
7575
make ucm-imx95_defconfig
7676
cat $extraConfigPath >> .config
77+
make olddefconfig
7778
7879
runHook postConfigure
7980
'';

0 commit comments

Comments
 (0)