-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
ubootNanoPCT4: Init at 2021.01 #109423
ubootNanoPCT4: Init at 2021.01 #109423
Conversation
Converted to draft until @tmountain verifies it works. |
I tried building as instructed, and I ran into the following issue.
New to Nix, so please let me know if I'm doing something wrong. |
Was this done on the device itself? The exact instructions I shared were to cross-compile from an x86_64 system. To do it on the AArch64 system:
|
Got it to build just fine after switching away from the cross-compile version. I installed the image, and it tries to boot, but it gets stuck in a Getty loop (loading the info below repeatedly, see the screenshot). Re-flashing with the pre-built u-boot images that I took from Armbian u-boot resolves the issue, and I can boot the Nix installer successfully. |
Doing some digging is leading me to wonder if this is related to CPU frequency. This issue showed the same symptom (Getty restarting), and the discussion pointed towards CPU frequency. In previous u-boot builds for the NanoPC-T4, I have seen images incorporated with a specific frequency:
Not sure if it is related, but throwing out a suggestion in case it is helpful. I'm available to continue testing if needed. |
I'm not familiar with this specific problem, but I think that frequency refers to the DRAM frequency. That file is the first stage bootloader (TPL) that does DRAM initialization. With the Rock64 (RK3328), the U-Boot TPL doesn't work right and the kernel would usually crash before finishing booting, presumably due to memory corruption. I had to use the Rockchip provided binary blob instead. With the RockPro64 (RK3399), the U-Boot TPL works, but maybe it doesn't for the NanoPC-T4. |
I got a USB-to-TTL serial cable and used it to capture the boot messages via UART. Here's the full boot log for the image resulting from:
https://gist.github.com/tmountain/f3fd939dece80aaeb069c28db7d54e3d And... here's what a successful boot looks like in case that is helpful (using the pre-built u-boot images from Armbian). https://gist.github.com/tmountain/6b35dc5890ee15eae3c7ad15752f11c5 |
After spending a ton of time on this, I can confidently say that the NanoPC-T4 does not work with the upstream u-boot. The only u-boot that I have been able to get to work reliably is the u-boot provided with Armbian (heavily patched), and after a lot of digging, I have extrapolated the appropriate patches and set up my own custom u-boot repo, which consists of the u-boot v2020.10 release with the appropriate Armbian patches applied. My repo and relevant build instructions are available here: https://github.com/tmountain/u-boot-nanopct4 I believe this repo provides a solid basis for a Nix derivation as it applies to u-boot and the NanoPC-T4; however, I'm uncertain what the Nix policy is regarding unofficial repos, etc. That said, you can view the patch itself here. I'd be happy to take a stab at creating a new PR built around this work if it makes sense. If not, well... I'll keep the repo around for folks that want to build their own u-boot images for the nano. Lastly, I tried reporting the NanoPC-T4 issues to the u-boot mailing list, but I did not receive a response. |
Based on all my findings above, I have submitted a new PR here: |
Motivation for this change
For @tmountain, do not merge without their approval of the PR.
Assuming this board doesn't do anything extremely weird, it should work just like every other RK3399 board with mainline u-boot.
To test:
It is unknown to me if the HDMI output during u-boot should or should not be working.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
Tested execution of all binary files (usually inLacking hardware!./result/bin/
)nix path-info -S
before and after)