Skip to content

gk7205v200: ship V4 modules from openhisilicon + fix load_goke -r#2085

Merged
widgetii merged 8 commits into
masterfrom
feat/v4-goke-open-modules
May 10, 2026
Merged

gk7205v200: ship V4 modules from openhisilicon + fix load_goke -r#2085
widgetii merged 8 commits into
masterfrom
feat/v4-goke-open-modules

Conversation

@widgetii

Copy link
Copy Markdown
Member

Summary

  • Bump HISILICON_OPENSDK_VERSION from 4a2781b to 370c321 to pull in Build all V4 kernel modules from source for gk7205v300 too openhisilicon#93. That PR completes the gk7205v200/v300 path:

    • The platform-driver of_match_table compat strings are now chiparch-dispatched (PLATFORM_NAME "," HISI_PRX "X"), so they expand to goke,X on goke device trees and hisilicon,hisi-X on HiSi DTs. Without this, AENC_Init dereferenced a NULL func table from a never-registered sys module on gk7205v300.
    • V4 vendor binary blobs are organized under per-chiparch subdirs with three side-by-side variants:
      • kernel/<mod>/hi3516ev200/<mod>.o — HiSi Hi3516EV200_SDK_V1.0.1.2 (Oct 2019, only HiSi flavour ever shipped pre-built; matches OpenIPC's HiSi-vintage libmpi.so)
      • kernel/<mod>/gk7205v200/<mod>_log.o — Goke SPC030 ko_log (Aug 2021, opt-in debug)
      • kernel/<mod>/gk7205v200/<mod>_nolog.o — Goke SPC030 ko_nolog (Aug 2021, default for goke; ~30% smaller, fits the gk7205v300 lite 5 MB rootfs cap)
    • KO_LOG=log|nolog selects between Goke flavours; kernel/Kbuild defaults to nolog for gk7205v200 and silently ignores KO_LOG on hi3516ev200 (only one variant exists there).
  • Fix load_goke -r to rmmod by actual in-kernel module name. openhisilicon's wrapper sets PREFIX = open_ so every module's internal name is open_<mod> regardless of the on-disk filename being gk7205v200_<mod>.ko (renamed at install time by hisilicon-opensdk to satisfy vendor load_goke's insmod-by-filename pattern). insmod takes the filename — already correct. rmmod takes the kernel's module name, so rmmod gk7205v200_<mod> was a silent no-op against any post-hisilicon-cv200: build 18 sensor drivers from openhisilicon source #2042-style openhisilicon install. Switching all remove_ko / remove_audio / remove_detect rmmods to open_<mod> fixes that.

Net effect on gk7205v300 lite boards:

  • lsmod shows the full 22-module open_* set with clean GPL taint (no more P from vendor gk7205v200_*.ko blobs).
  • load_goke -r (and -a which calls it first) actually unloads modules instead of being a no-op.
  • /image.jpg returns valid 1920×1080 JPEGs sustained — verified live on the lab gk7205v300 (10.216.128.32, imx335) running this stack.

Net effect on hi3516ev200/ev300 boards: byte-identical kernel-module content to current master. The kernel/<mod>/hi3516ev200/<mod>.o blob is the same HiSi V1.0.1.2 file moved into a chiparch subdir; KO_LOG_SUFFIX resolves to empty for that chiparch. CI's Build SDK (hi3516ev200, hi3516ev200_lite) confirms the dispatch still produces a valid module set.

Test plan

  • CI green on Build all V4 kernel modules from source for gk7205v300 too openhisilicon#93 (all 8 SDK builds + 8 QEMU smoke tests + 3 library jobs)
  • CI green on this firmware PR — let CI rebuild gk7205v300_lite and hi3516ev300_lite at least
  • gk7205v300 lab camera (10.216.128.32) boots master+a993c5a (cached known-good with goke-only aliases) → /image.jpg = 73 kB, taint G+P
  • Re-flash gk7205v300 with the firmware tarball CI builds from this PR — should boot to taint G+OOT, no P, image streams
  • Re-flash hi3516ev300 (10.216.128.68) with this PR's firmware — confirm regression-free against master+8d91335 (its current state)
  • load_goke -a round-trips cleanly: lsmod | grep open_ empty after -r, full set after -i

🤖 Generated with Claude Code

widgetii added 8 commits May 9, 2026 15:15
ev300 cameras run the full open_* module set (lsmod tainted G);
gk7205v300 still loads 21 vendor gk7205v200_*.ko blobs out of
goke-osdrv (lsmod tainted P). The two SoCs are pin-compatible
(CLAUDE.md: "Same source compiles for both via different CHIPARCH
values") and Goke firmware has been running the same SDK source
for years.

Fix in two places:

1. Bump openhisilicon pin to consume openhisilicon#92, which opens
   the kernel/Kbuild gate so the V4 heavy module set
   (acodec, adec, aenc, ai, aio, ao, base, chnl, h264e, h265e,
   ive, jpege, rc, rgn, sys, vedu, venc, vgs, vi, vpss) builds
   for gk7205v200 too. (Pin set to the unmerged-branch HEAD
   3647333 for hardware verification; will rebump to canonical
   main hash post-merge.)

2. Add a gk7205v200 INSTALL_TARGET_CMDS branch in
   hisilicon-opensdk.mk that installs the resulting open_*.ko
   under /lib/modules/<kver>/goke/ with the gk7205v200_<mod>.ko
   filenames load_goke already insmods. Peripherals (open_osal,
   open_isp, open_mipi_rx, open_sys_config, etc.) keep open_
   names in /lib/modules/<kver>/extra/ — load_goke's
   `modprobe open_<mod>` calls already find them there.

3. Drop the vendor blob INSTALL lines from
   goke-osdrv-gk7205v200.mk so the source-built versions take
   over cleanly. The dir creation stays so the package is
   self-sufficient if opensdk is disabled.

Verified on real hardware (openipc-gk7205v300.dlab.doty.ru):
TBD post-build-one + sysupgrade.
Build-one for gk7205v300_lite failed with "size exceeded by: 916KB"
because the kernel-module default install drops every open_*.ko
the SDK builds into /lib/modules/<kver>/extra/, AND our new
INSTALL_TARGET_CMDS branch copies the heavy ones renamed into
/lib/modules/<kver>/goke/gk7205v200_*.ko. Two copies of every
heavy module → ~900KB over the NOR rootfs limit.

Add a goke-specific FINALIZE hook that mirrors the existing
hisilicon-side cleanup: for the heavy module set
(acodec ... vpss, the same 20 modules our INSTALL renames), remove
the source-named extra/open_*.ko copies after install. Peripherals
(osal, isp, mipi_rx, sys_config, sensor_*, pwm, wdt, piris, hwrng,
adc) stay in extra/ — load_goke uses `modprobe open_<mod>` to find
them there.
Pulls in openhisilicon's V4 module blobs swapped for goke nolog
versions, saving ~816KB on disk so gk7205v300_lite fits the
5120KB rootfs partition.
Bump HISILICON_OPENSDK_VERSION from 4a2781b to 370c321 (OpenIPC/openhisilicon#93,
squash-merged today): adds the chiparch-aware platform_driver compat string
dispatch (so `goke,sys` etc. bind on gk7205v300 device trees instead of the
hardcoded `hisilicon,hisi-X` that pre-dated the fix and crashed AENC_Init), and
introduces the 3-variant V4 vendor blob layout — HiSi V1.0.1.2 for ev200/ev300,
Goke SPC030 ko_log/ko_nolog for gk7205v200/v300, selected automatically per
chiparch via KO_LOG. The gk7205v300 lite firmware ends up with the Goke
ko_nolog flavour, which fits the 5 MB rootfs cap.

Fix `load_goke -r` to rmmod by the actual in-kernel module name instead of
the on-disk filename. openhisilicon's wrapper modules register internally as
`open_<mod>` (set by `PREFIX = open_` in `kernel/Kbuild`), regardless of the
fact that hisilicon-opensdk's install pass renames the .ko file to
`gk7205v200_<mod>.ko` so vendor-style insmod-by-filename keeps working. insmod
uses the filename and works. rmmod takes the kernel's module name and silently
no-ops with "No such file or directory" if you pass `gk7205v200_<mod>` against
an openhisilicon-built kernel — every `rmmod` in remove_ko / remove_audio /
remove_detect was a no-op against the post-#2042+#93 install layout.

Net effect: gk7205v300 boards now boot the open_* set with a clean GPL taint
flag and `load_goke -r` actually unloads them in reverse order. ev300 path
unchanged byte-for-byte (HiSi V1.0.1.2 blobs were the only HiSi side flavour
ever released and openhisilicon now keeps them under `kernel/<mod>/hi3516ev200/`).
@widgetii widgetii merged commit 1be1b6c into master May 10, 2026
95 checks passed
@widgetii widgetii deleted the feat/v4-goke-open-modules branch May 10, 2026 12:35
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