Skip to content

hi3516cv300, hi3516ev100: the split NOR image, as on the gk7205v200 family - #2645

Merged
widgetii merged 1 commit into
masterfrom
split/hi3516cv300
Oct 20, 2026
Merged

widgetii merged 1 commit into
masterfrom
split/hi3516cv300

Conversation

@widgetii

Copy link
Copy Markdown
Member

hi3516cv300 lite/ultimate and hi3516ev100 lite build the split NOR image as the gk7205v200 family does: general/scripts/post-image-split.sh, BR2_OPENIPC_NOR_FIXED_PACKAGE=y (the plain fixed-slot package unchanged, plus -split), and the kernel's split options (MTD_SPLIT_FIRMWARE, MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT, MTD_ROOTFS_ROOT_DEV). neo is unchanged.

Depends on, both merged: OpenIPC/linux#127 (hisilicon-hi3516cv300: mtdsplit, DT partitions, the hisi-sfc split hook) and OpenIPC/u-boot#42 (CONFIG_OPENIPC_NOR_SPLIT for cv300/ev100). Kernel read limit left at the 2 MiB default: 8 MiB chips have a 2 MiB kernel slot.

Sizes (local builds): cv300_lite uImage 1659K, squashfs 4956K of 5120K, firmware.bin 6656K of 7616K; cv300_ultimate uImage 1659K, squashfs 6748K, firmware.bin 8448K of 15808K; ev100_lite uImage 1577K, firmware.bin 6592K.

Verified on a hi3516cv300 board (imx291, W25Q128 16 MiB, 128 MiB), after a full flash backup:

  • the split firmware.bin at 0x50000 under the board's U-Boot 2010.06 and its saved 16 MiB mtdparts: hi_sfc: split NOR layout, device tree partitions, kernel 0x50000-0x1f0000, rootfs 0x1f0000, rootfs_data 0x6d0000, root=/dev/mtdblock3 ignored, root on 31:4, login prompt; the overlay marker kept across a power cycle;
  • under OpenIPC U-Boot 2022.10 with the split mode: root-less command line, Verifying Checksum ... OK, the same split; run fwupd over TFTP rewrote it and erased the rest of the chip, and it booted again;
  • the split kernel over the original fixed-slot flash: the command line's partitions, nothing split, root on 31:3.

Also tested in qemu-hisilicon on hi3516cv300 and hi3516ev100 (8 and 16 MiB slots, both bootloaders, the fixed-slot package unchanged).

…amily

hi3516cv300_lite, hi3516cv300_ultimate and hi3516ev100_lite build
firmware.bin with general/scripts/post-image-split.sh -- the kernel's
uImage (zImage + appended hi3516cv300-demb.dtb), then the squashfs at the
next 64 KiB -- and publish it as the -split package. The kernel configs
turn on the splitters and the root from the split (MTD_SPLIT_FIRMWARE,
MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT, MTD_ROOTFS_ROOT_DEV); the
kernel (OpenIPC/linux hisilicon-hi3516cv300, the split NOR layout
commit) finds the layout from its device tree, whatever mtdparts and
root= the bootloader passes. hi3516cv300_neo keeps its own image.

Like the Goke boards, these keep shipping the plain fixed-slot package
(BR2_OPENIPC_NOR_FIXED_PACKAGE): cameras in the field upgrade from fixed
slots. Its uImage is now held a 64 KiB block under the 2 MiB slot
(1983K), which is how the kernel, U-Boot and sysupgrade tell the layouts
apart; the field kernels are about 1.6 MiB.

The kernel-read limit stays at the default 0x200000. The published
U-Boot 2010.06 reads 3 MiB from 0x50000 on either chip size, but the
fixed-slot 8 MiB layout has a 2 MiB kernel slot, so 2 MiB is what holds
on every camera.

Sizes (local builds with that kernel):
- hi3516cv300_lite: uImage 1659K (1983K slot, 2048K read), squashfs 4956K
  (5120K slot), firmware.bin 6656K of 7616K (8 MiB less 320K and a 256K
  overlay);
- hi3516cv300_ultimate: uImage 1659K, squashfs 6748K (8192K), firmware.bin
  8448K of 15808K;
- hi3516ev100_lite: uImage 1577K, squashfs 4948K, firmware.bin 6592K of
  7616K.

