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

radxa/rock-4c-plus: init #1329

Merged
merged 3 commits into from
Feb 6, 2025
Merged

radxa/rock-4c-plus: init #1329

merged 3 commits into from
Feb 6, 2025

Conversation

RadxaYuntian
Copy link
Contributor

@RadxaYuntian RadxaYuntian commented Jan 20, 2025

Description of changes
  • Add currently undocumented rockchip module. Right now only used internally by radxa module.
    Open to be shared with other consumers if there is a need. Documentation can follow afterwards when we see common patterns.
  • Add support for ROCK 4C+
Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

rockchip = {
enable = true;
diskoExtraPostVM = ''
dd conv=notrunc,fsync if=${pkgs.ubootRock4CPlus}/idbloader.img of=$out/${cfg.diskoImageName} bs=512 seek=64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting approach, we can potentially have this also for other rockchip based boards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and this is just a proof-of-concept. Once this PR is accepted I'll add additional devices from us.

@RadxaYuntian
Copy link
Contributor Author

BTW if this and EFI boot chain was accepted, then we will need to worry about updating U-Boot for like RK3588 devices where upstream is moving fast with potential DTB changes. Such updating script can also be used in diskoExtraPostVM to reduce duplication.

The question is where should this script go? Main nixpkgs (since it is quite essential for the U-Boot packages there to be useful) or here?

@RadxaYuntian
Copy link
Contributor Author

Need to rework tests now since we will have a lot more Arm devices coming: https://github.com/NixOS/nixos-hardware/blob/master/tests/flake.nix#L42-L48

I tried to run the test locally but it locked my computer up :/

@RadxaYuntian
Copy link
Contributor Author

Just added rock-4c-plus to aarch64Systems for now. We can figure out how to refactor tests in another PR.

@RadxaYuntian
Copy link
Contributor Author

Move unfree config to disko.nix so it is not loaded by default. This allow test to run.

@RadxaYuntian RadxaYuntian marked this pull request as draft January 22, 2025 09:56
@RadxaYuntian RadxaYuntian marked this pull request as ready for review January 22, 2025 10:10
@RadxaYuntian
Copy link
Contributor Author

@msgilligan you might be interested.

@RadxaYuntian RadxaYuntian force-pushed the rock-4c-plus branch 7 times, most recently from f89e31d to d74ee87 Compare January 23, 2025 03:08
@RadxaYuntian
Copy link
Contributor Author

@kibiz0r reported that the original flake example does not build on system without binfmt enabled, which I assume is due to the U-Boot package (does Hydra not cache unfree package?). I also thought about what's happening next, and realized that I want an option to override the U-Boot package, so I can use packages from my nixpkgs fork while working on them.

So such option is added, and an example of overriding with cross built package is provided in the example flake. It is disabled by default since it requires knowledge of implementation detail to use, so normal users are recommended to configure binfmt instead.

@RadxaYuntian
Copy link
Contributor Author

CI failed because NixOS/nixpkgs#361461 is not merged :/

@Mic92
Copy link
Member

Mic92 commented Feb 6, 2025

@mergify queue

Copy link
Contributor

mergify bot commented Feb 6, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at d1f201f

mergify bot added a commit that referenced this pull request Feb 6, 2025
@mergify mergify bot merged commit d1f201f into NixOS:master Feb 6, 2025
3 checks passed
@RadxaYuntian RadxaYuntian deleted the rock-4c-plus branch February 6, 2025 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants