2021-11-16 04:57:23 +00:00
|
|
|
{ stdenv, git, bc, bison, flex, nettools, openssl, buildPackages
|
|
|
|
, uboot-hardkernel, meson64-tools, blx_fix }:
|
2021-10-20 06:22:09 +00:00
|
|
|
let
|
2021-11-16 04:57:23 +00:00
|
|
|
in stdenv.mkDerivation {
|
2021-10-20 06:22:09 +00:00
|
|
|
name = "uboot";
|
|
|
|
src = builtins.fetchTarball {
|
2021-11-16 04:57:23 +00:00
|
|
|
url =
|
|
|
|
"https://github.com/u-boot/u-boot/archive/15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3.tar.gz";
|
2021-10-20 06:22:09 +00:00
|
|
|
sha256 = "1ardkap35pi2dsajag728fnvlvpfmdrsa0igj93wbkbf2ypzzhf6";
|
|
|
|
};
|
|
|
|
CROSS_COMPILE = stdenv.cc.targetPrefix;
|
|
|
|
configurePhase = ''
|
|
|
|
make odroid-c4_defconfig
|
|
|
|
'';
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir fip
|
|
|
|
cp ${uboot-hardkernel}/fip/* fip/
|
|
|
|
cp u-boot.bin fip/bl33.bin
|
|
|
|
${blx_fix} \
|
|
|
|
fip/bl30.bin \
|
|
|
|
fip/zero_tmp \
|
|
|
|
fip/bl30_zero.bin \
|
|
|
|
fip/bl301.bin \
|
|
|
|
fip/bl301_zero.bin \
|
|
|
|
fip/bl30_new.bin \
|
|
|
|
bl30
|
|
|
|
|
|
|
|
${blx_fix} \
|
|
|
|
fip/bl2.bin \
|
|
|
|
fip/zero_tmp \
|
|
|
|
fip/bl2_zero.bin \
|
|
|
|
fip/acs.bin \
|
|
|
|
fip/bl21_zero.bin \
|
|
|
|
fip/bl2_new.bin \
|
|
|
|
bl2
|
|
|
|
|
|
|
|
${meson64-tools}/bin/bl30sig \
|
|
|
|
--input fip/bl30_new.bin \
|
|
|
|
--output fip/bl30_new.bin.g12a.enc \
|
|
|
|
--level v3
|
|
|
|
${meson64-tools}/bin/bl3sig \
|
|
|
|
--input fip/bl30_new.bin.g12a.enc \
|
|
|
|
--output fip/bl30_new.bin.enc \
|
|
|
|
--level v3 --type bl30
|
|
|
|
${meson64-tools}/bin/bl3sig \
|
|
|
|
--input fip/bl31.img \
|
|
|
|
--output fip/bl31.img.enc \
|
|
|
|
--level v3 --type bl31
|
|
|
|
${meson64-tools}/bin/bl3sig \
|
|
|
|
--input fip/bl33.bin --compress lz4 \
|
|
|
|
--output fip/bl33.bin.enc \
|
|
|
|
--level v3 --type bl33 --compress lz4
|
|
|
|
${meson64-tools}/bin/bl2sig \
|
|
|
|
--input fip/bl2_new.bin \
|
|
|
|
--output fip/bl2.n.bin.sig
|
|
|
|
${meson64-tools}/bin/bootmk \
|
|
|
|
--output $out \
|
|
|
|
--bl2 fip/bl2.n.bin.sig \
|
|
|
|
--bl30 fip/bl30_new.bin.enc \
|
|
|
|
--bl31 fip/bl31.img.enc \
|
|
|
|
--bl33 fip/bl33.bin.enc \
|
|
|
|
--ddrfw1 fip/ddr4_1d.fw \
|
|
|
|
--ddrfw2 fip/ddr4_2d.fw \
|
|
|
|
--ddrfw3 fip/ddr3_1d.fw \
|
|
|
|
--ddrfw4 fip/piei.fw \
|
|
|
|
--ddrfw5 fip/lpddr4_1d.fw \
|
|
|
|
--ddrfw6 fip/lpddr4_2d.fw \
|
|
|
|
--ddrfw7 fip/diag_lpddr4.fw \
|
|
|
|
--ddrfw8 fip/aml_ddr.fw \
|
|
|
|
--ddrfw9 fip/lpddr3_1d.fw \
|
|
|
|
--level v3
|
|
|
|
'';
|
2021-11-16 04:57:23 +00:00
|
|
|
nativeBuildInputs = [ git bc bison flex nettools ];
|
2021-10-20 06:22:09 +00:00
|
|
|
|
2021-11-16 04:57:23 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc buildPackages.openssl.dev ];
|
2021-10-20 06:22:09 +00:00
|
|
|
}
|