Skip to content

Catalogue: hi3516cv610, hi3516cv608 and hi3519dv500, on the split NOR layout - #486

Merged
widgetii merged 4 commits into
masterfrom
catalogue/cv6xx-dv500
Oct 20, 2026
Merged

widgetii merged 4 commits into
masterfrom
catalogue/cv6xx-dv500

Conversation

@widgetii

Copy link
Copy Markdown
Member

Lists hi3516cv610, hi3516cv608 and hi3519dv500 with wizard instructions and on-demand full images, on the split NOR layout their firmware moved to (OpenIPC/firmware#2638, OpenIPC/u-boot#32/#35, OpenIPC/linux#101-#109). Differences are catalogue data; no SoC-name branches in code, and every existing SoC's wizard document is byte-identical.

Catalogue

  • One entry per published signed boot image, named like the firmware's full images: hi3516cv610-ddr2-64m (10b), hi3516cv610-ddr3-128m (20s), hi3516cv610-ddr3-512m (00s), hi3516cv608, hi3519dv500-dmeb, hi3519dv500-dmebpro. No new wizard menu or URL parameter.
  • New optional fields: nor_firmware_offset (default 0x50000; dv500 0xc0000: 512K boot + 256K env), nor_kernel_read (default 0x200000; dv500 0x600000: what bootloaders in the field read to boot), nor_split_only (no fixed-slot build: install, link and assemble the split package whatever FIT-era plain package the index still lists).

Wizard: the U-Boot step blanks/erases/writes up to the SoC's firmware offset (dv500's 0x5FC00-class boot image no longer overruns a 0x50000 erase); firmware.bin goes there and the rest of the chip is erased. Split-only -split.tgz editions count as published.

Full images: split mode for split-only editions -- boot image at 0 (bounded by the offset), firmware.bin at the offset (bounded by the chip less 64K), the rest 0xFF; a uImage longer than nor_kernel_read is refused. layoutVersion 3. Goke (plain and split) keeps fixed-slot images.

Explorer/wizard menu: the boot-area constant and the "Ultimate only" note corrected (cv6xx has lite and ultimate; dv500 ultimate).

Tests: service/run.sh test passes (new TestSplitOnlySoCs, TestSplitImages, TestSplitImageOnlyWhenSplitOnly, TestSplitOnlyIgnoresAStalePlainPackage); bin/conformance passes; frontend lint/typecheck pass, npm test and the Astro build pass under Node 24. Goldens, testdata, sitemap and firmware-segments.tsv regenerated.

