Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
fix: rock5a - uboot
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Mar 24, 2024
1 parent 88cf68d commit 095e4ea
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 84 deletions.
4 changes: 2 additions & 2 deletions U-Boot.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ zstdcat result/sd-image/orangepi5plus-sd-image-*.img.zst | sudo dd status=progre
# ==================================
nix build github:ryan4yin/nixos-rk3588/2024032400#sdImage-opi5
# nix build .#sdImage-opi5-cross # fully cross-compiled
stdcat result/sd-image/orangepi5-sd-image-*.img.zst | sudo dd status=progress bs=8M of=/dev/sdX
zstdcat rock5a-*.img.zst | sudo dd status=progress bs=8M of=/dev/sdX
```

For Rock 5A, it requires a little more work to flash the image to the sd card:
Expand All @@ -58,7 +58,7 @@ For Rock 5A, it requires a little more work to flash the image to the sd card:
```shell
nix build .#sdImage-rock5a
zstd -d result/sd-image/rock5a-sd-image-*.img.zst -o rock5a.img
zstd -d rock5a-sd-image-*.img.zst -o rock5a.img

# increase img's file size
dd if=/dev/zero bs=1M count=16 >> rock5a.img
Expand Down
6 changes: 4 additions & 2 deletions modules/sd-image/rock5a.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
inherit (rk3588) nixpkgs;

rootPartitionUUID = "14e19a7b-0ae0-484d-9d54-43bd6fdc20c7";
# rkbin-rk3588 = pkgs.callPackage ../../pkgs/rkbin-rk3588 {};
uboot = pkgs.callPackage ../../pkgs/u-boot-radxa/prebuilt.nix {};
uboot = pkgs.callPackage ../../pkgs/u-boot-radxa/default.nix {
# https://github.com/u-boot/u-boot/blob/v2024.01/configs/rock5a-rk3588s_defconfig
defconfig = "rock5a-rk3588s_defconfig";
};
in {
imports = [
./sd-image-rock5a.nix
Expand Down
20 changes: 0 additions & 20 deletions pkgs/rkbin-rk3588/default.nix

This file was deleted.

44 changes: 0 additions & 44 deletions pkgs/u-boot-radxa/build-from-source.nix

This file was deleted.

Binary file not shown.
Binary file not shown.
16 changes: 0 additions & 16 deletions pkgs/u-boot-radxa/prebuilt.nix

This file was deleted.

30 changes: 30 additions & 0 deletions pkgs/u-boot/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
fetchFromGitHub,
buildUBoot,
defconfig,
...
}: let
rkbin = fetchFromGitHub {
owner = "rockchip-linux";
repo = "rkbin";
rev = "a2a0b89b6c8c612dca5ed9ed8a68db8a07f68bc0";
hash = "sha256-U/jeUsV7bhqMw3BljmO6SI07NCDAd/+sEp3dZnyXeeA=";
};
in
buildUBoot rec {
version = "2024.01";
src = fetchFromGitHub {
owner = "u-boot";
repo = "u-boot";
rev = "v${version}";
hash = "sha256-0Da7Czy9cpQ+D5EICc3/QSZhAdCBsmeMvBgykYhAQFw=";
};
inherit defconfig;
patches = [];
extraMakeFlags = [
"BL31=${rkbin}/bin/rk35/rk3588_bl31_v1.45.elf"
"ROCKCHIP_TPL=${rkbin}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin"
];
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = ["u-boot-rockchip.bin"];
}

0 comments on commit 095e4ea

Please sign in to comment.