Skip to content

gk7201v200, hi3516cv200 family: the split NOR image - #2668

Merged
widgetii merged 2 commits into
masterfrom
split/gk7201v200-cv200
Oct 24, 2026
Merged

widgetii merged 2 commits into
masterfrom
split/gk7201v200-cv200

Conversation

@widgetii

Copy link
Copy Markdown
Member

Two more families on the split NOR layout. Each ships its fixed-slot package as before, plus -split (post-image-split.sh, BR2_OPENIPC_NOR_FIXED_PACKAGE=y).

Family defconfigs kernel configs kernel U-Boot
gk7201v200 gk7201v200_lite gk7201v200.generic.config OpenIPC/linux#140 OpenIPC/u-boot#61
hi3516cv200 hi3516cv200_lite, hi3518ev200_lite, hi3518ev200_ultimate, hi3518ev201_lite hi3516cv200, hi3518ev200, hi3518ev201 .generic.config OpenIPC/linux#141 OpenIPC/u-boot#61

Each kernel config turns on MTD_SPLIT_FIRMWARE (named firmware), MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT and MTD_ROOTFS_ROOT_DEV, as gk7205v500's does.

Why: on the 2026-10-22 nightly, gk7201v200 lite's rootfs grew 496K in 30 days, leaving 180K of its 5 MiB slot. hi3516cv200 lite's rootfs is 5028K of 5120K. Since #2666, a fixed-slot package that stops fitting is skipped and the board ships -split alone, instead of the build failing.

Tested in qemu-hisilicon (8 MB), with each family's lite build:

gk7201v200 hi3516cv200
uImage / squashfs / firmware.bin 1836K / 4956K / 6848K 1658K / 5028K / 6720K
split image, new U-Boot root on 31:4, login root on 31:4, login
split image, published U-Boot root=/dev/mtdblock3 ignored, 31:4 root=/dev/mtdblock3 ignored, 31:4
overlay across a power cycle kept kept
fixed-slot package cmdlinepart, 31:3 cmdlinepart, 31:3
U-Boot recovery over TFTP, from fixed slots and from a damaged kernel firmware.bin byte-identical on flash, boots split same

hi3518ev201_lite is outside the CI matrix (it builds its own toolchain) and gets the same change. Not run on hardware.

gk7201v200 lite's rootfs grew 496K in the 30 days to the 2026-10-22
nightly and has 180K left of its 5 MiB slot. The split layout lets
kernel and rootfs share one budget.

- gk7201v200.generic.config turns on MTD_SPLIT_FIRMWARE (named
  "firmware"), MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT and
  MTD_ROOTFS_ROOT_DEV, as gk7205v500.generic.config does. The kernel's
  gk7201v200 device tree has the partitions since OpenIPC/linux#140,
  and its U-Boot the split mode since OpenIPC/u-boot#61.
- gk7201v200_lite uses post-image-split.sh with
  BR2_OPENIPC_NOR_FIXED_PACKAGE=y: the fixed-slot package as before, plus
  -split.

Tested in qemu-hisilicon (gk7201v200, 8 MB) with a gk7201v200_lite build
on this kernel (uImage 1836K, squashfs 4956K, firmware.bin 6848K):
- split firmware.bin, new U-Boot: "Found RootFS at 0x00220000", "sfc: split
  NOR layout, device tree partitions", rootfs_data from 0x700000, root on
  31:4, login; a second boot on the same flash reads the seed the first
  saved in the overlay;
- the same image under the published u-boot-gk7201v200-nor.bin:
  "root=/dev/mtdblock3 ignored, the flash names its own root", root on 31:4;
- the fixed-slot package: 6 cmdlinepart partitions, root on 31:3, login;
- recovery: from fixed slots, and from a split image with one kernel byte
  flipped ("kernel at 0x50000 fails its CRC"), fwupd over TFTP writes
  firmware.bin.gk7201v200 (byte-identical on flash) and the next boot
  reaches login on 31:4.
Not run on hardware.
hi3516cv200 lite's rootfs is 5028K of its 5120K slot. The split layout
lets kernel and rootfs share one budget.

- hi3516cv200, hi3518ev200 and hi3518ev201's kernel configs turn on
  MTD_SPLIT_FIRMWARE (named "firmware"), MTD_SPLIT_UIMAGE_FW,
  MTD_SPLIT_SQUASHFS_ROOT and MTD_ROOTFS_ROOT_DEV. Their kernel
  (OpenIPC/linux hisilicon-hi3516cv200) finds the layout from its device
  tree since OpenIPC/linux#141, and their U-Boot scans it since
  OpenIPC/u-boot#61.
