2018-03-04 03:18:05 +01:00
|
|
|
{ lib, buildUBoot, fetchFromGitHub, armTrustedFirmwareRK3328 }: let
|
|
|
|
rkbin = fetchFromGitHub {
|
|
|
|
owner = "ayufan-rock64";
|
|
|
|
repo = "rkbin";
|
2018-12-31 00:44:03 +01:00
|
|
|
rev = "af17d09dee19b41f4f01e1722eaf6911fb296245";
|
|
|
|
sha256 = "189f7h6wj2yrcc5ga103jnyysykf9j3j9p1vcy7791bxwxqxnggf";
|
2018-03-04 03:18:05 +01:00
|
|
|
};
|
|
|
|
in buildUBoot rec {
|
2018-12-31 00:44:03 +01:00
|
|
|
version = "2017.09";
|
2018-02-24 02:29:24 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ayufan-rock64";
|
|
|
|
repo = "linux-u-boot";
|
2018-12-31 00:44:03 +01:00
|
|
|
rev = "d646df03ace3bd191e24361944ce1c7ef3c8744c";
|
|
|
|
sha256 = "0gclcd034qfhfbabrdqmky08i0hlwmn63n0zg6mndplms5qpcx75";
|
2018-02-24 02:29:24 +01:00
|
|
|
};
|
|
|
|
|
2018-02-24 03:46:39 +01:00
|
|
|
extraMakeFlags = [ "BL31=${armTrustedFirmwareRK3328}/bl31.elf" "u-boot.itb" "all" ];
|
2018-03-04 03:18:05 +01:00
|
|
|
|
2018-12-31 00:44:03 +01:00
|
|
|
# Close to being blob free, but the U-Boot TPL causes the kernel to hang after a few minutes
|
2018-02-24 02:29:24 +01:00
|
|
|
postBuild = ''
|
2018-12-31 00:44:03 +01:00
|
|
|
./tools/mkimage -n rk3328 -T rksd -d ${rkbin}/rk33/rk3328_ddr_786MHz_v1.13.bin idbloader.img
|
2018-02-24 02:29:24 +01:00
|
|
|
cat spl/u-boot-spl.bin >> idbloader.img
|
|
|
|
dd if=u-boot.itb of=idbloader.img seek=448 conv=notrunc
|
|
|
|
'';
|
|
|
|
|
|
|
|
defconfig = "rock64-rk3328_defconfig";
|
|
|
|
filesToInstall = [ "spl/u-boot-spl.bin" "tpl/u-boot-tpl.bin" "u-boot.itb" "idbloader.img"];
|
|
|
|
|
2018-03-04 03:18:05 +01:00
|
|
|
extraMeta = with lib; {
|
|
|
|
maintainers = [ maintainers.lopsided98 ];
|
2018-02-24 02:29:24 +01:00
|
|
|
platforms = ["aarch64-linux"];
|
2018-03-04 03:18:05 +01:00
|
|
|
# Because of the TPL blob
|
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
2018-02-24 02:29:24 +01:00
|
|
|
};
|
|
|
|
}
|