blob: fdaf109ebffeef7a6c7fecb99aaae5711dc819c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
{ stdenv, fetchFromGitHub, buildPackages }:
let
buildArmTrustedFirmware = { targetPlatforms
, filesToInstall
, installDir ? "$out"
, platform
, extraMakeFlags ? []
, extraMeta ? {}
, ... } @ args:
stdenv.mkDerivation (rec {
name = "arm-trusted-firmware-${platform}-${version}";
version = "1.4";
src = fetchFromGitHub {
owner = "ARM-software";
repo = "arm-trusted-firmware";
rev = "b762fc7481c66b64eb98b6ff694d569e66253973";
sha256 = "15m10dfgqkgw6rmzgfg1xzp1si9d5jwzyrcb7cp3y9ckj6mvp3i3";
};
depsBuildBuild = [ buildPackages.stdenv.cc ];
makeFlags = [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
"PLAT=${platform}"
] ++ extraMakeFlags;
installPhase = ''
runHook preInstall
mkdir -p ${installDir}
cp ${stdenv.lib.concatStringsSep " " filesToInstall} ${installDir}
runHook postInstall
'';
hardeningDisable = [ "all" ];
dontStrip = true;
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = https://github.com/ARM-software/arm-trusted-firmware;
description = "A reference implementation of secure world software for ARMv8-A";
license = licenses.bsd3;
maintainers = [ maintainers.lopsided98 ];
# TODO: Fix when #34444 is merged
# platforms = targetPlatforms;
} // extraMeta;
} // builtins.removeAttrs args [ "extraMeta" ]);
in rec {
inherit buildArmTrustedFirmware;
armTrustedFirmwareRK3328 = buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "rk3328";
targetPlatforms = ["aarch64-linux"];
filesToInstall = [ "build/${platform}/release/bl31/bl31.elf"];
};
}
|