Skip to content

hi3516ev300: the split NOR image only, like hi3516cv6xx - #2656

Merged
widgetii merged 2 commits into
masterfrom
split/hi3516ev300
Oct 21, 2026
Merged

widgetii merged 2 commits into
masterfrom
split/hi3516ev300

Conversation

@widgetii

Copy link
Copy Markdown
Member

hi3516ev300 joins the split NOR layout, split-only. Its lite rootfs is 16 KiB short of the 5 MiB slot and its kernel 41 KiB short of 2 MiB; with the split options its uImage is 2008K, over the 1983K a fixed-slot package beside a split one may use (#2655), so it ships -split alone, as hi3516cv6xx does.

Sizes: lite uImage 2008K (2048K read), firmware.bin 7168K of 7616K; ultimate firmware.bin 10240K of 15808K, rootfs.ubi 18304K of 24576K.

Tested in qemu-hisilicon (hi3516ev300, published u-boot-hi3516ev300-nor.bin 2022.10-gbaa15068, 8 MB lite and 16 MB ultimate, two boots each): U-Boot reads the image as fixed slots (Found RootFS at 0x00250000: the squashfs lands exactly 2 MiB after the uImage) and passes root=/dev/mtdblock3 with fixed mtdparts; the kernel prints hi_sfc: split NOR layout, device tree partitions and root=/dev/mtdblock3 ignored, root on 31:4, login prompt; rootfs_data at 0x750000 / 0xa50000 formatted once and kept across the reboot (overlay marker present). test_sysupgrade.sh and ci-matrix --self-test pass.

After merge: the plain openipc.hi3516ev300-nor-{lite,ultimate}.tgz on latest stay until deleted; once deleted, CLI sysupgrade (which updates itself first) takes -split.tgz, while web-UI upgrades with a sysupgrade older than the split-URL fallback find no package and write nothing. Not run on hardware.

hi3516ev300's kernel is 2009K with the split options: padded to 64 KiB
it ends exactly at the 2 MiB slot, so a fixed-slot package cannot ship
beside a split one (the kernel would take the fixed image as split while
U-Boot reads fixed slots). #2655 therefore left it out; it now ships the
split package alone, as hi3516cv6xx does. Its lite images sat 16 KiB
short of the 5 MiB rootfs slot, so it is the board that needs it most.

- lite, ultimate, dev and glibc use general/scripts/post-image-split.sh
  without BR2_OPENIPC_NOR_FIXED_PACKAGE: openipc.hi3516ev300-nor-<variant>
  -split.tgz, no plain NOR package; ultimate still packages its NAND
  image. dev and glibc share hi3516ev300.generic.config, so they go with
  it rather than keep fixed-slot images a split-capable kernel would
  misread. neo keeps its own config and fixed-slot package.
- hi3516ev300.generic.config: MTD_SPLIT_FIRMWARE ("firmware"),
  MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT, MTD_ROOTFS_ROOT_DEV
  (OpenIPC/linux#131, #134).

Built locally (kernel at hisilicon-hi3516ev200 e7008a95c):
- hi3516ev300_lite: uImage 2008K/2048K read, firmware.bin 7168K/7616K;
- hi3516ev300_ultimate: firmware.bin 10240K/15808K, rootfs.ubi
  18304K/24576K, plus the NAND package.

Tested in qemu-hisilicon (hi3516ev300) with the published
u-boot-hi3516ev300-nor.bin (2022.10-gbaa15068), split firmware.bin at
0x50000, 8 MB lite and 16 MB ultimate, booted twice each:
- U-Boot reads it as fixed slots (the squashfs is exactly 2 MiB after
  the uImage): "Found RootFS at 0x00250000", root=/dev/mtdblock3 and
  fixed mtdparts; the kernel: "hi_sfc: split NOR layout, device tree
  partitions", "root=/dev/mtdblock3 ignored", root on 31:4, login;
  rootfs_data at 0x750000 (lite) / 0xa50000 (ultimate) formatted once and
  kept (/init's .openipc-overlay marker there after the second boot).
- .github/scripts/test_sysupgrade.sh passes (split-only boards take the
  -split package by default).

After the first nightly with these packages, the stale plain
openipc.hi3516ev300-nor-{lite,ultimate}.tgz on latest should be deleted:
older cameras whose sysupgrade predates the split URL fallback would
otherwise keep installing them.

Not run on hardware.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Ship split-only NOR images for hi3516ev300

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Enable kernel firmware splitting so hi3516ev300 can use NOR space beyond fixed slots.
• Ship split-only NOR packages for lite, ultimate, dev, and glibc; leave neo unchanged.
• Preserve ultimate’s NAND package while avoiding fixed-slot images its split-capable kernel could
 misread.
Diagram

graph TD
  V["Four variants"] --> S["Split image script"] --> F["Combined firmware"] --> M["Makefile repack"] --> P["Split NOR package"] --> K["Kernel MTD split"] --> R["Root device"]
  C["Kernel config"] --> K
Loading
High-Level Assessment

Reusing the existing split-image script and packaging path is the appropriate approach. Shipping fixed and split packages together would require shrinking the kernel below the fixed-package limit; keeping fixed slots would not address the tight lite rootfs capacity. Reviewers should note that older web-UI upgrade clients cannot discover the new split-only package.

Files changed (5) +9 / -0

Enhancement (1) +5 / -0
hi3516ev300.generic.configEnable hi3516ev300 kernel partition splitting +5/-0

Enable hi3516ev300 kernel partition splitting

• Enables splitting the named firmware partition at the uImage and SquashFS boundaries, and selecting the discovered root filesystem device. This config is shared by lite, ultimate, dev, and glibc; neo uses a separate config.

br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev300.generic.config

Other (4) +4 / -0
hi3516ev300_dev_defconfigBuild split NOR images for dev +1/-0

Build split NOR images for dev

• Selects the existing split post-image script so dev produces combined firmware for a split-only NOR package.

br-ext-chip-hisilicon/configs/hi3516ev300_dev_defconfig

hi3516ev300_glibc_defconfigBuild split NOR images for glibc +1/-0

Build split NOR images for glibc

• Selects the existing split post-image script, aligning glibc images with its shared split-capable kernel configuration.

br-ext-chip-hisilicon/configs/hi3516ev300_glibc_defconfig

hi3516ev300_lite_defconfigBuild split NOR images for lite +1/-0

Build split NOR images for lite

• Selects the existing split post-image script, removing the fixed rootfs slot constraint from lite’s NOR image.

br-ext-chip-hisilicon/configs/hi3516ev300_lite_defconfig

hi3516ev300_ultimate_defconfigBuild split NOR images for ultimate +1/-0

Build split NOR images for ultimate

• Selects the existing split post-image script for ultimate’s NOR image. Its NAND filesystem configuration remains in place, so existing packaging logic still produces the NAND package.

br-ext-chip-hisilicon/configs/hi3516ev300_ultimate_defconfig

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

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Real-camera boot evidence is missing 📘 Rule violation ☼ Reliability
Description
The split NOR configuration changes the kernel partitioning and image-generation flow without
evidence from a physical camera. The PR reports only QEMU boots and explicitly says the change was
not run on hardware, so behavior on the affected Hi3516EV300 devices remains unverified.
Code

br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev300.generic.config[R895-899]

+CONFIG_MTD_ROOTFS_ROOT_DEV=y
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware"
+CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
Evidence
PR Compliance ID 3 requires hardware evidence for changes that can alter firmware behavior. The
changed kernel configuration enables split NOR partitioning and the defconfigs switch image
generation to the split post-image script, while the PR description states that testing was
performed in QEMU and not on hardware.

Rule 3: Hardware evidence is present and honest
br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev300.generic.config[895-899]
br-ext-chip-hisilicon/configs/hi3516ev300_lite_defconfig[66-66]

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 PR changes the Hi3516EV300 kernel partitioning and NOR image layout, but its verification covers only QEMU and explicitly excludes hardware testing.
## Fix Focus Areas
- br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev300.generic.config[895-899]
- br-ext-chip-hisilicon/configs/hi3516ev300_lite_defconfig[66-66]
- br-ext-chip-hisilicon/configs/hi3516ev300_ultimate_defconfig[89-89]
## Recommended Fix
Boot the affected split NOR images on a physical Hi3516EV300 camera and include before/after evidence such as kernel logs, partition detection, root filesystem selection, login, and reboot persistence for the lite and ultimate variants.

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



Remediation recommended

2. Dev and glibc cameras miss auto-upgrades ✓ Resolved
Description
default_upgrade_url routes dev and glibc to the builder repository and never applies
nor_split_url, while the new post-image hook makes their builds produce only firmware-hosted
-split.tgz NOR packages. When either variant runs an upgrade without a pinned URL or a
build/channel selection, it requests a builder URL instead of its newly produced split package and
cannot download that update.
Code

br-ext-chip-hisilicon/configs/hi3516ev300_dev_defconfig[73]

+BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh"
Evidence
The build stamps the variant as BUILD_OPTION, which sysupgrade reads as osr. Its default URL selects
firmware only for lite, ultimate, and neo, and invokes the split-URL fallback only for firmware; the
new split script creates firmware.bin, causing repack to emit only the split archive when the
fixed-package option is unset.

general/scripts/rootfs_script.sh[9-12]
general/overlay/usr/sbin/sysupgrade[3078-3080]
general/overlay/usr/sbin/sysupgrade[3094-3109]
general/overlay/usr/sbin/sysupgrade[1759-1767]
Makefile[167-199]
Makefile[374-379]
br-ext-chip-hisilicon/configs/hi3516ev300_glibc_defconfig[40-44]

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 dev and glibc variants now produce split-only NOR packages, but the default upgrade URL still routes them to builder rather than their firmware split packages.
## Fix Focus Areas
- general/overlay/usr/sbin/sysupgrade[3094-3109]
- br-ext-chip-hisilicon/configs/hi3516ev300_dev_defconfig[73-73]
- br-ext-chip-hisilicon/configs/hi3516ev300_glibc_defconfig[70-70]
## Recommended Fix
Make the default URL for these generic hi3516ev300 variants resolve to the firmware release and select the available split package. Preserve builder routing for device profiles and other variants, and add default-URL tests for both variants.

ⓘ 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 start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev300.generic.config
Comment thread br-ext-chip-hisilicon/configs/hi3516ev300_dev_defconfig
- hi3518ev300 lite and ultimate drop BR2_OPENIPC_NOR_FIXED_PACKAGE: the
  fixed-slot lite package no longer fits its 5120K rootfs slot (4 KiB
  over after today's merges), which fails the whole nightly. They ship
  the -split package only, like hi3516ev300 and hi3516cv6xx.
- sysupgrade's default_upgrade_url applied the -split fallback only for
  packages from OpenIPC/firmware. dev and glibc come from OpenIPC/builder,
  so on a split-only board they asked for a plain archive that is no
  longer built (from review). nor_split_url now applies wherever the
  archive lives; it switches only when a -split archive exists.
- test_sysupgrade.sh: a hi3516ev300 dev camera gets
  builder/.../openipc.hi3516ev300-nor-dev-split.tgz when one is
  published, the plain one otherwise. All checks pass.
@widgetii
widgetii merged commit 65ce450 into master Oct 21, 2026
141 checks passed
@widgetii
widgetii deleted the split/hi3516ev300 branch October 21, 2026 21:46
widgetii added a commit to OpenIPC/defib that referenced this pull request Oct 22, 2026
hi3516ev300's firmware now ships only the split NOR package, like
hi3516cv6xx (OpenIPC/firmware#2656): its uImage (2008K with the split
options) fills the 2 MiB slot, so a fixed-slot package cannot ship
beside a split one. hi3518ev300 went split-only in the same PR; it is
already in `NOR_SPLIT_SOCS` (#160).

- hi3516ev300 joins `NOR_SPLIT_SOCS`, so `install` writes
`firmware.bin.hi3516ev300` at 0x50000 and erases the rest of the chip;
its U-Boot is the published `u-boot-hi3516ev300-nor.bin` (split mode
since OpenIPC/u-boot#48).
- The refusal test that used hi3516ev300 as a chip without the split
layout now uses hi3518ev200. CLAUDE.md lists it.

The split package appears with the next nightly. Not run on hardware;
the firmware side was checked in qemu-hisilicon (8 MB lite, 16 MB
ultimate: root on the split rootfs, overlay kept across a reboot).
`pytest tests/ --ignore=tests/fuzz`: 1084 passed. ruff and mypy are
clean.
widgetii added a commit to OpenIPC/website that referenced this pull request Oct 23, 2026
…ex (#505)

* Builds: a plain NOR package a newer split one replaced leaves the index

The index takes, for each file name, the newest retained build that
published it, so a package the firmware stops publishing stays on offer
for the whole retention period. hi3516ev300 and hi3518ev300 lite and
ultimate ship only the split package since OpenIPC/firmware#2656. Their
last plain packages (nightlies of 2026-10-19 to 21) are still in the
index, so the wizard gives them fixed slots, and SplitOnlyEdition, which
looks for "split published, plain not", never sees them split-only. The
stale assets are gone from the latest release; the index did not notice,
because it does not read the release.

LoadIndex now leaves out a plain NOR package whose split package came
from a newer build than the plain one's newest. A board that publishes
both does so in one build and keeps both (the gk7205v200 and gk7205v500
families). An edition with no split package (hi3516ev300 neo) and a board
whose build failed, publishing neither, keep what they had.

Test: TestLoadIndexDropsPlainSupersededBySplit stores two firmware
builds, the 21st with the plain ev300 lite/ultimate, neo, gk7205v200 lite
and cv300 lite, and the 22nd with the ev300 split pair, neo and
gk7205v200 plain plus split. The ev300 plain pair is gone; split, neo,
gk7205v200's both, and cv300's from the 21st stay. It fails on the old
LoadIndex. service/run.sh test (all packages, Postgres) passes.

* Builds: a split package replaces a plain one by the query's build order

From review: two builds with one built_at rank by id in LoadIndex's query;
the split check now does the same, comparing (built_at, id). Test:
TestLoadIndexSplitSupersedesOnTiedTimestamp, two builds at one time, the
later id carrying the split package. service/run.sh test passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant