Skip to content

nor: split layout on gk7201v200 and the hi3516cv200 family - #61

Merged
widgetii merged 2 commits into
openipc-hisiliconfrom
nor/split-gk7201v200-cv200
Oct 24, 2026
Merged

widgetii merged 2 commits into
openipc-hisiliconfrom
nor/split-gk7201v200-cv200

Conversation

@widgetii

Copy link
Copy Markdown
Member

CONFIG_OPENIPC_NOR_SPLIT for two more families whose kernels now find the split NOR layout from their device tree:

SoC U-Boot config kernel
gk7201v200 xm72010200_config (named by gk7201v200_config) OpenIPC/linux#140 (goke-gk7205v500, ARCH_XM72050200)
hi3516cv200, hi3518ev200 (hi3518ev201 boots the hi3518ev200 image) hi3516cv200_config, hi3518ev200_config OpenIPC/linux#141 (hisilicon-hi3516cv200)

In both boards' misc_init_r(), verify=n is now set before openipc_helper(), as #52 did for xm720xxx and xm72050500. The scan can then clear it for a split image, and bootm checks the uImage CRC. Fixed-slot cameras boot as before. The gk7201v200 NAND build compiles the split code out.

NOR images: u-boot-gk7201v200-nor.bin 213729 bytes, u-boot-hi3516cv200-nor.bin 140376, u-boot-hi3518ev200-nor.bin 140488, all inside the 256K boot area.

Tested in qemu-hisilicon with each family's lite build on its new kernel (gk7201v200 and hi3516cv200, 8 MB):

Case Result, on both
split firmware.bin, this U-Boot scan finds the squashfs at the next block, root-less command line, kernel's split, root on 31:4, login
same flash, second boot overlay kept (the seed the first boot saved is read)
fixed-slot package, this U-Boot fixed mtdparts, root on 31:3, login
run fwupd over TFTP from fixed slots firmware.bin.<soc> written at 0x50000, chip erased to the end, byte-identical on flash, next boot split
split image with one kernel byte flipped Firmware is absent/corrupt (kernel at 0x50000 fails its CRC), then the same recovery

Not run on hardware.

CONFIG_OPENIPC_NOR_SPLIT for xm72010200_config, which gk7201v200_config
names, now that its kernel (OpenIPC/linux goke-gk7205v500, ARCH_XM72050200)
finds the split layout from its device tree. misc_init_r() sets verify=n
before openipc_helper(), as #52 did for xm720xxx and xm72050500, so a
split image's uImage CRC is checked by bootm.

NOR image: u-boot-gk7201v200-nor.bin 213729 bytes, inside the 256K boot
area; the NAND build compiles the split code out.

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.
CONFIG_OPENIPC_NOR_SPLIT for hi3516cv200 and hi3518ev200 (hi3518ev201
boots the hi3518ev200 image), whose kernel (OpenIPC/linux
hisilicon-hi3516cv200) finds the split layout from its device tree.
misc_init_r() sets verify=n before openipc_helper(), so the scan can
clear it for a split image and bootm checks the uImage CRC.

NOR images: u-boot-hi3516cv200-nor.bin 140376 bytes,
u-boot-hi3518ev200-nor.bin 140488 bytes.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Enable split NOR layout for gk7201v200 and hi3516cv200-family boards

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Enable split NOR detection for gk7201v200, hi3516cv200, and hi3518ev200 builds.
• Set the legacy verification default before scanning, so split images receive kernel CRC checks.
• Preserve fixed-slot boot behavior while supported kernels derive split partitions from their
 device trees.
Diagram

graph TD
  A["NOR configs"] --> B["Board init"] --> C["NOR scan"] --> D{"Split image?"}
  D -->|yes| E["Kernel CRC"] --> F["DT partitions"]
  D -->|no| G["Fixed slots"]
Loading
High-Level Assessment

Enabling the existing split-NOR path in these build configurations and following the established board initialization order is the narrowest approach. Moving the verification default into the shared helper would affect more boards without a demonstrated need.

Files changed (5) +16 / -2

Enhancement (2) +4 / -2
board.cSet verification default before the HiSilicon NOR scan +2/-1

Set verification default before the HiSilicon NOR scan

• Moves verify=n ahead of openipc_helper() and documents the ordering. The shared board code serves the hi3516cv200 and hi3518ev200 configurations.

board/hisilicon/hi3518ev200/board.c

board.cSet verification default before the XM72010200 NOR scan +2/-1

Set verification default before the XM72010200 NOR scan

• Moves verify=n from later in misc_init_r() to before openipc_helper(), allowing a detected split image to clear it for CRC verification.

board/xmedia/xm72010200/board.c

Other (3) +12 / -0
hi3516cv200_configEnable split NOR support for hi3516cv200 +4/-0

Enable split NOR support for hi3516cv200

• Enables CONFIG_OPENIPC_NOR_SPLIT for the hi3516cv200 build and records its device-tree partition dependency.

openipc/hi3516cv200_config

hi3518ev200_configEnable split NOR support for hi3518ev200 +4/-0

Enable split NOR support for hi3518ev200

• Enables CONFIG_OPENIPC_NOR_SPLIT for the hi3518ev200 build, which uses the same kernel family for split partition discovery.

openipc/hi3518ev200_config

xm72010200_configEnable split NOR support for XM72010200 +4/-0

Enable split NOR support for XM72010200

• Enables CONFIG_OPENIPC_NOR_SPLIT for the configuration used by the gk7201v200 build and records its kernel dependency.

openipc/xm72010200_config

@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 (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Goke builds cannot include split support 🐞 Bug ≡ Correctness
Description
The new split setting is in openipc/xm72010200_config, but build_xmedia() reads
openipc/gk7201v200_config for the Goke target, and that file is absent. Running `./build.sh
gk7201v200` therefore fails before it can produce a NOR image with the new setting.
Code

openipc/xm72010200_config[14]

+CONFIG_OPENIPC_NOR_SPLIT=y
Evidence
The changed XMedia fragment contains the new setting, but the Goke build case passes the SoC name as
the configuration name. build_xmedia() then constructs a Goke-named configuration path rather than
reading the changed fragment; the repository has no file at that path.

openipc/xm72010200_config[11-14]
build.sh[201-217]
build.sh[285-287]

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 new split setting cannot reach the advertised Goke NOR image because the repository build selects missing Goke-named inputs instead of the XMedia inputs.
## Fix Focus Areas
- build.sh[201-217]
- build.sh[285-287]
- openipc/xm72010200_config[11-14]
## Recommended Fix
Map `gk7201v200` to the existing XMedia configuration and register-table inputs in the build path, while retaining the Goke SoC name for the output and firmware filename. Verify that `./build.sh gk7201v200` produces a NOR image with split support enabled.

ⓘ 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 openipc/xm72010200_config
@widgetii
widgetii merged commit b1e0950 into openipc-hisilicon Oct 24, 2026
74 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant