Skip to content

hi3516ev200, hi3518ev300, hi3516dv200: the split NOR image, as on gk7205v200 - #2655

Merged
widgetii merged 1 commit into
masterfrom
split/hi3516ev200
Oct 21, 2026
Merged

widgetii merged 1 commit into
masterfrom
split/hi3516ev200

Conversation

@widgetii

Copy link
Copy Markdown
Member

Their lite images sit within a few KiB of the fixed slots (rootfs 5084K, 5112K and 4808K of 5120K). The split layout lets kernel and rootfs share one budget.

  • Lite and ultimate use general/scripts/post-image-split.sh with BR2_OPENIPC_NOR_FIXED_PACKAGE=y: the fixed-slot package as before, plus -split.
  • Kernel configs: MTD_SPLIT_FIRMWARE (named "firmware"), MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT, MTD_ROOTFS_ROOT_DEV (hi3516ev200 family: the split NOR layout, from the device tree linux#131). Their U-Boot scans for the layout since nor: split layout on the hi3516ev200 family u-boot#48.
  • Makefile fix: the split branch closed only after the UBI and initramfs packaging, so a NOR+NAND build (ultimate, BR2_TARGET_ROOTFS_UBI) shipping firmware.bin would have lost its NAND package. Those now run whichever NOR layout the build ships. No split board had a UBI rootfs before, so nothing published changes.
  • hi3516ev300 stays as it is: with the split options its uImage is 2009K, over the 1983K a fixed-slot package beside a split one may use (a uImage ending in the slot's last block reads as split). It needs a smaller kernel, or -split only, first. neo, dev and glibc are unchanged.

Built locally:

  • hi3516ev200_lite: uImage 1785K/1983K, squashfs 5084K/5120K, firmware.bin 6912K/7616K; -lite.tgz and -lite-split.tgz.
  • hi3516ev200_ultimate: firmware.bin 9024K/15808K, rootfs.ubi 16256K/24576K; nand-ultimate (as on latest), nor-ultimate and nor-ultimate-split.
  • hi3518ev300_lite: uImage 1877K, squashfs 5112K, firmware.bin 7040K.

Tested in qemu-hisilicon (hi3516ev200, hi3518ev300; 8 and 16 MB):

  • split firmware.bin under the new U-Boot: Found RootFS at 0x00210000, root-less command line, hi_sfc: split NOR layout, device tree partitions, root on 31:4; the overlay marker kept across a reset;
  • the same under the published u-boot-hi3516ev200-nor.bin: its fixed mtdparts and root=/dev/mtdblock3 ignored, the same split;
  • the fixed-slot package (8 MB lite, 16 MB ultimate at 0x350000) under both: the command line's partitions, root on 31:3.

Not run on hardware.

…205v200

Their lite images sit within a few KiB of the fixed slots (rootfs 5084K,
5112K and 4808K of 5120K). The split layout lets kernel and rootfs share
one budget. Lite and ultimate use general/scripts/post-image-split.sh with
BR2_OPENIPC_NOR_FIXED_PACKAGE=y: the fixed-slot package as before, plus
-split. The kernel configs turn on MTD_SPLIT_FIRMWARE (named "firmware"),
MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT and MTD_ROOTFS_ROOT_DEV
(OpenIPC/linux#131; their U-Boot scans for it since OpenIPC/u-boot#48).

Makefile: the split branch closed only after the UBI and initramfs
packaging, so a NOR+NAND build (ultimate, BR2_TARGET_ROOTFS_UBI) shipping
firmware.bin lost its NAND package. Those now run whichever NOR layout the
build ships. No split board had a UBI rootfs before.

hi3516ev300 is left as it is: its uImage is 2009K with the split options,
over the 1983K a fixed-slot package beside a split one may use (a uImage
ending in the slot's last block reads as split). It needs a smaller
kernel, or to ship -split only, first. neo, dev and glibc are unchanged.

Built locally with the kernel branch:
- hi3516ev200_lite: uImage 1785K/1983K, squashfs 5084K/5120K,
  firmware.bin 6912K/7616K; -lite.tgz and -lite-split.tgz.
- hi3516ev200_ultimate: firmware.bin 9024K/15808K, rootfs.ubi
  16256K/24576K; nand-ultimate (fitImage, rootfs.ubifs, rootfs.ubi, as on
  latest), nor-ultimate and nor-ultimate-split.
- hi3518ev300_lite: uImage 1877K, squashfs 5112K, firmware.bin 7040K.

Tested in qemu-hisilicon (hi3516ev200, hi3518ev300; 8 and 16 MB):
- the split firmware.bin under the new U-Boot: "Found RootFS at
  0x00210000", root-less command line, "hi_sfc: split NOR layout, device
  tree partitions", root on 31:4; /init's overlay marker on rootfs_data
  kept across a reset;
- the same under the published u-boot-hi3516ev200-nor.bin: its fixed
  mtdparts and root=/dev/mtdblock3 ignored, the same split;
- the fixed-slot package (8 MB lite, 16 MB ultimate at 0x350000) under
  both: the command line's partitions, root on 31:3.
Not run on hardware.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add split NOR packages for three HiSilicon SoCs

✨ Enhancement 🐞 Bug fix ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add split NOR images alongside fixed-slot packages, giving near-full root filesystems a shared
 kernel and rootfs budget.
• Enable kernel MTD partition splitting for hi3516ev200, hi3518ev300, and hi3516dv200.
• Preserve NAND packaging when a build also produces a split NOR image.
Diagram

graph TD
  Configs["HiSilicon defconfigs"] --> Script["Split image script"] --> Image["firmware.bin"] --> Repack["Make repack"] --> Split["Split NOR package"]
  Image --> Kernel["MTD split support"]
  Repack --> Fixed["Fixed NOR package"]
  Repack --> NAND["NAND package"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Ship split NOR packages only
  • ➕ Avoids the fixed-slot kernel size constraint and duplicate NOR packages.
  • ➖ Removes the existing fixed-slot package path for deployed cameras and older upgrade tooling.

Recommendation: Keep both NOR layouts for these boards: the split package provides headroom while the fixed-slot package preserves the existing upgrade path. Retain the kernel-size guard required to distinguish the layouts, and defer boards that cannot meet it.

Files changed (9) +28 / -1

Enhancement (5) +10 / -0
hi3516dv200_lite_defconfigProduce fixed and split NOR packages for hi3516dv200 lite +2/-0

Produce fixed and split NOR packages for hi3516dv200 lite

• Selects the existing split post-image script and keeps fixed-slot NOR packaging enabled.

br-ext-chip-hisilicon/configs/hi3516dv200_lite_defconfig

hi3516ev200_lite_defconfigProduce fixed and split NOR packages for hi3516ev200 lite +2/-0

Produce fixed and split NOR packages for hi3516ev200 lite

• Selects the existing split post-image script and keeps fixed-slot NOR packaging enabled.

br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig

hi3516ev200_ultimate_defconfigProduce fixed and split NOR packages for hi3516ev200 ultimate +2/-0

Produce fixed and split NOR packages for hi3516ev200 ultimate

• Selects the split post-image script while retaining fixed-slot NOR packaging. Its UBI rootfs also exercises the corrected NAND packaging path.

br-ext-chip-hisilicon/configs/hi3516ev200_ultimate_defconfig

hi3518ev300_lite_defconfigProduce fixed and split NOR packages for hi3518ev300 lite +2/-0

Produce fixed and split NOR packages for hi3518ev300 lite

• Selects the existing split post-image script and keeps fixed-slot NOR packaging enabled.

br-ext-chip-hisilicon/configs/hi3518ev300_lite_defconfig

hi3518ev300_ultimate_defconfigProduce fixed and split NOR packages for hi3518ev300 ultimate +2/-0

Produce fixed and split NOR packages for hi3518ev300 ultimate

• Selects the existing split post-image script and keeps fixed-slot NOR packaging enabled.

br-ext-chip-hisilicon/configs/hi3518ev300_ultimate_defconfig

Bug fix (1) +3 / -1
MakefileRun NAND and initramfs packaging after NOR layout selection +3/-1

Run NAND and initramfs packaging after NOR layout selection

• Closes the split-versus-fixed NOR conditional before UBI and initramfs packaging. Combined NOR+NAND builds can now produce their NAND archive even when firmware.bin selects the split NOR path.

Makefile

Other (3) +15 / -0
hi3516dv200.generic.configEnable firmware partition splitting for hi3516dv200 +5/-0

Enable firmware partition splitting for hi3516dv200

• Enables MTD splitting of the named firmware partition into uImage and squashfs partitions and automatic root device selection.

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

hi3516ev200.generic.configEnable firmware partition splitting for hi3516ev200 +5/-0

Enable firmware partition splitting for hi3516ev200

• Enables MTD splitting of the named firmware partition into uImage and squashfs partitions and automatic root device selection.

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

hi3518ev300.generic.configEnable firmware partition splitting for hi3518ev300 +5/-0

Enable firmware partition splitting for hi3518ev300

• Enables MTD splitting of the named firmware partition into uImage and squashfs partitions and automatic root device selection.

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

@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. Camera boot behavior lacks hardware proof 📘 Rule violation ☼ Reliability
Description
The added split-NOR post-image settings and kernel partition options change the firmware layout and
boot behavior for the HiSilicon boards. The PR states that testing was not run on hardware, so these
image changes have only emulator and build evidence for real-camera operation.
Code

br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig[R66-67]

+BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh"
+BR2_OPENIPC_NOR_FIXED_PACKAGE=y
Evidence
The checklist requires hardware evidence for any PR that can change firmware behavior and explicitly
fails changes whose description states they were not tested on hardware. These changed defconfig and
kernel settings select the split post-image script and enable split NOR/rootfs partition handling,
so the PR changes what the firmware does on the affected cameras.

Rule 3: Hardware evidence is present and honest
br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig[66-67]
br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev200.generic.config[893-897]

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 NOR image packaging and kernel MTD partition behavior, but explicitly reports that it was not tested on hardware. Compliance requires affected boards to have real-camera evidence showing the relevant boot symptom and before/after output.
## Fix Focus Areas
- br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig[66-67]
- br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev200.generic.config[893-897]
## Recommended Fix
Test the changed firmware on the affected Hi3516EV200, Hi3518EV300, and Hi3516DV200 hardware where available, and update the PR description with board-specific before/after boot logs or measurements covering NOR partition discovery, root filesystem selection, and successful boot. If hardware cannot be reached, state that plainly and provide the strongest permitted non-hardware evidence without claiming camera verification.

ⓘ 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/configs/hi3516ev200_lite_defconfig
@widgetii
widgetii merged commit f4b87e7 into master Oct 21, 2026
146 of 150 checks passed
@widgetii
widgetii deleted the split/hi3516ev200 branch October 21, 2026 14:34
widgetii added a commit to OpenIPC/defib that referenced this pull request Oct 21, 2026
…dv200 (#160)

Their firmware now ships the split NOR package beside the fixed-slot one
(OpenIPC/firmware#2655, on OpenIPC/linux#131), and their OpenIPC/u-boot
NOR build scans for it (OpenIPC/u-boot#48), so they join
`NOR_SPLIT_SOCS`: one `firmware.bin.<soc>` at 0x50000, the rest of the
chip erased. They already take `u-boot-<soc>-nor.bin`
(`PER_FLASH_TYPE_UBOOT`).

hi3516ev300 stays on fixed slots: its uImage (2009K with the split
options) fills the 2 MiB slot, over the 1983K a fixed-slot package
beside a split one may use, so its firmware ships no split package. A
test keeps it out even though its profile is an alias of hi3516ev200.

The split package appears with the next nightly. Until the U-Boot
publish workflow runs again, the published `u-boot-<soc>-nor.bin`
predates #48: the split image still boots under it (the kernel ignores
its fixed mtdparts, checked in QEMU), but its scan and `fwupd` for the
split image come with the republished build.

Not run on hardware; the firmware side was checked in qemu-hisilicon
(hi3516ev200, hi3518ev300; 8 and 16 MB). `pytest tests/
--ignore=tests/fuzz`: 1084 passed. ruff and mypy are clean.
widgetii added a commit to OpenIPC/wiki that referenced this pull request Oct 23, 2026
* nor-split: the Hi3516EV200 family, Hi3516EV300 split-only

- nor-split-layout: Hi3516EV200, Hi3518EV300 and Hi3516DV200 ship the
  split package beside the fixed-slot one (OpenIPC/firmware#2655, on
  OpenIPC/linux#131 and OpenIPC/u-boot#48); Hi3516EV300 lite and
  ultimate ship the split package only, its kernel filling the 2 MiB
  kernel slot (neo keeps fixed slots). Going back to fixed slots lists
  them accordingly.
- sysupgrade: `sysupgrade -k -r` installs the split layout on them.

Checked in qemu-hisilicon (hi3516ev200, hi3518ev300, hi3516ev300; 8 and
16 MB). Not run on hardware.

* nor-split: the GK7205V500 family

GK7205V500 ships the split package beside the fixed-slot one
(OpenIPC/firmware#2658, on OpenIPC/linux#137 and OpenIPC/u-boot#52).
GK7205V510 and GK7205V530 install that one gk7205v500 build, as defib
(OpenIPC/defib#163) and the site's installer do. Each keeps its own
u-boot-<soc>-nor.bin. sysupgrade -k -r takes the split package on them
too, and they go back to fixed slots the same way.

Checked in qemu-hisilicon (gk7205v500 8 and 16 MB, gk7205v510/v530
16 MB). Not run on hardware.

* sysupgrade: the split list is for NOR cameras, and Hi3516EV300 lite and ultimate

From review: the list of SoCs whose sysupgrade -k -r installs the split
package now says it is about NOR flash, and points NAND cameras to their
own layout page. Hi3516EV300 is listed for lite and ultimate only: neo
keeps fixed slots, as the layout page says.
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