For a maintainer to confirm

  • Per-board catalogue entries rather than a variant menu.
  • 20g/00g left out: same DDR tables as 20s/00s, as image.yml assembles.
  • Status mvp for cv6xx (a contributor runs a cv610 on hardware, #2460), wip for dv500 (QEMU only).
  • load_address 0x42000000 for all six.

Not verified: against the production index -- the cv6xx/dv500 -split packages appear with the next firmware nightly; the fixture's -split entries are the old plain ones renamed. Validate on dev.openipc.org before production once they are published.

… layout

OpenIPC/firmware moves hi3516cv6xx and hi3519dv500 onto the split NOR
layout of the gk7205v200 family (OpenIPC/firmware#2638): one
firmware.bin -- a uImage, then the squashfs at the next 64 KiB -- that
the kernel divides at boot (OpenIPC/linux #101-#109), booted by the
OpenIPC/u-boot boot images now published in latest (OpenIPC/u-boot#32,
#35). They publish only the -split package. Three things the site took
as given are not, for them; each is data here, not a case:

- One signed boot image per DDR binning, not one bootloader per SoC.
  Each published one is a catalogue entry of its own, named as the
  firmware's full images are: HI3516CV610-DDR2-64M (10b), -DDR3-128M
  (20s), -DDR3-512M (00s), HI3516CV608, HI3519DV500-DMEB and -DMEBPRO.
  A visitor already has to know which DDR the board carries; the entry
  is that choice, and its page, wizard and full image follow from it
  with no new menu. The 20g/00g images carry the same DDR tables as
  20s/00s and are not listed apart.
- The boot area. nor_firmware_offset (0x50000 when empty) is where the
  boot partition and environment end; hi3519dv500's board has a 512K boot
  partition and 256K of environment, 0xC0000. The U-Boot step blanks, erases and
  writes up to it, and firmware.bin goes there. nor_kernel_read
  (0x200000 when empty; 0x600000 on hi3519dv500) is what the bootloaders
  in the field read from there to boot.
- Split-only packages. A NOR edition is published when either package
  is: the index counts openipc.<board>-nor-<edition>-split.tgz, the page
  links the package that exists, and a split board with nothing
  published yet is shown the split install at its own offset rather than
  fixed slots it has none of.

Full images for an edition published only as the -split package are the
boot image at 0, bounded by the firmware offset, and firmware.bin there,
bounded by the chip less one erase block for settings, the rest erased;
one whose uImage is longer than the kernel read is refused
(layoutVersion 3). Where the plain package is published -- the
gk7205v200 family -- the image keeps the fixed slots, as before.

The fixture index follows the releases: the boot images as latest has
them now (198656 and 240640 bytes, their digests), and the cv6xx and
dv500 packages under their -split names. boards.json, availability,
the documents golden (every existing SoC's document unchanged; six
added), the sitemap golden (18 addresses) and firmware-segments.tsv are
regenerated.

Checked: service/run.sh test (24 packages, go vet), bin/conformance;
TestSplitOnlySoCs (editions, links, the 0xC0000 bootloader and
firmware.bin lines on 16 and 32 MB, 0x50000 on 8 MB, the boot image per
board) and TestSplitImages (the image byte for byte at 0x50000 and
0xC0000, and the three refusals) are new. Frontend lint, typecheck and
tests pass under Node 24. Not deployed; dev.openipc.org first.
The explorer's flash map assumed a 0x50000 boot area on every NOR
layout; hi3519dv500's is 0xC0000. A split-layout build reports no
kernel cap, so the map is not drawn for it -- say so where the constant
is. The wizard menu said hi3516cv6xx and hi3519dv500 are built only as
Ultimate; hi3516cv6xx has a Lite build, and only hi3519dv500 is
Ultimate-only.
hi3516cv6xx and hi3519dv500 publish only the split NOR package now, but
their FIT-era plain packages stay on the release (and in the index) under
the plain names: a release only adds and replaces what a build uploads.
Inferred from the index, "split-only" turned back into "plain and split"
as soon as one was listed, and a full image would then be assembled from
uImage/rootfs members those packages do not have.

nor_split_only, set on the six entries, decides it: the wizard installs
and links the split package, and the builder assembles the split image,
whatever plain package is still listed for the board.

service/run.sh test passes; TestSplitOnlyIgnoresAStalePlainPackage
resolves a cv610 lite image with both packages listed to the split one.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add split-NOR support for HI3516CV6xx and HI3519DV500

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Catalogue six board and DDR variants with their published boot images and split-NOR packages.
• Make wizard instructions and full-image assembly honor board-specific offsets and bootloader read
 limits.
• Add split-layout regression tests and regenerate catalogue, availability, document, and sitemap
 fixtures.
Diagram

graph TD
  C["SoC catalogue"] --> D{"Split only?"} -->|yes| S["Split package"] --> A["Image assembler"] --> O["Full NOR image"]
  I["Release index"] --> D -->|no| P["Plain package"] --> A
  S --> W["Wizard instructions"]
  P --> W
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Infer layout from indexed packages
  • ➕ Avoids a split-only flag in catalogue entries.
  • ➖ Stale FIT-era plain packages could incorrectly select fixed-slot installation or assembly.
2. Add a DDR variant selector
  • ➕ Keeps fewer top-level catalogue entries.
  • ➖ Adds a wizard choice and mapping logic to a decision visitors already need to make.

Recommendation: Keep the data-driven, per-boot-image entries and explicit split-only policy: they preserve existing wizard behavior and protect against stale plain packages. Before production, validate links and firmware.bin contents against the newly published split packages; the renamed fixture does not establish production compatibility.

Files changed (20) +839 / -61

Enhancement (10) +346 / -23
hisilicon.ymlCatalogue six split-only HiSilicon variants +101/-1

Catalogue six split-only HiSilicon variants

• Adds CV608, three CV610 DDR variants, and two DV500 boards with their respective signed boot images. Marks them split-only and sets DV500-specific firmware offsets and kernel read limits.

data/catalogue/hisilicon.yml

availability.jsonExpose six new wizard-capable entries +6/-0

Expose six new wizard-capable entries

• Records wizard availability for every new HiSilicon catalogue slug.

frontend/apps/site/src/data/availability.json

catalogue.jsonRegenerate frontend HiSilicon catalogue +60/-0

Regenerate frontend HiSilicon catalogue

• Adds the six board and DDR variants, their statuses, and load addresses to the site's catalogue data.

frontend/apps/site/src/data/catalogue.json

catalogue.goDefine validated per-SoC NOR layout settings +65/-6

Define validated per-SoC NOR layout settings

• Adds split-only, firmware-offset, and kernel-read catalogue fields. Validates supplied hexadecimal sizes and provides defaults for existing boards.

service/internal/catalogue/catalogue.go

build.goAssemble and validate split NOR images +33/-2

Assemble and validate split NOR images

• Resolves split-only packages, incorporates split layout parameters into image keys, and advances the layout version. Rejects a split uImage whose declared length exceeds the bootloader's read size.

service/internal/firmware/build.go

index.goDiscover editions published as split packages +14/-1

Discover editions published as split packages

• Recognizes split tarball names as NOR editions and deduplicates editions when plain and split packages coexist.

service/internal/firmware/index.go

layout.goDefine split package members and flash boundaries +37/-1

Define split package members and flash boundaries

• Selects firmware.bin for split-only images and places it after each SoC's boot area. Bounds it before the chip's final erase block while leaving fixed-slot layouts intact.

service/internal/firmware/layout.go

camera.goUse per-SoC NOR flashing offsets +8/-6

Use per-SoC NOR flashing offsets

• Derives boot-area size, split firmware offset, and remaining-flash erase length from catalogue settings instead of a universal 0x50000 offset.

service/internal/wizard/camera.go

export.goPublish split-only links and installation paths +17/-2

Publish split-only links and installation paths

• Links split packages for split-only NOR editions and selects split installation instructions even when an older plain package remains indexed.

service/internal/wizard/export.go

lines.goFlash combined firmware at the SoC offset +5/-4

Flash combined firmware at the SoC offset

• Uses the board-specific offset in split firmware commands and corrects the description of firmware.bin's uImage content.

service/internal/wizard/lines.go

Tests (8) +483 / -31
sitemap.golden.xmlAdd localized routes for six SoCs +126/-0

Add localized routes for six SoCs

• Adds sitemap URLs and language alternates for the new catalogue pages.

frontend/apps/site/src/lib/sitemap.golden.xml

wizard-menu.test.tsCorrect ultimate-only test context +2/-2

Correct ultimate-only test context

• Updates the test explanation to distinguish DV500's Ultimate-only build from CV6xx's Lite and Ultimate builds; the assertion is unchanged.

frontend/apps/site/src/lib/wizard-menu.test.ts

split_test.goTest split-image selection and safety limits +194/-0

Test split-image selection and safety limits

• Checks CV610 and DV500 image placement, erased regions, boot-image bounds, overlay reserve, and uImage read limits. Verifies that Goke retains fixed slots and stale plain packages do not override split-only selection.

service/internal/firmware/split_test.go

availability.jsonRefresh availability fixture +1/-1

Refresh availability fixture

• Adds wizard availability for all six new catalogue slugs.

service/internal/firmware/testdata/availability.json

boards.jsonRefresh board-resolution fixture +60/-0

Refresh board-resolution fixture

• Records the new variants' shared firmware board names and distinct boot-image names.

service/internal/firmware/testdata/boards.json

release-index.jsonRefresh boot assets and split-package fixtures +27/-27

Refresh boot assets and split-package fixtures

• Updates CV6xx and DV500 boot-asset metadata and renames their fixture package entries to split editions. The split entries retain old package metadata and are not proof of production package contents.

service/internal/firmware/testdata/release-index.json

documents.jsonRecord new wizard document goldens +7/-1

Record new wizard document goldens

• Adds document hashes for six SoCs and updates the combination count; existing SoC document hashes remain unchanged.

service/internal/wizard/testdata/documents.json

wizard_test.goTest split-only wizard editions and commands +66/-0

Test split-only wizard editions and commands

• Verifies published editions, split-package links, board-specific boot images, and CV6xx/DV500 flashing offsets. Ensures their firmware steps do not emit fixed-slot kernel or rootfs commands.

service/internal/wizard/wizard_test.go

Documentation (2) +10 / -7
summary.tsClarify fixed-slot boot-area scope +5/-1

Clarify fixed-slot boot-area scope

• Documents that the explorer's 320 KiB boot constant applies to fixed-slot NOR maps, not the new split layouts.

frontend/apps/site/src/lib/explorer/summary.ts

wizard-menu.tsCorrect edition-menu documentation +5/-6

Correct edition-menu documentation

• Clarifies why the existing menu fallback remains necessary for DV500 without claiming CV6xx is Ultimate-only.

frontend/apps/site/src/lib/wizard-menu.ts

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

qodo-free-for-open-source-projects Bot commented Oct 20, 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. New SoC pages offer downloads that do not exist yet ✓ Resolved
Description
For nor_split_only SoCs, exporter.releases and availability count editions from idx.Releases
even when the index contains only an older plain NOR archive, while packageName, Resolve, and
LinuxAsset require the split archive. Before split packages are published, or when an edition is
later dropped from the split build, the wizard lists it as published with a latest/ link that
returns 404, and full-image requests fail with ErrUnknownAsset.
Code

service/internal/wizard/export.go[R262-266]

+func (e *exporter) packageName(release, ft string) string {
+	if ft == "nor" && e.soc.NORSplit && e.soc.NORSplitOnly {
+		return splitFilename(e.boardFor(ft), release)
+	}
+	return e.linuxFilename(release, ft)
Evidence
The index derives NOR releases from either plain or split assets, so a plain archive such as
openipc.hi3516cv6xx-nor-lite.tgz is enough for idx.Releases to include the edition. The exporter
uses that list for published editions, and availability uses its count to show wizard, but
packageName selects the split archive for split-only SoCs. If that archive is absent, url()
falls back to ghDownload + "latest/" + name, while image resolution requires an indexed split
asset. The PR description states that the split packages are not published yet.

service/internal/wizard/export.go[74-82]
service/internal/wizard/export.go[127-152]
service/internal/wizard/export.go[183-195]
service/internal/firmware/availability.go[30-42]
service/internal/firmware/index.go[149-158]
service/internal/firmware/build.go[96-115]
service/internal/firmware/index.go[150-156]
service/internal/wizard/export.go[74-80]
service/internal/wizard/export.go[193-201]
service/internal/wizard/export.go[259-266]
service/internal/firmware/build.go[96-114]
service/internal/firmware/layout.go[186-200]

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

## Issue description
For split-only NOR SoCs, a stale plain archive can make an edition count as published even though the split archive required for installation and full images is absent.
## Fix Focus Areas
- service/internal/wizard/export.go[127-170]
- service/internal/wizard/export.go[259-267]
- service/internal/firmware/availability.go[27-44]
## Recommended Fix
When `soc.NORSplit && soc.NORSplitOnly` and `ft == "nor"`, count an edition as published only if `idx.Asset(SplitName(board, edition))` exists. Apply the check consistently to exporter releases, published links, and availability, ideally through one shared helper in the firmware package. Retain the current plain-or-split behavior for SoCs that support fixed-slot builds.

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


2. Split-only editions break full images on gk7205v200 ✓ Resolved
Description
NewIndex now adds an edition to a board's NOR releases whenever openipc.-nor--split.tgz exists,
but Resolve only uses the split package when nor_split_only is set. On the gk7205v200 family
(nor_split without nor_split_only), an edition published only as split is therefore offered, yet
its full image asks for the missing plain package and fails with ErrUnknownAsset. The wizard's
published URL for that edition (linuxFilename, the plain name) also falls back to a missing
latest/ link.
Code

service/internal/firmware/index.go[R153-156]

+		} else if m := splitAssetName.FindStringSubmatch(a.Name); m != nil {
+			// A NOR edition is published when either package is.
+			k := [2]string{m[1], "nor"}
+			idx.builds[k] = append(idx.builds[k], m[2])
Evidence
Before this PR the split names matched no regex and did not affect builds. Now they do for every
board. splitOnly ignores the index (idx is unused) and returns false unless NORSplitOnly is set,
so LinuxAsset returns the plain name. packageName likewise returns the plain name for
non-split-only SoCs.

service/internal/firmware/index.go[149-158]
service/internal/firmware/layout.go[186-200]
service/internal/firmware/build.go[96-111]
service/internal/wizard/export.go[262-267]

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

## Issue description
A split-only edition on a nor_split (not split-only) board is now listed as published, but Resolve and packageName still use the plain package name.
## Fix Focus Areas
- service/internal/firmware/layout.go[195-200]
- service/internal/wizard/export.go[262-267]
## Recommended Fix
In `splitOnly`, also return true when `s.SoC.NORSplit` is set, the plain `LinuxAsset` name is missing from idx, and `SplitName(board, s.Release)` is present. Make `packageName` use the same rule (pick the split name when the plain package is absent and the split one is present).

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



Informational

3. Split images ignore the chosen layout ✓ Resolved
Description
With Split set, parts() places firmware.bin at the SoC's firmware offset and bounds it by
SizeMB alone, ignoring LayoutMB. A -parts8m request on a 16 MB chip is still accepted and
builds the same bytes as the natural-layout image. It is cached under a different filename and key,
because Filename() and Key() still include the layout.
Code

service/internal/firmware/layout.go[R237-246]

+	if s.Split {
+		// firmware.bin -- the uImage, then the squashfs -- from where the
+		// environment ends to a block short of the chip's end: the kernel
+		// makes rootfs_data of what follows the image, and with less than
+		// a block there would be no overlay to keep settings in.
+		off := s.SoC.FirmwareOffset()
+		return []part{
+			{"u-boot", "", 0, off, "the firmware offset"},
+			{"firmware", rootfs, off, int64(s.SizeMB)*mb - splitOverlayMin, "the last block, kept for settings,"},
+		}
Evidence
Filename adds -parts%dm whenever LayoutMB differs from the natural layout, and Key hashes
s.nor(), which depends on LayoutMB. The split branch of parts never reads LayoutMB.

service/internal/firmware/layout.go[139-151]
service/internal/firmware/build.go[83-93]

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

## Issue description
Split images ignore LayoutMB, but the filename and cache key still vary with it, so the same bytes get built and cached more than once.
## Fix Focus Areas
- service/internal/firmware/build.go[96-98]
## Recommended Fix
In Resolve, once s.Split is set, either reject a non-natural LayoutMB with ErrInvalid or set `s.LayoutMB = NaturalLayout(s.SizeMB)`, so there is a single filename and key per split image.

ⓘ 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 open the rule or relationship behind a finding in one click

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread service/internal/wizard/export.go
Comment thread service/internal/firmware/index.go
Comment thread service/internal/firmware/layout.go
From review.
- A split-only SoC (nor_split_only) counted an edition as published when
  only its board's stale plain package was listed, then linked and
  assembled the split package, which is not there yet: a latest/ link
  that 404s and a full image that fails. NORReleases counts, for such a
  SoC, only editions whose split package is published; availability and
  the wizard's editions both read it.
- On a split SoC that also builds fixed slots (the gk7205v200 family), an
  edition only the split package carries was offered but linked and
  assembled from the missing plain package. SplitOnlyEdition decides for
  both the link and Resolve: the board is split-only, or the edition has
  only the split package.
- A split image ignores the partition layout (firmware.bin goes at the
  firmware offset), so every layout asked of it took its own file name
  and cache key for the same bytes. It now has the natural one.

service/run.sh test passes, goldens unchanged; new tests: a stale plain
package alone offers nothing (availability none), the split one makes it
wizard; gk7205v300 ultimate published only split is assembled split while
lite stays fixed-slot; a parts8m split image has the natural one's name
and key.
@widgetii
widgetii merged commit 5bac051 into master Oct 20, 2026
2 checks passed
@widgetii
widgetii deleted the catalogue/cv6xx-dv500 branch October 20, 2026 04: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