Tested in qemu-hisilicon (hi3516cv300; hi3516ev100, a machine added for
this) from flash: the split firmware.bin at 0x50000 under the published
U-Boot 2010.06 (its own bootcmd and mtdparts, 8 and 16 MiB) and under
OpenIPC U-Boot 2022.10 with CONFIG_OPENIPC_NOR_SPLIT -- "hi_sfc: split
NOR layout, device tree partitions", root on the split rootfs, /init's
overlay found on rootfs_data on the next boot and a file written there
kept across a reset; the plain package's uImage and rootfs under both,
in fixed slots as before.

Verified on a hi3516cv300 board (imx291, W25Q128 16 MiB, 128 MiB
DRAM), after a full flash backup:
- the split-aware kernel booted from RAM over the board's fixed-slot flash (its
  U-Boot 2010.06 env, 3072k kernel / 10240k rootfs): the command line's
  five partitions, nothing split, root on 31:3, login prompt;
- the hi3516cv300_lite split firmware.bin written at 0x50000 under the
  same U-Boot 2010.06 and its saved 16 MiB mtdparts: "hi_sfc: split NOR
  layout, device tree partitions", kernel 0x50000-0x1f0000, rootfs from
  0x1f0000, rootfs_data from 0x6d0000, "root=/dev/mtdblock3 ignored",
  root on 31:4, login prompt; /init's overlay marker (a JFFS2 inode and
  dirent ".openipc-overlay") on rootfs_data, kept across a power cycle;
- OpenIPC U-Boot 2022.10 with CONFIG_OPENIPC_NOR_SPLIT written at 0, env
  default and saved: "Found Kernel at 0x00050000", "Found RootFS at
  0x001f0000", command line "mem=32M console=ttyAMA0,115200 panic=20
  rootfstype=squashfs init=/init", the same split, root on 31:4.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Enable split NOR images for hi3516cv300 and hi3516ev100

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Build split NOR firmware for hi3516cv300 lite/ultimate and hi3516ev100 lite.
• Enable kernel partition splitting and automatic rootfs selection for the new images.
• Continue shipping fixed-slot packages for cameras upgrading from the existing layout; leave neo
 unchanged.
Diagram

graph TD
  A["Board defconfigs"] --> B["Split image script"] --> C["NOR firmware"] --> D["Package repack"]
  E["Kernel configs"] --> F["MTD splitters"] --> G["Mounted rootfs"]
  C --> F
Loading
High-Level Assessment

Reuse the established Goke split-image script and dual-package workflow. A board-specific image builder would duplicate that path, while replacing the fixed-slot package would disrupt upgrades on existing cameras. The approach depends on the stated merged kernel and U-Boot split-layout support.

Files changed (5) +16 / -0

Other (5) +16 / -0
hi3516cv300.generic.configEnable cv300 kernel NOR splitting +5/-0

Enable cv300 kernel NOR splitting

• Enables firmware, uImage, and squashfs MTD splitting and root-device selection for the hi3516cv300 kernel configuration.

br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.generic.config

hi3516ev100.generic.configEnable ev100 kernel NOR splitting +5/-0

Enable ev100 kernel NOR splitting

• Enables the corresponding MTD splitters and root-device selection for the hi3516ev100 kernel configuration.

br-ext-chip-hisilicon/board/hi3516cv300/hi3516ev100.generic.config

hi3516cv300_lite_defconfigBuild split and fixed-slot cv300 lite packages +2/-0

Build split and fixed-slot cv300 lite packages

• Selects the shared split-image post-processing script and retains the fixed-slot package for the lite build.

br-ext-chip-hisilicon/configs/hi3516cv300_lite_defconfig

hi3516cv300_ultimate_defconfigBuild split and fixed-slot cv300 ultimate packages +2/-0

Build split and fixed-slot cv300 ultimate packages

• Selects the shared split-image post-processing script and retains the fixed-slot package for the ultimate build.

br-ext-chip-hisilicon/configs/hi3516cv300_ultimate_defconfig

hi3516ev100_lite_defconfigBuild split and fixed-slot ev100 lite packages +2/-0

Build split and fixed-slot ev100 lite packages

• Selects the shared split-image post-processing script and retains the fixed-slot package for the ev100 lite build.

br-ext-chip-hisilicon/configs/hi3516ev100_lite_defconfig

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

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

