2018-03-04 02:18:05 +00:00
|
|
|
{ lib, buildUBoot, fetchFromGitHub, armTrustedFirmwareRK3328 }: let
|
|
|
|
rkbin = fetchFromGitHub {
|
|
|
|
owner = "ayufan-rock64";
|
|
|
|
repo = "rkbin";
|
2019-06-07 03:58:34 +01:00
|
|
|
rev = "f79a708978232a2b6b06c2e4173c5314559e0d3a";
|
|
|
|
sha256 = "0h7xm4ck3p3380c6bqm5ixrkxwcx6z5vysqdwvfa7gcqx5d6x5zz";
|
2018-03-04 02:18:05 +00:00
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
in buildUBoot {
|
2018-12-30 23:44:03 +00:00
|
|
|
version = "2017.09";
|
2018-02-24 01:29:24 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ayufan-rock64";
|
|
|
|
repo = "linux-u-boot";
|
2019-06-07 03:58:34 +01:00
|
|
|
rev = "56bd9582537a70c30387de3ce9038a56d2c77bfe";
|
|
|
|
sha256 = "1m0k8ivzhmg9y4x0k7fz7y71pgblzxy81m6x32iivz5kjnxdnv4i";
|
2018-02-24 01:29:24 +00:00
|
|
|
};
|
|
|
|
|
2019-06-07 03:58:34 +01:00
|
|
|
extraPatches = [ ./rock64-fdt-dtc-compatibility.patch ];
|
2019-04-18 02:19:28 +01:00
|
|
|
|
2018-02-24 02:46:39 +00:00
|
|
|
extraMakeFlags = [ "BL31=${armTrustedFirmwareRK3328}/bl31.elf" "u-boot.itb" "all" ];
|
2018-03-04 02:18:05 +00:00
|
|
|
|
2018-12-30 23:44:03 +00:00
|
|
|
# Close to being blob free, but the U-Boot TPL causes the kernel to hang after a few minutes
|
2018-02-24 01:29:24 +00:00
|
|
|
postBuild = ''
|
2018-12-30 23:44:03 +00:00
|
|
|
./tools/mkimage -n rk3328 -T rksd -d ${rkbin}/rk33/rk3328_ddr_786MHz_v1.13.bin idbloader.img
|
2018-02-24 01:29:24 +00: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 02:18:05 +00:00
|
|
|
extraMeta = with lib; {
|
|
|
|
maintainers = [ maintainers.lopsided98 ];
|
2018-02-24 01:29:24 +00:00
|
|
|
platforms = ["aarch64-linux"];
|
2018-03-04 02:18:05 +00:00
|
|
|
# Because of the TPL blob
|
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
2018-02-24 01:29:24 +00:00
|
|
|
};
|
|
|
|
}
|