Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adds a pre-boot hook that runs immediately before hal_prepare_boot(), exposes the validated DTB to hooks, and adds FDT helpers for parent lookup, alias resolution, and reg decoding.
Changes:
- Adds
WOLFBOOT_HOOK_PREBOOTsupport across update strategies, build options, documentation, and simulator tests. - Adds
wolfBoot_get_dts_address()and publishes the DTB before the pre-boot hook. - Adds
fdt_parent_offset(),fdt_get_alias(),fdt_get_reg(), and unit tests covering common cell layouts and invalid inputs.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tools/unit-tests/unit-fdt.c |
Adds FDT helper tests and a compiled DTB fixture. |
src/update_ram.c |
Publishes the DTB and invokes the pre-boot hook. |
src/update_flash_hwswap.c |
Adds the DTB accessor stub and pre-boot hook invocation. |
src/update_flash.c |
Adds the DTB accessor stub and pre-boot hook invocation. |
src/update_disk.c |
Publishes the DTB and invokes the pre-boot hook. |
src/fdt.c |
Implements parent, alias, and reg helpers. |
options.mk |
Enables the pre-boot hook build option. |
include/hooks.h |
Declares the pre-boot hook and DTB accessor. |
include/fdt.h |
Documents the new FDT APIs. |
docs/hooks.md |
Documents hook timing and DTB access. |
.github/workflows/test-hooks-simulator.yml |
Tests pre-boot hook invocation and accessor definitions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /* The device tree wolfBoot is about to hand to the OS, or NULL. Valid from | ||
| * wolfBoot_hook_preboot() on, once the DTB is located, relocated and (where | ||
| * a digest is bound) authenticated. Read-only. */ | ||
| void* wolfBoot_get_dts_address(void); |
Comment on lines
+1000
to
+1002
| if ((uint32_t)index >= ((uint32_t)len / entry)) { | ||
| return -FDT_ERR_NOTFOUND; | ||
| } |
dgarske
force-pushed
the
preboot_hook_fdt
branch
from
September 18, 2026 01:28
84e418f to
8584ba7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
WOLFBOOT_HOOK_PREBOOT, which fires immediately beforehal_prepare_boot(). That is where ports tear the environment down for handoff, and several do something irreversible there: flushing or disabling caches, disabling the MMU (hal/cm4.c), leaving 4-byte flash addressing (hal/zynq.c). Work that needs DMA, a live MMU mapping or external flash has had nowhere to run; the existingWOLFBOOT_HOOK_BOOTstays for whatever must happen last.