Skip to content

hi3536dv100: drop the nbd8010s variant now that OpenIPC U-Boot handles the E - #151

Merged
widgetii merged 2 commits into
masterfrom
hi3536dv100-drop-nbd8010s
Oct 15, 2026
Merged

widgetii merged 2 commits into
masterfrom
hi3536dv100-drop-nbd8010s

Conversation

@widgetii

Copy link
Copy Markdown
Member

The variant (#150) uploaded the Xiongmai NBD8010S-KL-V2's stock SPL
because the OpenIPC SPL reset that board mid-upload. The real cause was
in the U-Boot, not the board: Xiongmai's "Hi3536E" is a Hi3536DV100 die
that reads 0x02000000 at SYSCTRL+0xEE0 and needs its own PLL, DMC timing
and PHY settings. Without them, software DDR training fails and calls
reset_cpu(). OpenIPC/u-boot-hi3536dv100#1 now applies those settings on
that chip ID and is published as u-boot-hi3536dv100-universal.bin in
OpenIPC/firmware latest.

This removes the variant, the 0x5840-byte vendor SPL blob and the tests
that pinned it. burn keeps honouring SPL_BLOB, which hi3516av300:emmc
still uses, and the session test still checks that blob's 0x5000 length.

Verified on the NBD8010S-KL-V2 with plain -c hi3536dv100 and the
published U-Boot (its SPL window is byte-identical to the build tested
on hardware before merging):

defib agent upload -c hi3536dv100 -p /dev/ttyUSB2 --power-cycle
-> Agent ready; flash 0..0xF80000 CRC 0xa63bd6ca = backup
defib burn -c hi3536dv100 -p /dev/ttyUSB2 --power-cycle
-> "OpenIPC #", U-Boot 2010.06 (Oct 15 2026 - 17:06:41),
DDR PLL CRG+0x2c = 0x209b (the E setting)

…s the E

The variant (#150) uploaded the Xiongmai NBD8010S-KL-V2's stock SPL
because the OpenIPC SPL reset that board mid-upload. The real cause was
in the U-Boot, not the board: Xiongmai's "Hi3536E" is a Hi3536DV100 die
that reads 0x02000000 at SYSCTRL+0xEE0 and needs its own PLL, DMC timing
and PHY settings. Without them, software DDR training fails and calls
reset_cpu(). OpenIPC/u-boot-hi3536dv100#1 now applies those settings on
that chip ID and is published as u-boot-hi3536dv100-universal.bin in
OpenIPC/firmware latest.

This removes the variant, the 0x5840-byte vendor SPL blob and the tests
that pinned it. burn keeps honouring SPL_BLOB, which hi3516av300:emmc
still uses, and the session test still checks that blob's 0x5000 length.

Verified on the NBD8010S-KL-V2 with plain -c hi3536dv100 and the
published U-Boot (its SPL window is byte-identical to the build tested
on hardware before merging):

  defib agent upload -c hi3536dv100 -p /dev/ttyUSB2 --power-cycle
    -> Agent ready; flash 0..0xF80000 CRC 0xa63bd6ca = backup
  defib burn -c hi3536dv100 -p /dev/ttyUSB2 --power-cycle
    -> "OpenIPC #", U-Boot 2010.06 (Oct 15 2026 - 17:06:41),
       DDR PLL CRG+0x2c = 0x209b (the E setting)
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Use universal U-Boot for Hi3536E instead of the NBD8010S variant

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

Grey Divider

AI Description

• Remove the NBD8010S profile workaround now that OpenIPC U-Boot handles Hi3536E DDR initialization.
• Document plain -c hi3536dv100 for both dies and remove tests tied to the retired variant.
• Keep SPL_BLOB support and its remaining hi3516av300:emmc coverage unchanged.
Diagram

graph TD
  CLI["defib command"] --> Profile["Base profile"] --> Transfer["SPL transfer"] --> Chip{"Hi3536E ID?"} --> Settings["DDR settings"]
  Firmware["Universal U-Boot"] --> Transfer
Loading
High-Level Assessment

Retiring the board-specific SPL override is appropriate because the published universal U-Boot now addresses the die-level DDR difference. Keeping the vendor SPL as a fallback would preserve a redundant board-specific path; SPL_BLOB remains available for boards that still need it.

Files changed (5) +6 / -23

Bug fix (1) +1 / -1
hi3536dv100.jsonRemove the NBD8010S SPL override +1/-1

Remove the NBD8010S SPL override

• Deletes the NBD8010S variant's vendor SPL_BLOB and enlarged FILELEN declaration. The base profile and its standard 0x5000 SPL limit remain unchanged.

src/defib/profiles/data/hi3536dv100.json

Tests (3) +0 / -17
test_agent_binary_lookup.pyRemove obsolete NBD8010S binary lookup assertion +0/-3

Remove obsolete NBD8010S binary lookup assertion

• Removes the assertion that the retired board variant resolves to the hi3536dv100 agent build. Other variant lookup coverage remains.

tests/test_agent_binary_lookup.py

test_profiles.pyRemove vendor SPL profile assertions +0/-13

Remove vendor SPL profile assertions

• Deletes the test that pinned the NBD8010S vendor SPL contents and 0x5840 length. Existing hi3516av300:emmc and general SPL_BLOB tests remain.

tests/test_profiles.py

test_recovery_session.pyDrop retired variant from SPL transfer test +0/-1

Drop retired variant from SPL transfer test

• Removes NBD8010S from the parameterized recovery-session test. The hi3516av300:emmc case still checks that its 0x5000-byte SPL blob is sent without padding.

tests/test_recovery_session.py

Documentation (1) +5 / -5
README.mdDocument universal Hi3536E recovery +5/-5

Document universal Hi3536E recovery

• Replaces the NBD8010S-specific command guidance with plain hi3536dv100 usage. Explains that OpenIPC U-Boot recognizes the Hi3536E chip ID and applies its DDR settings.

agent/README.md

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

qodo-free-for-open-source-projects Bot commented Oct 15, 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


Action required

1. Cached images prevent Hi3536E recovery ✓ Resolved
Description
Removing the nbd8010s SPL_BLOB makes agent upload take its SPL from the cached universal
U-Boot image instead of the board-specific blob. When that cache holds the earlier build without
Hi3536E DDR settings, the upload still selects it rather than the newly published image, so DDR
training fails and the agent cannot start.
Code

src/defib/profiles/data/hi3536dv100.json[1]

+{"name": "hi3536dv100", "PRESTEP0": [4, 224, 45, 229, 36, 0, 159, 229, 36, 16, 159, 229, 0, 16, 128, 229, 32, 0, 159, 229, 32, 16, 159, 229, 4, 16, 128, 228, 0, 224, 128, 229, 4, 240, 157, 228, 239, 190, 173, 222, 239, 190, 173, 222, 239, 190, 173, 222, 60, 1, 5, 18, 78, 87, 79, 68, 64, 1, 5, 18, 117, 106, 105, 122], "DDRSTEP0": [4, 224, 45, 229, 36, 0, 159, 229, 36, 16, 159, 229, 0, 16, 128, 229, 32, 0, 159, 229, 32, 16, 159, 229, 4, 16, 128, 228, 0, 224, 128, 229, 4, 240, 157, 228, 239, 190, 173, 222, 239, 190, 173, 222, 239, 190, 173, 222, 60, 1, 5, 18, 120, 86, 52, 18, 64, 1, 5, 18, 117, 106, 105, 122], "ADDRESS": ["0x04012000", "0x04010500", "0x81000000"], "FILELEN": ["0x0040", "0x5000"], "STEPLEN": ["0x0040", "0x0050"]}
Evidence
The changed profile no longer declares a board SPL. The agent upload path uses cached U-Boot bytes
as its SPL when the profile has no SPL data; cache lookup accepts any nonempty file under the
universal image name, and even the download function returns that file without checking for a newer
release. The PR states that the earlier universal build lacks the settings required to train Hi3536E
DDR.

src/defib/profiles/data/hi3536dv100.json[1-1]
src/defib/cli/app.py[1177-1195]
src/defib/firmware.py[208-238]
src/defib/firmware.py[303-318]

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

## Issue description
Removing the board-specific SPL makes Hi3536E recovery depend on an updated universal U-Boot image, but an older image cached under the same filename is reused without a freshness check.
## Fix Focus Areas
- src/defib/profiles/data/hi3536dv100.json[1-1]
- src/defib/firmware.py[208-238]
- src/defib/cli/app.py[1177-1195]
## Recommended Fix
Add a version or known-good SPL check for the Hi3536DV100 cached image and refresh incompatible entries before using them for agent upload. Apply the same cache validation to automatic burn and install resolution, while preserving explicit local-file overrides.

ⓘ 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 hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/defib/profiles/data/hi3536dv100.json
…536E fix

Qodo review on this branch. With the nbd8010s variant gone, the
Hi3536E relies on the published u-boot-hi3536dv100-universal.bin. But
the cache never refreshes: a copy downloaded before
OpenIPC/u-boot-hi3536dv100#1 keeps being served under the same name,
and its SPL resets a Hi3536E during DDR training.

get_cached_path() now runs a per-asset content check and treats an entry
that fails it as missing, so burn, install and agent upload fetch the
current build. The hi3536dv100 check looks for two of the E variant's
DMC timing values (0x34421a12, 0x4144b48d) in the SPL window. They sit
in the literal pool whatever registers a rebuild allocates. The last
pre-fix published build fails the check, and the current one passes.
Explicit -f files are never checked.

Offline, the stale copy is still used, with a warning: it works on
plain DV100 boards. _download() deletes its destination on failure, so
download_firmware() saves the stale bytes first and puts them back.

Verified on the NBD8010S-KL-V2: with the pre-fix build seeded into the
cache, `defib agent upload -c hi3536dv100 --power-cycle` downloaded the
current one and the agent came up READY.
@widgetii
widgetii merged commit c1fed01 into master Oct 15, 2026
13 checks passed
@widgetii
widgetii deleted the hi3536dv100-drop-nbd8010s branch October 15, 2026 17:23
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