Skip to content

Drop forest of patches, and use the new unified tree#238

Merged
samueldr merged 35 commits intoTow-Boot:developmentfrom
samueldr:feature/drop-patches-use-repo
Jul 15, 2023
Merged

Drop forest of patches, and use the new unified tree#238
samueldr merged 35 commits intoTow-Boot:developmentfrom
samueldr:feature/drop-patches-use-repo

Conversation

@samueldr
Copy link
Contributor

@samueldr samueldr commented Jun 26, 2023

This change set aims to make it easier to work and collaborate on the patches.

This makes use of the (Tow-Boot/U-Boot)[https://github.com/Tow-Boot/U-Boot] repo, where topic branches are created for releases.

A final strategy hasn't been decided for dealing with the actual branches, but the gist of it is once "ready", a "final" unified branch is pushed, which is an octopus merge of the whole set of changes. This merge is made using a tool, and should also be used when validating work before publishing things for U-Boot changes. Note that this is still a WIP and likely will change, TBD with other collaborators.

Though what is final is that we will be using a single source to represent the whole change set*.

One benefit that has already been shown, where some way too hacky changes were in use, and it instead was preferable to work things out in a better manner with discrete U-Boot config options. In other words, it keeps us more honest and in better working order, without giving us as much opportunities to lapse into bad hacks.

The code, short of some minor cleanups, mainly centered around surrounding hacks with CONFIG_TOW_BOOT* options, the code is basically identical. I have verified that by taking a snapshot (new git repo) of the source tarball produced by the current development tip, then this PR, for the same board (pine64-pinebookA64), and looking at the diff. This is "hard" to judge properly because now all the patches are included all the time, but the changes, other than new boards and new features (unused) are minor and trivial.

What was done

  • Build a full release (all boards)
  • Fixup the build so building stock U-Boot with the tooling works
  • Actually run on a representative subset of hardware
    • Tested on pine64-pinebookA64 (representative of Allwinner)
    • Fix PBP panel reset quirk patch I that broke
      • Re-work RK3399 wip patches out of Pinephone branch
    • Re-test on PBP (SPI flash already tested successful, works for everything except panel on reboot)

What needs to be done

  • Actually run on a representative subset of hardware
    • Amlogic
    • Raspberry Pi
    • Pinephone Pro (testing both revised RK3399 changes, and the Phone UX)

Out of scope of this PR

  • Figuring out the collaboration strategy. Whichever it is, it will desugar down into a fetchFromGitHub to a repo, shared between all boards.

* This is almost true, we still do some patching down the line for some things, since it needs to happen for a U-Boot build made using our tooling too. Namely, adjusting SPL offset for SPI builds, and serial speed on rockchip. This should be assumed work to somehow prepare in a somewhat upstreamable fashion.

Comment on lines +123 to +125
TOW_BOOT_PREDICTABLE_BOOT_PREFER_EXTERNAL = yes;
TOW_BOOT_PREDICTABLE_BOOT_PREFER_INTERNAL = no;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this is a choice, just the PREFER_EXTERNAL = yes; should be enough, but having a no for the other ensures there's nothing wrong going on with the implementation. It's redundant, but gives assurance both won't be true at once.

CMD_CLS = yes;
CMD_SETEXPR = yes;
CMD_PAUSE = yes;
CMD_PAUSE = lib.mkIf (!config.Tow-Boot.buildUBoot) yes;
Copy link
Contributor Author

@samueldr samueldr Jun 26, 2023

Choose a reason for hiding this comment

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

CMD_PAUSE has been mainlined, so it will be possible to enable this outright when upgrading U-Boot.

@samueldr samueldr force-pushed the feature/drop-patches-use-repo branch from 67a9019 to 668ee76 Compare June 26, 2023 02:19
@samueldr
Copy link
Contributor Author

samueldr commented Jun 28, 2023

For anyone playing at home:

This shows a correctness issue when syncing DTs with linux and that workaround. From a quick grep, no other gpio_lookup_name exist for rk3399. So we're safe keeping the sync in.

The solution is to change the workaround implementation.

This turns a regulator off and on again. This is not elegant. This also shows garbage in the display for a short while.

What we can do, instead, is force the regulator off during SPL. Since it's always-on, it will be turned on at boot. Note that it will be turned on just like from a cold start. So we can prod it the same way LEDs are prodded in SPL.


A better(?) solution might be to have a "for U-Boot" tag on the regulator telling it that actually while it is always-on, SPL should turn it off, as a warm reset keeps the thing in a bad state. Or maybe it shouldn't be always-on?

With the upcoming change, there is no garbage on display, but the framebuffer was not cleared, so it shows the last render from the platform firmware (when resetting from the platform firmware). This would be an issue with the rk_edp driver not clearing the memory, and/or maybe the backlight should be turned on later so the display is actually reset first(?) is now cleared.

(Fix WIP, will be pushed to the unified tree soon, as it requires revamping the organization of the Pinephone Pro changes, RK3399 changes, and some minor cleanups in the Pinebook Pro changes.)

@samueldr samueldr force-pushed the feature/drop-patches-use-repo branch from 668ee76 to dabb614 Compare June 28, 2023 21:03
@samueldr
Copy link
Contributor Author

samueldr commented Jun 28, 2023

Latest push updates the source ref; which in turn has the RK3399 history revisions, Pinebook Pro revisions, and framebuffer clearing.

@samueldr samueldr added this to the 20YY.MM-007 milestone Jul 2, 2023
@samueldr samueldr force-pushed the feature/drop-patches-use-repo branch from dabb614 to 5cb63ca Compare July 6, 2023 04:33
@samueldr
Copy link
Contributor Author

samueldr commented Jul 6, 2023

(Force-push synced with current development branch)

@samueldr samueldr marked this pull request as ready for review July 6, 2023 04:48
@samueldr samueldr added the 4. type: enhancement Accepted new feature label Jul 6, 2023
@samueldr samueldr force-pushed the feature/drop-patches-use-repo branch from 5cb63ca to f5c9c27 Compare July 7, 2023 22:21
@samueldr
Copy link
Contributor Author

samueldr commented Jul 7, 2023

@samueldr samueldr force-pushed the feature/drop-patches-use-repo branch from f5c9c27 to 30231db Compare July 8, 2023 01:43
@samueldr samueldr force-pushed the feature/drop-patches-use-repo branch from 30231db to f28f24d Compare July 8, 2023 02:31
samueldr added 3 commits July 7, 2023 22:47
By using the Modules system, we can introspect on the attrsets (or even
add new values), and in turn this means we can use the attrsets for
automatically building all the known versions! (upcoming!)
@samueldr samueldr force-pushed the feature/drop-patches-use-repo branch from f28f24d to 4904f24 Compare July 8, 2023 02:47
@samueldr samueldr merged commit e192ddb into Tow-Boot:development Jul 15, 2023
@samueldr samueldr deleted the feature/drop-patches-use-repo branch July 15, 2023 21:19
@samueldr
Copy link
Contributor Author

It wasn't entirely "tested" in full, like I wanted initially, but the reasoning to merge is two-fold:

  • I am already building up on top of this for the U-Boot update
  • Any platform-specific fixes requires work outside this repo anyway

Nothing here will require "fixing" other than the revision and hash once that is done.

Which leads to one question: how should that be managed for updates? I guess we'll add a pin in only when ready to publish a new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. type: enhancement Accepted new feature

Development

Successfully merging this pull request may close these issues.

1 participant