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

uboot: Init ubootLibretechAC, using buildUBootMesonGXL #119371

Closed
wants to merge 27 commits into from

Conversation

samueldr
Copy link
Member

This adds a firmware for the "La Frite" SBC from Libre Computer.

Though, I will say: the firmware files from upstream are as supported and as good as these.

This is because the vendor (Libre Computer) uses mainline U-Boot to build their firmware files. Adding support for the La Frite SBC was done mainly as an exercise to provide buildUBootMesonGXL to help other users introduce GXL Amlogic boards.

This builds on top of a WIP branch built on top of #101454. The idea being to exercise the new Amlogic U-Boot build infra with a board I can test with.

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.

Additionally:

  • Booted using pyamlusb
  • Booted from eMMC
  • Booted from SPI

arapov and others added 15 commits April 12, 2021 13:19
ssia

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>
This is somwhat closer to what other U-Boot builds produce.

The end-user will need to flash the first 442 bytes in the MBR, but
that's what "sd_fusing.sh" did... mostly...

This removes the "sd_fusing.sh" script, but it wasn't good anyway, as it
only worked when CWD was the directory it was in, and forced sudo usage.

This was verified to produce the same exact binaries in these
conditions:

Before this change:

```
 $ cd result/
 $ ./sd_fusing.sh .../test.img
```

After this change:

```
dd if=result/bl1.bin.hardkernel of=test.img conv=fsync,notrunc bs=1 count=442
dd if=result/u-boot.img         of=test.img conv=fsync,notrunc bs=512 seek=1
```

So it is assumed this change is 1:1 compatible in the end.

stdenv.mkDerivation {
pname = "amlogic-firmware";
version = "2021-01-29";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version = "2021-01-29";
version = "unstable-2021-01-29";

pkgs/misc/uboot/amlogic-firmware.nix Outdated Show resolved Hide resolved
samueldr added 12 commits April 13, 2021 18:15
This is intended to provide a common source for boot firmware for
U-Boot builds for Amlogic boards.
The intent here is to reduce the sprawl of different mismatched sources
of truth with Amlogic board packaging.

Note that **this produces a different output** compared to before.
Though I cannot test, the output looks right.
 - Make more deterministic with libfaketime
 - Remove reliance on buildPackages (by using nativeBuildInputs)
 - Provide firmware blobs via an attribute

This is the first step into making the build more generic.

This produces *generally* identical builds.

The build differs only in the same way that the previous build differed
using `--check` on its already non-deterministic output.
Otherwise I fear the generic names may be shadowed by something else in
the environment.
The intent here is to reduce the sprawl of different mismatched sources
of truth with Amlogic board packaging.

Note that **this produces a different output** compared to before.
Though I cannot test, the output looks right.
@samueldr samueldr force-pushed the feature/u-boot-aml-s805x-ac branch from 544914b to f02c05e Compare April 13, 2021 22:16
@samueldr samueldr requested a review from lopsided98 April 13, 2021 23:38
Copy link
Contributor

@lopsided98 lopsided98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This boots on my ODROID-C2 and the code looks good to me.

@samueldr
Copy link
Member Author

Nice to hear. Note that most of the PR changes are part of #101454, mainly I was interested in your opinion about the amlogic separation of concern, and looks like it's fine :).

I'll rebase and undraft this PR once #101454 is made compatible with the last three commits of this PR, and merged.

@stale
Copy link

stale bot commented Oct 22, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 22, 2021
@samueldr
Copy link
Member Author

I guess I can refresh this PR at some point by removing the untested parts, and preparing a new PR with them for when someone can test in the future.

So yes, it's stale, but still desirable.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 23, 2021
@stale
Copy link

stale bot commented Apr 25, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 25, 2022
@samueldr
Copy link
Member Author

Closing in favour of Tow-Boot... and the vendor Platform Firmware. I won't get back to this change set.

Time for some lore: this set of changes, making buildUBootMesonGXL and buildUBootMesonG12A was influential in the design of Tow-Boot. Working out the family ressemblances and implementing the least repetitive build instructions as I could.

@samueldr samueldr closed this Dec 23, 2022
@samueldr samueldr deleted the feature/u-boot-aml-s805x-ac branch November 4, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants