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

linux-rock64: kernel for Rock64 and RockPro64 systems #86007

Closed
wants to merge 1 commit into from

Conversation

prusnak
Copy link
Member

@prusnak prusnak commented Apr 25, 2020

Motivation for this change

This PR adds kernel for Rock64 and RockPro64 systems.

I tried to use 5.4.y and 5.6.y both vanilla and from @lopsided98 repo, but they end up with PCIe issues on my RockPro64:

[    2.172391] rockchip-pcie f8000000.pcie: PCIe link training gen1 timeout!
[    2.173158] rockchip-pcie: probe of f8000000.pcie failed with error -110

Kernel 4.19.y does not have this issue.

I'd like to provide sd-image-rock64.nix in a further PR to allow easy build of SD images for these systems.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@timokau
Copy link
Member

timokau commented Apr 25, 2020

@samueldr is likely to have an opinion on this.

@Mic92
Copy link
Member

Mic92 commented Apr 25, 2020

I can also test this as I have the hardware.

@lopsided98
Copy link
Contributor

@prusnak I tried to respond to you on IRC, but you weren't online

I don't know what the PCIe issue is, other than that it is known to be finicky.

I'm not really sure I want my kernel to be included in an official capacity in nixpkgs, since I sometimes don't update it for months at a time. I particularly don't want the 4.19 branch to be included since I haven't updated it for a long time and I no longer use it.

I think this may be more appropriate for the nixos-hardware repository.

@prusnak
Copy link
Member Author

prusnak commented Apr 25, 2020

@lopsided98 Fair enough - we can try to use the kernel directly from the ayufan-rock64/linux-kernel repo (that's what armbian is using and I saw no problems with PCIe there either). I had trouble compiling it against the current nixpkgs master, though.

@lopsided98
Copy link
Contributor

I believe you have to pass autoModules = false to buildLinux to get the downstream 4.4 kernel to compile.

You might also want to try https://github.com/ayufan-rock64/linux-mainline-kernel (which my repo is based on) in the off chance that I left out one of the patches that makes PCIe work.

@lopsided98
Copy link
Contributor

If I can find an unused PCIe device lying around, I'll try to reproduce the problem as well.

@prusnak
Copy link
Member Author

prusnak commented Apr 25, 2020

I just tried 5.6.0-1137-ayufan tag from ayufan-rock64/linux-mainline-kernel repo and it shows the same error. So you have not missed any of the patches there. :-)

@prusnak
Copy link
Member Author

prusnak commented Apr 25, 2020

I reworked the PR to not include kernel 4.19.y from lopsided98, but rather to use the latest tagged release in ayufan-rock64/linux-kernel repo - that is 4.4.202-1237-rockchip-ayufan.

Tested on my RockPro64 and even the PCIe works fine.

@kolbycrouch
Copy link

I have a 5.5 kernel on my github that works. I can also upload my nixpkgs tree for that board that includes an expression to build an Image.

it's hard for me to keep the kernel up to date with what's in master though, and it includes an overclock to 2.2/1.7 which may require fan cooling.

Although it's a fairly popular board, I think we can get into a mess if we start officially supporting lots of forked kernels of various versions for every come-and-go SBC out there.

@prusnak
Copy link
Member Author

prusnak commented Apr 26, 2020

I have a 5.5 kernel on my github that works.

Does it work with PCIe as well?

Although it's a fairly popular board ..

I think this could be moved to the nixos-hardware repository like it was suggested earlier. IMO it makes more sense and following the same logic I'd suggest moving also Raspberry Pi stuff to the same repo. There is just too much rpi-specific stuff (kernel etc.) in the nixpkgs repo.

@kolbycrouch
Copy link

@prusnak Yes I've been running root from a pcie nvme drive for months ( kernel/initrd on SD card ).

Using Panfrost on mesa-git, I'm running pantheon DE with no problems as well.

There may be a minor version patch in my nixpkgs that isn't applied to my kernel fork, but I've been running 5.5.7 specifically for some time now. Major version patches don't apply cleanly and need a bit of manual intervention.

The nixos-hardware repo does seems like it might be a fitting place for it.

@prusnak
Copy link
Member Author

prusnak commented Apr 26, 2020

Will close this PR and create another one to the nixos-hardware repo.

@prusnak prusnak closed this Apr 26, 2020
@prusnak prusnak deleted the linux-rock64 branch April 26, 2020 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants