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: add support for the ODROID-C2 #75069
Conversation
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 don't have the HW to verify. Otherwise looks good to me, except for the small change.
👍 It cross-compiles!
I think it's also appropriate to add yourself to the u-boot maintainers :).
This package currently contains fiptool, cert_create and sptool.
This supports the Amlogic S905, otherwise known as Meson GXBB.
e86e3f8
to
8845809
Compare
I added the license and fixed the conflicts with my Rock64 changes. |
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.
This is great!
Motivation for this change
This adds support for the ODROID-C2 to U-Boot in nixpkgs. It minimizes the use of binary blobs and vendor tools. It has been tested in combination with mainline Linux 5.4.1.
The Amlogic S905 uses 5 bootloader stages. The first (
bl1.bin.hardkernel
) is partially placed in the MBR bootstrap code area and partially in the sector after the MBR. The rest of the stages are stored in a FIP image placed at sector 97.bl30.bin
andbl301.bin
are binary blobs (sources are technically available forbl301.bin
, but building them is more trouble than it's worth). The other two images are ATF and U-Boot, both of which have upstream support for the SoC/board.Hardkernel's U-Boot tree has a custom version of the
fip_create
tool taken from ATF. It was modified to add padding to the BL301 image (to make room for a signature) and place the BL301 image between BL30 and BL31 (ATF) with a custom UUID. BL301 needs to be signed by theaml_encrypt_gxb
tool which is only provided as a binary forx86_64-linux
.Upstream ATF has replaced
fip_create
withfiptool
. It is possible to add images with custom UUIDs usingfiptool
, but they are always added to the end of the file. This is a problem because the bootloader blob responsible for loading the FIP only looks at the order of the images, not their UUIDs.fiptool
can be patched to place the BL301 image at the right position, but it turns out that this is not really necessary. Since the bootloader doesn't care about UUIDs, we can simply put the images in the right order with the wrong UUIDs using an unmodifiedfiptool
. See afaerber/meson-tools#3 for more information.The meson-tools project contains a reverse engineered version of
aml_encrypt_gxb
, which can be used instead.There is an opportunity for bikeshedding here: what should the ATF package be called?
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @samueldr @dezgeg @grahamc