@widgetii
widgetii merged commit 0d840f1 into master Oct 20, 2026
32 of 33 checks passed
@widgetii
widgetii deleted the split/hi3516cv300 branch October 20, 2026 19:47
widgetii added a commit to OpenIPC/defib that referenced this pull request Oct 21, 2026
hi3516cv300 and hi3516ev100 now ship the split NOR package
(OpenIPC/firmware#2645, on OpenIPC/linux#127), and their OpenIPC/u-boot
NOR build scans for it (OpenIPC/u-boot#42). Both join `NOR_SPLIT_SOCS`:
one `firmware.bin.<soc>` at 0x50000, the rest of the chip erased.

- Their U-Boot comes from OpenIPC/u-boot as `u-boot-<soc>-nor.bin` (plus
`-nand.bin` for cv300), so they move from `AVAILABLE_FIRMWARE` to
`PER_FLASH_TYPE_UBOOT`. The `u-boot-*-universal.bin` still on the
release is the U-Boot 2010.06 build, which knows no split layout.
- hi3516ev100 publishes no NAND build: the new `NOR_ONLY_UBOOT` makes
asking for one find none, not a URL that 404s.
- Tests that used hi3516cv300 as their example of a universal image or
of the legacy NAND layout now use hi3516cv200. CLAUDE.md lists the two
SoCs.

**Verified end to end on a hi3516cv300 board** (imx291, W25Q128, 128
MiB), after a full flash backup:
```
defib install -c hi3516cv300 --firmware openipc.hi3516cv300-nor-lite-split.tgz \
  --uboot u-boot-hi3516cv300-nor.bin -p /dev/ttyUSB0 --power-cycle --poe-port ether3 ...
```
U-Boot at 0 (flash CRC 9507112D), firmware.bin at 0x50000 with
0x50000+0xFB0000 erased (flash CRC BD92A6E5), default env with the
factory ethaddr restored. The next boot showed `Found Kernel at
0x00050000`, `Found RootFS at 0x001f0000`, `Verifying Checksum ... OK`,
`hi_sfc: split NOR layout, device tree partitions`, root on 31:4, then
the login prompt.

The install used local artifacts. The
`u-boot-hi3516{cv300,ev100}-nor.bin` on the release predate
OpenIPC/u-boot#42 and the split packages come with the next nightly, so
the download path works once both are published.

`pytest tests/ --ignore=tests/fuzz`: 1082 passed. ruff and mypy are
clean.
widgetii added a commit to OpenIPC/website that referenced this pull request Oct 22, 2026
…yout (#491)

* Catalogue: hi3516ev300 on the split NOR layout, edition by edition

hi3516ev300's lite and ultimate builds now ship only the split NOR
package (OpenIPC/firmware split/hi3516ev300): its kernel fills the 2 MiB
slot, so no fixed-slot package can ship beside a split one. neo keeps
its own fixed-slot build.

nor_split, without nor_split_only: SplitOnlyEdition then takes the split
package for every edition that has one and no plain package, and keeps
neo on fixed slots; nor_split_only would have dropped neo from the
installer. That needs the stale plain openipc.hi3516ev300-nor-
{lite,ultimate}.tgz gone from the release once the split packages
publish; until then the site keeps offering them as fixed slots, as
today.

Tests: the fixture release index is moved to that state (the two
-split packages in, the plain lite/ultimate out; neo kept), and the
golden regenerated: hi3516ev300 still offers nor lite, ultimate, neo and
nand ultimate, lite and ultimate as split images. The two firmware
tests and the wizard test that used hi3516ev300 as a fixed-slot NOR SoC
use hi3516ev200 (same bootloaders and NAND layout, fixed slots kept).
go test ./... passes.

* Catalogue: hi3516cv300, hi3516ev100, hi3516ev200, hi3518ev300, hi3516dv200 on the split NOR layout

They ship -split packages since OpenIPC/firmware#2645, #2655 and #2656
(hi3518ev300 split-only, like hi3516ev300); nor_split lets each edition
use its split package where no plain one is published, and keeps the
fixed-slot one where it is. go test ./... (uncached) passes.

* Catalogue: hi3516cv300 and hi3516ev100 install their -nor U-Boot

From review: their bootloader was still the -universal U-Boot 2010.06,
which does not scan the NOR layout, so the wizard never gave them the
split install (scansLayout) and fell back to fixed slots. They take
u-boot-<soc>-nor.bin (OpenIPC/u-boot 2022.10, scanning; cv300 also
-nand.bin), as defib does since OpenIPC/defib#158. The test index lists
those images, the boards reference names them, the golden is
regenerated for the two SoCs, and the test that used hi3516cv300 as its
-universal example uses hi3516cv200. go test ./... (uncached) passes.
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