- hi3516cv200_lite, hi3518ev200_lite, hi3518ev200_ultimate and
  hi3518ev201_lite use post-image-split.sh with
  BR2_OPENIPC_NOR_FIXED_PACKAGE=y: the fixed-slot package as before,
  plus -split.

Tested in qemu-hisilicon (hi3516cv200, 8 MB) with hi3516cv200_lite
(uImage 1658K, squashfs 5028K, firmware.bin 6720K): split boot under the
new and the published U-Boot (root=/dev/mtdblock3 ignored), root on 31:4,
login, the overlay kept across a power cycle; the fixed-slot package on
31:3; U-Boot recovery over TFTP from fixed slots and from a damaged
kernel, byte-identical on flash. Not run on hardware.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add split NOR images for gk7201v200 and hi3516cv200 families

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Enable kernel discovery of root filesystems within split NOR firmware on two SoC families.
• Produce split images for five builds while retaining fixed-slot packages when they fit.
• Give growing root filesystems a shared firmware budget instead of a fixed slot.
Diagram

graph TD
  A["Board defconfigs"] --> B["Post-image script"] --> C["Split firmware"] --> D[("NOR flash")] --> E["MTD splitter"] --> F["Mounted root"]
  A --> G["Fixed package"]
  H["Kernel configs"] --> E
Loading
High-Level Assessment

Reuse the established split NOR post-image script and kernel options. Expanding fixed rootfs slots would require a new partition layout and would not preserve the existing conditional fixed-slot package; a family-specific image generator would duplicate existing behavior.

Files changed (9) +30 / -0

Other (9) +30 / -0
gk7201v200.generic.configEnable split firmware detection for gk7201v200 +5/-0

Enable split firmware detection for gk7201v200

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

br-ext-chip-goke/board/gk7205v500/gk7201v200.generic.config

gk7201v200_lite_defconfigProduce split and eligible fixed-slot gk7201v200 images +2/-0

Produce split and eligible fixed-slot gk7201v200 images

• Selects the existing split post-image script and requests a fixed-slot package when its components fit.

br-ext-chip-goke/configs/gk7201v200_lite_defconfig

hi3516cv200.generic.configEnable split firmware detection for hi3516cv200 +5/-0

Enable split firmware detection for hi3516cv200

• Enables firmware, uImage, and squashfs MTD splitting and automatic root-device selection.

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

hi3518ev200.generic.configEnable split firmware detection for hi3518ev200 +5/-0

Enable split firmware detection for hi3518ev200

• Enables firmware, uImage, and squashfs MTD splitting and automatic root-device selection.

br-ext-chip-hisilicon/board/hi3516cv200/hi3518ev200.generic.config

hi3518ev201.generic.configEnable split firmware detection for hi3518ev201 +5/-0

Enable split firmware detection for hi3518ev201

• Enables firmware, uImage, and squashfs MTD splitting and automatic root-device selection.

br-ext-chip-hisilicon/board/hi3516cv200/hi3518ev201.generic.config

hi3516cv200_lite_defconfigProduce split and eligible fixed-slot hi3516cv200 images +2/-0

Produce split and eligible fixed-slot hi3516cv200 images

• Selects split post-image generation while retaining conditional fixed-slot packaging.

br-ext-chip-hisilicon/configs/hi3516cv200_lite_defconfig

hi3518ev200_lite_defconfigProduce split and eligible fixed-slot hi3518ev200 lite images +2/-0

Produce split and eligible fixed-slot hi3518ev200 lite images

• Selects split post-image generation while retaining conditional fixed-slot packaging.

br-ext-chip-hisilicon/configs/hi3518ev200_lite_defconfig

hi3518ev200_ultimate_defconfigProduce split and eligible fixed-slot hi3518ev200 ultimate images +2/-0

Produce split and eligible fixed-slot hi3518ev200 ultimate images

• Selects split post-image generation while retaining conditional fixed-slot packaging.

br-ext-chip-hisilicon/configs/hi3518ev200_ultimate_defconfig

hi3518ev201_lite_defconfigProduce split and eligible fixed-slot hi3518ev201 images +2/-0

Produce split and eligible fixed-slot hi3518ev201 images

• Selects split post-image generation while retaining conditional fixed-slot packaging. This variant uses its own toolchain and was not included in the stated QEMU tests.

br-ext-chip-hisilicon/configs/hi3518ev201_lite_defconfig

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

qodo-free-for-open-source-projects Bot commented Oct 24, 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. Firmware changes lack camera evidence 📘 Rule violation ☼ Reliability
Description
The new split-NOR settings in the family kernel configurations and defconfigs alter the firmware
layout and boot behavior. The PR reports only qemu-hisilicon results and explicitly says
hi3518ev201_lite was not run on hardware, so these image changes reach camera firmware without the
required board-level boot and runtime evidence.
Code

