Skip to content

agent: the V500 donor U-Boot from OpenIPC/firmware, not u-boot-xmedia - #162

Merged
widgetii merged 2 commits into
masterfrom
agent/v500-donor-from-firmware
Oct 22, 2026
Merged

widgetii merged 2 commits into
masterfrom
agent/v500-donor-from-firmware

Conversation

@widgetii

Copy link
Copy Markdown
Member

download_v500_donor() fetched u-boot-gk7205v5x0-nor.bin from OpenIPC/u-boot-xmedia's own release. That release stopped updating when the repository stopped publishing (u-boot-xmedia#14), and the repository is now archived. OpenIPC/u-boot publishes the same images to OpenIPC/firmware latest, which every other per-flash-type SoC already uses; the donor comes from there now.

defib keeps only the donor's key area, params and DDR-init (aux) area; the agent replaces the U-Boot code after them. For gk7205v500, v510 and v530:

  • both sources carry the same 0x400-byte key area and the same 20 KiB aux area, byte for byte;
  • wrap_v500_payload() builds a byte-identical agent boot image from either;

so the agent still loads at 0x41007000 and what reaches the camera does not change.

Help text and docstrings stop naming u-boot-xmedia; the donor URL test expects the firmware release. pytest tests/ --ignore=tests/fuzz: 1084 passed. ruff and mypy are clean. Not run on hardware (the image sent is unchanged).

download_v500_donor() fetched u-boot-gk7205v5x0-nor.bin from
OpenIPC/u-boot-xmedia's own release, which stopped updating when that
repository stopped publishing (#14) and is now archived. OpenIPC/u-boot
publishes the same images to OpenIPC/firmware latest, which every other
per-flash-type SoC already uses; the donor comes from there now.

defib keeps only the donor's key area, params and DDR-init (aux) area;
the U-Boot code after them is replaced by the agent. For gk7205v500,
v510 and v530 both sources carry the same 0x400-byte key area and the
same 20 KiB aux area byte for byte, and wrap_v500_payload() builds a
byte-identical agent boot image from either, so the agent still loads at
0x41007000 and what reaches the camera does not change.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fetch V500 agent donor images from OpenIPC/firmware

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Switch V500 donor downloads to the maintained OpenIPC/firmware release instead of the archived
 u-boot-xmedia release.
• Preserve donor filenames and caching; the agent boot image remains byte-identical according to the
 PR’s source comparison.
• Update CLI guidance, documentation, and the donor URL test.
Diagram

graph TD
  CLI["Agent upload CLI"] --> Donor["Donor downloader"] --> Release["Firmware release"] --> Cache[("Donor cache")] --> Wrapper["Image wrapper"] --> Bootrom["V500 bootrom"]
  CLI --> Wrapper
Loading
High-Level Assessment

Reuse the existing OpenIPC/firmware release URL and donor cache. This avoids a separate source-specific download path while retaining the established image-wrapping flow; changing the wrapper or bundling a donor would add unnecessary scope.

Files changed (4) +15 / -14

Bug fix (1) +8 / -8
firmware.pyDownload V500 donors from OpenIPC/firmware +8/-8

Download V500 donors from OpenIPC/firmware

• The donor downloader now uses the existing OpenIPC/firmware release base URL. The NOR asset name and cache behavior are unchanged; comments explain why this donor remains suitable.

src/defib/firmware.py

Tests (1) +5 / -4
test_firmware.pyExpect the firmware release donor URL +5/-4

Expect the firmware release donor URL

• The donor download test now expects the OpenIPC/firmware latest-release URL. A cache-sharing test comment is updated to reflect the common NOR asset name.

tests/test_firmware.py

Documentation (2) +2 / -2
app.pyClarify the default V500 donor in upload help +1/-1

Clarify the default V500 donor in upload help

• The --file option now describes the default donor by its OpenIPC U-Boot asset name rather than naming the retired u-boot-xmedia source.

src/defib/cli/app.py

hisilicon_v500.pyCorrect the donor source in wrapper documentation +1/-1

Correct the donor source in wrapper documentation

• The wrapper docstring no longer attributes the example donor image to u-boot-xmedia. Payload wrapping logic is unchanged.

src/defib/protocol/hisilicon_v500.py

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Agent instructions name the wrong donor source ✓ Resolved
Description
The new download URL in download_v500_donor() points to OpenIPC/firmware, but the agent README
still says the default image is downloaded from u-boot-xmedia. Users following the README to find
the default donor manually are directed to the retired source instead of the release the command now
uses.
Code

src/defib/firmware.py[505]

+    return _download(f"{OPENIPC_BASE_URL}/{name}", dest)
Evidence
The README explicitly calls the downloaded default an OpenIPC u-boot-xmedia image, while the changed
download call uses OPENIPC_BASE_URL, defined as the OpenIPC/firmware latest release.

agent/README.md[87-90]
src/defib/firmware.py[29-31]
src/defib/firmware.py[494-505]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The agent README identifies u-boot-xmedia as the default donor source, but the download now uses OpenIPC/firmware.
## Fix Focus Areas
- agent/README.md[87-90]
- src/defib/firmware.py[494-505]
## Recommended Fix
Update the README to identify the OpenIPC/firmware latest release and its per-chip NOR image as the default donor. Keep the explanation of the DDR-init and boot-code behavior.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/defib/firmware.py
From review: the README still named u-boot-xmedia as the default donor
source after download_v500_donor() moved to OpenIPC/firmware.
@widgetii
widgetii merged commit e10273a into master Oct 22, 2026
13 checks passed
@widgetii
widgetii deleted the agent/v500-donor-from-firmware branch October 22, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant