Files
nix-config/packages/arm-trusted-firmware/default.nix
mjallen18 7306b08762 fmt
2026-01-14 18:00:52 -06:00

54 lines
1.1 KiB
Nix

{
stdenv,
fetchFromGitHub,
lib,
MODEL ? "5",
DEBUG ? "0",
TFA_FLAGS ? "",
}:
stdenv.mkDerivation rec {
pname = "arm-trusted-firmware";
version = "2.14";
src = fetchFromGitHub {
owner = "ARM-software";
repo = "arm-trusted-firmware";
tag = "v${version}";
hash = "sha256-7imeQocGMSyGXTEhNs4s0bcDxZpbLSSkOyI7c5UxqVs=";
};
# Add required host tools if needed:
nativeBuildInputs = [
# dtc python3 openssl etc.
];
buildPhase = ''
make \
CROSS_COMPILE=${stdenv.cc.targetPrefix} \
CC=${stdenv.cc.targetPrefix}cc \
AS=${stdenv.cc.targetPrefix}cc \
PLAT=rpi${MODEL} \
PRELOADED_BL33_BASE=0x20000 \
RPI3_PRELOADED_DTB_BASE=0x3E0000 \
SUPPORT_VFP=1 \
SMC_PCI_SUPPORT=1 \
ENABLE_FEAT_VHE=1 \
DEBUG=${DEBUG} \
all \
${TFA_FLAGS}
'';
installPhase = ''
mkdir -p $out
cp -r build/* $out/
'';
meta = with lib; {
description = "ARM Trusted Firmware-A for Raspberry Pi";
license = licenses.bsd3;
platforms = [ "aarch64-linux" ];
maintainers = with maintainers; [ kazenyuk ];
};
}