br-ext-chip-goke/configs/gk7201v200_lite_defconfig[R72-73]

+BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh"
+BR2_OPENIPC_NOR_FIXED_PACKAGE=y
Evidence
The checklist requires real-camera evidence for changes that can alter firmware behavior. These
added defconfig settings enable the split-NOR image flow, while the PR description reports qemu-only
testing and says hi3518ev201_lite was not run on hardware.

Rule 3: Hardware evidence is present and honest
br-ext-chip-goke/configs/gk7201v200_lite_defconfig[72-73]
br-ext-chip-hisilicon/configs/hi3518ev201_lite_defconfig[67-68]

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 partitioning and boot behavior for multiple camera families, but the reported validation is limited to qemu and explicitly excludes hardware testing for `hi3518ev201_lite`.
## Fix Focus Areas
- br-ext-chip-goke/configs/gk7201v200_lite_defconfig[72-73]
- br-ext-chip-hisilicon/configs/hi3516cv200_lite_defconfig[68-69]
- br-ext-chip-hisilicon/configs/hi3518ev201_lite_defconfig[67-68]
## Recommended Fix
Test the changed split images on real cameras for each affected family, including boot, root filesystem selection, login or streaming behavior, and persistence across a reboot or power cycle, then add the observed logs or measurements to the PR description. If hardware cannot be reached, state that plainly and provide the strongest available build or self-test evidence instead of claiming hardware 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 choose which labels appear on a finding, and whether they show icons or text

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread br-ext-chip-goke/configs/gk7201v200_lite_defconfig
@widgetii
widgetii merged commit 0595485 into master Oct 24, 2026
40 of 44 checks passed
@widgetii
widgetii deleted the split/gk7201v200-cv200 branch October 24, 2026 08:01
widgetii added a commit to OpenIPC/defib that referenced this pull request Oct 24, 2026
…t layout (#164)

`CHIP_TO_FIRMWARE` has mapped gk7201v200 to gk7205v200 since #4, when
gk7201v200 had nothing published of its own. So `defib install -c
gk7201v200` wrote **gk7205v200's U-Boot and firmware** onto it.

OpenIPC now publishes gk7201v200's own builds:
- `u-boot-gk7201v200-nor.bin` and `-nand.bin` (OpenIPC/u-boot,
`xm72010200`);
- `openipc.gk7201v200-nor-lite.tgz`, built on the gk7205v500 kernel tree
with gk7201v200's own vendor modules (OpenIPC/firmware#2478).

This PR:
- **Drops the alias.** gk7201v200 takes its `-nor`/`-nand` U-Boot
(`PER_FLASH_TYPE_UBOOT`) and its own firmware.
- **Adds it to `NOR_SPLIT_SOCS`.** Its kernel finds the split layout
since OpenIPC/linux#140, its U-Boot scans it since OpenIPC/u-boot#61,
and its firmware ships `-split` beside the fixed-slot package since
OpenIPC/firmware#2668.
- **Leaves gk7201v300 alone.** It has its own U-Boot builds but no
firmware package.

Not in this PR: hi3516cv200 and hi3518ev200 also ship `-split` since
OpenIPC/firmware#2668, but defib keeps installing them on fixed slots
for now.
- Today defib gives them the old `-universal` U-Boot. Its default
environment describes the lite fixed slots, so installing the split
layout with it would break the hi3518ev200 ultimate fixed-slot install.
- Moving them to the scanning `-nor.bin` U-Boot, as #158 did for
hi3516cv300, needs a NAND U-Boot build for hi3518ev200's NAND package
and a decision on its DDR3 boards. Neither exists yet.

Tests: `test_gk7201v200_installs_its_own_build` checks there's no alias,
that gk7201v200 uses its own NOR/NAND U-Boot names, that it's
split-capable, and that it has its own package board. The per-flash-type
U-Boot list includes it too. pytest, ruff and mypy are clean.

The firmware side was checked in qemu-hisilicon (gk7201v200, 8 MB; see
OpenIPC/firmware#2668). Not run on hardware.
widgetii added a commit to OpenIPC/wiki that referenced this pull request Oct 24, 2026
They ship the split package beside the fixed-slot one since
OpenIPC/firmware#2668, on OpenIPC/linux#140 and #141 and
OpenIPC/u-boot#61. On Hi3516CV200 and Hi3518EV200 the older
-universal U-Boot 2010.06 boots the split image as well (the kernel takes
its root from the flash and ignores root=). sysupgrade -k -r takes the
split package on them, and they go back to fixed slots the same way.

Checked in qemu-hisilicon (gk7201v200 and hi3516cv200, 8 MB). Not run on
hardware.
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