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_rpi: add support for 64-bit Raspberry Pi 3 #46653
Conversation
cc @dezgeg |
@lopsided98 if I wanted to try this pr on my pi how would I go about doing it? |
@mogorman Add |
Ah, I didn't know they support this configuration. @lopsided98 How about writing the DTB conditionals like this though: dezgeg@f3ac96a? Can you runtime-test that one? At least it builds for me (after rebasing on top of the latest |
@dezgeg Your patch boots correctly for me. |
@lopsided98 thanks that booted for me. I did have a question if you know how to resolve. I am trying to get my clusterhat, clusterhat.com to show up. it uses the pi i2c hat logic to populate /proc/device-tree/hat when using the raspberry pi kernel i thought it would just show up but it did not. I tried enabling i2c as described in some of the guides ive found but no change to my proc tree. do you happen to know how to fix this? information about hat definition https://github.com/raspberrypi/hats |
@mogorman I don't know much about the hat spec, but it looks like the firmware/bootloader downloads a device tree overlay from the hat. By default, NixOS uses U-Boot as a intermediate bootloader between the standard RPi bootloader and the kernel. U-Boot does not pass device tree overlays from the RPi bootloader to the kernel, which is probably why your device is not detected (this also means You can switch to using just the RPi bootloader w/o U-Boot, by adding |
in my config i have
but it still boots up with the generic ext linux loader every time. |
@mogorman Remove this line:
That option enables U-Boot, which also enables |
@lopsided98 thank you for the advice. following that I am getting the raspberry pi firmware on boot but it doesnt seem to boot the linuxPackages_latest kernel or the rpi one when using aarch64. not sure why yet it just hangs on the rainbow screen. |
I just looked at my config and remembered that I had to add:
to |
@mogorman Wait, are you using a Raspberry Pi 3? I assumed you were using a Zero because I didn't realize the clusterhat used a used a full sized Pi as well, but then I looked back at your config and saw that you had In that case, your problem is probably that the RPi bootloader doesn't currently work out of the box with the RPi 3 in 64 bit mode in NixOS. By default it will look for a file named |
Now ARMv6 and ARMv7 builds avoid installing DTBs for boards where the resulting kernel won't run just like the aarch64 builds already do. Also deduplicates the logic a bit.
@lopsided98 thanks will read now |
Changes applied in https://git.io/fAbII. |
Motivation for this change
The Raspberry Pi vendor kernel has a config for a 64-bit Raspberry Pi 3 kernel, but this is currently not supported in NixOS. I need this config to use a driver that is not included in the upstream kernel.
The device trees are different for this config, so this requires a different
postFixup
phase for aarch64.This kernel boots correctly and I have not found any issues with it.
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)