-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
uboot: init (firmwareOdroidC2/C4, ubootOdroidC4) Hardkernel's Odroid C4 and Odroid C2 board support, drop Armbian dependency #101454
Conversation
fyi, booting from eMMC on OdroidC2 is failing for me in u-boot v2020.07 and v2020.10. Though works flawlessly in v2020.04. I am triaging it and working on a fix right now. |
this is the commit which breaks eMMC for OdroidC2: looking into... |
This is the line from the patch that breaks eMMC: I will send out patch to respective upstreams. |
FYI, discussion for the possible eMMC fix: https://groups.io/g/u-boot-amlogic/topic/meson_gxbb_regression_since/77816805 |
|
All the initial hacks were fixed and fixes are cherry-picked. Fixes are in staging for 2021.01 release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After changing the u-boot source hash (see inline comment) and erasing petitboot from the SPI flash as described here, this successfully booted on my Odroid HC4 (compatible with Odroid C4).
Thank you!
@lopsided98, could you check this patchset please. I will be happy to see this merged eventually. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I successfully tested this with my ODROID-C2. This looks good except for the two suggestions.
@lopsided98, thanks for the ACK. Could you point me to a document that describes the process of getting this code merged? Or explain it here briefly. I am new to nixos development model, need to close some gaps. |
ssia Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This patch brings Hardkernel Odroid C2 and Odroid C4 firmware. - https://wiki.odroid.com/odroid-c2/software/building_u-boot - https://wiki.odroid.com/odroid-c4/software/building_u-boot Signed-off-by: Anton Arapov <anton@deadbeef.mx>
Odroid C4: Cortex-A55 CPU, Mali-G31 GPU. More data: https://wiki.odroid.com/odroid-c4/ Signed-off-by: Anton Arapov <anton@deadbeef.mx>
Retire dependency on Armbian provided board blobs. Use official hardkernel's ones instead. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
u-boot 2021.01 was released, required patches to run hardkernel's boards are no longer needed as they made the release. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This solves repo pinpointing to particular commit number, thus prevents failing builds when the repos are updated. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
an open alternative to aml_encrypt_g12a and aml_encrypt_g12b. Proprietary tool is not available for aarch64 architecture, which is a show stopper for building u-boot images for the boards like Odroid C4. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This makes aarch64 builds possible. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
as per review request Signed-off-by: Anton Arapov <anton@deadbeef.mx>
postPatch should be used because prePatch breaks patches put in patches. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
…] instead https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
@samueldr , yeah I will give your branch a test and soaking time. thanks! |
I force-pushed the minor fixes to the branch. For transparency, one of the builder functions didn't install the README.md file, and I ended up not deleting the python and sh helpers from the firmware files, as they do things not done with the other tools. I also opened #119371 which will build on top of those changes. I am inclined to think the changes are correct and desirable in Nixpkgs. I would simply append those commits on this PR, without squashing anything currently observable. The whole trail is AFAIK buildable. At least for my changes. It clearly shows how it went from the original builds to the final builds. Any other U-Boot maintainers (e.g. @lopsided98) have opinions here? Note that it is my understanding that we probably won't really be able to replace those early init blob ever. Though BL31 may, at some point, we'll see. |
@samueldr, ssd in my laptop has died. waiting for a replacement, till then I'm not able to build/test the u-boot images. |
I am able to boot my Odroid HC4 with this PR, it works perfectly! My Odroid HC4 is now running NixOS 21.05 using https://github.com/NixOS/nixpkgs/blob/nixos-21.05/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-installer.nix and I removed Petitboot (instructions on https://www.armbian.com/odroid-hc4/). |
Can confirm that this works on the HC4. For anyone trying to reproduce this:
Once you've confirmed that NixOS boots successfully and you won't need Ubuntu anymore, you can also erase petitboot, which remove the need for pressing the button, see https://nixos.wiki/wiki/NixOS_on_ARM/ODROID-HC4#Petitboot_removal. Unfortunately with that image I don't get any output on HDMI or UART, but I was able to use the Hardkernel Ubuntu image to rebuild the image with a password for nixos set, which allowed SSH login: check out 8a2ec31, modify Currently trying to see if the Hardkernel kernel will make HDMI and/or UART work. Basing my kernel package off of https://github.com/considerate/nixos-odroidhc4/tree/983c146bc7d1d05594e04f99e808b0a661ed80bd/overlays/kernel for that. That should also hopefully make SATA work (didn't test it with a drive, but at least dmesg and lspci do not show anything with mainline kernel; https://nixos.wiki/wiki/NixOS_on_ARM/ODROID-HC4 also notes that SATA is not working). |
In my case I was able to get HDMI working with a standard 1080p screen, following your method. SATA is not working on my side (lspci output is empty). |
SATA works for me if I update to a more recent version of uboot and use the https://github.com/u-boot/u-boot/blob/v2022.04/configs/odroid-hc4_defconfig |
Another report: this works great on my HC4. Thanks to everyone who worked on this. I built u-boot with the instructions here, which refer to samueldr's repo, but it looks like it's the same code rebased. Using nixos 22.05 with stock kernel, currently 5.15.49. SATA works. I have not verified HDMI or UART. |
I have verified that both HDMI and UART works. I'm using the configuration here https://github.com/considerate/nixos-odroidhc4/tree/0c1716bf1d8c7f99ba6ad0334e81240afdc27cbf which is based on this PR. |
There's some overlap with #245100 that has no merge conflicts currently. So maybe we can get that in and update this one. |
I was under impression that this patch is "no-go" because of the https://github.com/Tow-Boot/Tow-Boot project. @samueldr ? In case it is not true - I can update this PR. |
I don't think Tow-Boot should have any impact on U-Boot packaging in nixpkgs. Was this discussed somewhere? Binary blobs are never nice, but we already support the ODROID-C2, and the C4 is basically the same. This PR also gets rid of some of the existing C2 blobs. My only suggestion after reading through this PR again is that perhaps the package attributes should be |
Motivation for this change
This enables Odroid C4 board in NixOS with Linux kernel version 5.8+.
Also retires dependency on 3rd-party repository from Armbian.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"