Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubootRockPi4: init #103735

Merged
merged 1 commit into from Nov 14, 2020
Merged

ubootRockPi4: init #103735

merged 1 commit into from Nov 14, 2020

Conversation

@andir
Copy link
Member

@andir andir commented Nov 13, 2020

Motivation for this change

This adds support for the Radxa Rock Pi 4 board which is based on
RK3399. The u-boot outputs from the introduced build are suitable to
build a generic image for the Rock Pi 4 by setting the following in a
custom build of $nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix:

  sdImage.postBuildCommands = ''
    dd if=${pkgs.ubootRockPi4}/idbloader.img of=$img seek=64 conv=notrunc
    dd if=${pkgs.ubootROckPi4}/u-boot.itb of=$img seek=16384 conv=notrunc
  '';

cc @samueldr

Things done
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
@andir andir force-pushed the andir:uboot-rockpi4 branch from 756fa1a to 7be1484 Nov 13, 2020
@ofborg ofborg bot requested review from lopsided98, dezgeg and samueldr Nov 13, 2020
BL31 = "${armTrustedFirmwareRK3399}/bl31.elf";
filesToInstall = [ "u-boot.itb" "idbloader.img"];
postBuild = ''
./tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl.bin idbloader.img

This comment has been minimized.

@samueldr

samueldr Nov 14, 2020
Member

Something smells fishy here. The idbloader.img isn't produced by that defconfig like every other rk3399 defconfig?

This comment has been minimized.

@andir

andir Nov 14, 2020
Author Member

I guess this comment can be resolved as the code I had here was just duplicating efforts?

Copy link
Member

@samueldr samueldr left a comment

I cannot verify on hardware, but how does this work for you?

diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix
index 0bb030a86a0..0a178b39800 100644
--- a/pkgs/misc/uboot/default.nix
+++ b/pkgs/misc/uboot/default.nix
@@ -400,9 +400,5 @@ in {
     extraMeta.platforms = ["aarch64-linux"];
     BL31 = "${armTrustedFirmwareRK3399}/bl31.elf";
     filesToInstall = [ "u-boot.itb" "idbloader.img"];
-    postBuild = ''
-      ./tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl.bin idbloader.img
-      cat spl/u-boot-spl.bin >> idbloader.img
-    '';
   };
 }

Using nix-build -A pkgsCross.aarch64-multiplatform.ubootRockPi4

With this applied:

@DUFFMAN ~/tmp/nixpkgs/nixpkgs-103735 $ file result/*
result/idbloader.img: data
result/u-boot.itb:    Device Tree Blob version 17, size=1396, boot CPU=0, string block size=131, DT structure block size=1208

@DUFFMAN ~/tmp/nixpkgs/nixpkgs-103735 $ sha256sum result/*
5603261c91833d53495da0c1267846405d4a30def5c4a8b414ba05db3ff014bf  result/idbloader.img
4c29ebe130b4628e766ab3b93a1abb670e4886d19000f0c719d93e30e8606a74  result/u-boot.itb

And your commit untouched:

@DUFFMAN ~/tmp/nixpkgs/nixpkgs-103735 $ file result/*
result/idbloader.img: data
result/u-boot.itb:    Device Tree Blob version 17, size=1396, boot CPU=0, string block size=131, DT structure block size=1208

@DUFFMAN ~/tmp/nixpkgs/nixpkgs-103735 $ sha256sum result/*
5603261c91833d53495da0c1267846405d4a30def5c4a8b414ba05db3ff014bf  result/idbloader.img
4c29ebe130b4628e766ab3b93a1abb670e4886d19000f0c719d93e30e8606a74  result/u-boot.itb

It looks like you've been re-implemented a small bit of the existing build!

This adds support for the Radxa Rock Pi 4 board which is based on
RK3399. The u-boot outputs from the introduced build are suitable to
build a generic image for the Rock Pi 4 by setting the following in a
custom build of $nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix:

```
  sdImage.postBuildCommands = ''
    dd if=${pkgs.ubootRockPi4}/idbloader.img of=$img seek=64 conv=notrunc
    dd if=${pkgs.ubootROckPi4}/u-boot.itb of=$img seek=16384 conv=notrunc
  '';
```
@andir andir force-pushed the andir:uboot-rockpi4 branch from 7be1484 to 7a5047b Nov 14, 2020
@andir
Copy link
Member Author

@andir andir commented Nov 14, 2020

Ha, thanks! I've removed that custom part.

@ofborg ofborg bot requested a review from samueldr Nov 14, 2020
@samueldr samueldr merged commit b8c1348 into NixOS:master Nov 14, 2020
19 of 20 checks passed
19 of 20 checks passed
tests
Details
action
Details
ubootRockPi4, ubootRockPi4.passthru.tests on x86_64-darwin
Details
ubootRockPi4, ubootRockPi4.passthru.tests on x86_64-linux No attempt
Details
Evaluation Performance Report Evaluator Performance Report
Details
Wait for ofborg
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7a5047b"; rev="7a5047bede8f7851eac2fcc4d257d07cc5f6eda7"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7a5047b"; rev="7a5047bede8f7851eac2fcc4d257d07cc5f6eda7"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7a5047b"; rev="7a5047bede8f7851eac2fcc4d257d07cc5f6eda7"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7a5047b"; rev="7a5047bede8f7851eac2fcc4d257d07cc5f6eda7"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7a5047b"; rev="7a5047bede8f7851eac2fcc4d257d07cc5f6eda7"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7a5047b"; rev="7a5047bede8f7851eac2fcc4d257d07cc5f6eda7"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7a5047b"; rev="7a5047bede8f7851eac2fcc4d257d07cc5f6eda7"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
ubootRockPi4, ubootRockPi4.passthru.tests on aarch64-linux Success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.