hi3516cv6xx: convert to ultimate variant + wire opensdk source build#2172
Merged
Conversation
PR #2167 added cv6xx_lite (8 MB) with prebuilt vendor `ot_*.ko` modules. PR #2170 disabled CONFIG_IO_STRICT_DEVMEM so the modules would actually attempt to init, which exposed an init-time hang at `mmz_start: 0x42e00000` — the vendor blobs were built against a kernel config / vermagic that doesn't match openipc/linux 5.10.221. This switches cv6xx from "ship prebuilt vendor blobs" to "rebuild from source against the openipc kernel via hisilicon-opensdk", and converts the (broken-at-8-MB) lite defconfig to a proper 16 MB ultimate variant. Companion to OpenIPC/openhisilicon#202 (merged as b1c4dae5) which adds the V5 SoC family — 42 open_*.ko kernel modules covering osal, mmz, sys_config, base, vb, vca, sys, rgn, vpp, vgs, vpss, vi, isp, chnl, rc, venc, h264e, h265e, svac3e, jpege, svp_npu, ive, aiisp, pm, uvc, devstat, user_proc, audio (aio/ai/ao/aenc/adec/acodec), mipi_rx, sensor_i2c, sensor_spi, pwm, piris, wdt, adc, spi_dma_transfer, user + 6 sensor source ports (gc4023, os04d10, sc4336p, sc431hai, sc450ai, sc500ai) cross-compiled to libsns_*.so. Validated end-to-end on a Hi3516CV610 demo board (sc4336p sensor): * S70vendor reaches past `mmz_start: 0x42e00000` cleanly * 42 `open_*.ko` load via `load_hisilicon` from /lib/modules/5.10.221/hisilicon/ * /proc/umap exposes 30 vendor MPP chardevs * sensor I2C/SPI probe path reaches the bus * majestic links against the curated vendor MPP lib set ### hi3516cv6xx_ultimate_defconfig (renamed from _lite_defconfig) `git mv` preserves history. Net changes: * VARIANT lite→ultimate, FLASH_SIZE 8→16 * OPENIPC_MAJESTIC left at default ("lite") — only the lite-flavored cv6xx majestic binary has been published to OpenIPC S3 so far * Ultimate package set mirroring hi3516ev300_ultimate: AWS_WEBRTC, DIVINUS, EXFATPROGS+EXFAT_OPENIPC, IPTABLES, LAME_OPENIPC, LIBWEBSOCKETS_OPENIPC, MAJESTIC+MAJESTIC_FONTS+MAJESTIC_WEBUI, MOSQUITTO (no broker), MOTORS, PROTOBUF_C, QUIRC_OPENIPC, UACME_OPENIPC, VTUND_OPENIPC, ZEROTIER_ONE * Wireless stack intentionally omitted — openipc/linux hi3516cv6xx kernel has CONFIG_WIRELESS off, so cfg80211/mac80211-dependent USB WiFi drivers (mt7601u, rtl8188fu, linux_firmware_openipc) and wpa_supplicant/wireless-tools have nothing to bind to. Re-enable in a follow-up once the kernel config gains the wireless stack. * UBI rootfs not enabled — cv6xx ships NOR flash ### general/package/hisilicon-opensdk/hisilicon-opensdk.mk * HISILICON_OPENSDK_VERSION bumped 31a5e9f0 → b1c4dae5 (the merged cv6xx port commit on openhisilicon) * Added `hi3516cv6xx` arm to the SoC dependency ladder, SDK_CODE 0x3516C610, DISABLE_VO=1 DISABLE_TDE=1 (V5 is encode-only), the sensor list for the 6 source-built drivers, and a cv6xx install block that ships .ko to /lib/modules/<kver>/hisilicon/ + sensor .so to /usr/lib/sensors/ * Added cv6xx to the FINALIZE_MODULES filter so the depmod hook runs + extra/open_*.ko dedup wipe applies ### general/package/hisilicon-osdrv-hi3516cv6xx/hisilicon-osdrv-hi3516cv6xx.mk * Dropped the 39 prebuilt `INSTALL ... files/kmod/ot_*.ko` lines — those modules are now built against the running openipc/linux tree by hisilicon-opensdk and shipped under hisilicon/ via the FINALIZE hook * Dropped the prebuilt `files/sensor/*.so` install — sensor drivers now built from vendor SDK source by hisilicon-opensdk * Added install for the 43-lib transitive NEEDED closure of the majestic binary against the vendor MPP lib set in files/lib/. libopus.so is explicitly excluded because BR2_PACKAGE_OPUS_OPENIPC builds a source equivalent. 14 unreferenced vendor libs are also omitted, saving ~660 KB. ### general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon Aligned with the hi3516ev200 canonical pattern (it was vendor-flavored `modprobe ot_*` previously): * `modprobe ot_*` → `modprobe open_*` (openhisilicon PREFIX is `open_`) * `set_allocator` writes to `fw_setenv mmz_allocator` (was an empty stub) * `check_allocator` actually called from `insert_osal` (was dead code) * `insert_security_subsys` runs `open_cipher` / `open_km` best-effort (2>/dev/null) — V5 ships them as closed-source full .ko; the rest of the MPP pipeline survives their absence * New `insert_detect()` / `remove_detect()` minimal probe set (osal+mmz+sys_config+base+isp+sensor_i2c+sensor_spi) for fast sensor auto-detect; mirrors ev200 * `-sensor0` / `-sensor` flag also exports `SENSOR=$arg` so explicit sensor specification skips the probe gate * `modprobe sys_config` → `modprobe open_sys_config` (renamed to match openhisilicon naming) * Stale `# modprobe extdrv/ot_sensor_spi` reference dropped * `open_wdt`, `open_pwm`, `open_piris`, `open_sensor_spi` uncommented (they build clean now) ### general/package/all-patches/wireguard-tools/0001-netlink-fallback-define-NLM_F_DUMP_INTR.patch The cv6xx musl toolchain shipped under openipc/firmware releases is built against a pre-3.16 kernel UAPI snapshot, so wireguard-tools 1.0.20210914 fails to compile with "NLM_F_DUMP_INTR undeclared". Patch adds a fallback `#define NLM_F_DUMP_INTR 0x10` in src/netlink.h (the value is stable since the flag was added in upstream commit 1d4c8c29c7df in 2014). Same patch applies safely to all other targets. ### Makefile `repack` target's firmware.bin branch hard-coded an 8192 KB budget regardless of BR2_OPENIPC_FLASH_SIZE. Added a cv6xx-aware path that uses `FLASH_SIZE * 1024` so cv6xx_ultimate (FLASH_SIZE=16) is checked against 16384 KB instead of 8192 KB. Other SoCs unchanged. ### Build budget ``` - firmware.bin: 10048 KB / 16384 KB (61% used, 6336 KB margin) - fitImage: 2772 KB (kernel + DTB) - rootfs.sqfs: 7219 KB (xz) ``` Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to OpenIPC/openhisilicon#202 (merged as
b1c4dae5) which brought up the V5 (Hi3516CV610 / Hi3516CV608) kernel-module + sensor port.hi3516cv6xx_lite_defconfig→hi3516cv6xx_ultimate_defconfig(git mv, history preserved). The previous 8 MB lite variant cannot fit majestic + vendor MPP libs + 42 V5 kernel modules; ultimate/16 MB is the established convention for full feature sets across the firmware tree (8 boards already use it).hisilicon-opensdkto build cv6xx from source: 42open_*.ko(replacing prebuilt vendorot_*.ko) + 6 source-built sensor.so(gc4023, os04d10, sc4336p, sc431hai, sc450ai, sc500ai).HISILICON_OPENSDK_VERSIONfrom31a5e9f0tob1c4dae5.load_hisiliconwith the ev200 canonical pattern.Makefilerepack-budget bug for the cv6xx firmware.bin path.Resolves the boot regression introduced after PRs #2167 + #2170 where
S70vendor → load_hisiliconhung atmmz_start: 0x42e00000waiting onot_base.ko(the vendor blob's init was built against a kernel config / vermagic that doesn't match openipc/linux 5.10.221).Hardware validation (Hi3516CV610 demo board, sc4336p sensor)
Build budget (FLASH_SIZE=16, repack ceiling 16384 KB)
fitImage(zImage + DTB)rootfs.squashfs(xz)firmware.bin.hi3516cv6xxDetail per file
br-ext-chip-hisilicon/configs/hi3516cv6xx_ultimate_defconfig(renamed)VARIANTlite→ultimate,FLASH_SIZE8→16OPENIPC_MAJESTICleft at default\"lite\"— only the lite-flavored cv6xx majestic binary has been published to OpenIPC S3 so far. Bump to\"ultimate\"in a follow-up once an ultimate-flavored cv6xx majestic binary is uploaded.hi3516ev300_ultimate:AWS_WEBRTC,DIVINUS,EXFATPROGS+EXFAT_OPENIPC,IPTABLES,LAME_OPENIPC,LIBWEBSOCKETS_OPENIPC,MAJESTIC+MAJESTIC_FONTS+MAJESTIC_WEBUI,MOSQUITTO(no broker),MOTORS,PROTOBUF_C,QUIRC_OPENIPC,UACME_OPENIPC,VTUND_OPENIPC,ZEROTIER_ONE.openipc/linuxhi3516cv6xx kernel hasCONFIG_WIRELESSoff, so cfg80211/mac80211-dependent USB WiFi drivers (mt7601u_openipc,rtl8188fu_openipc,linux_firmware_openipc) andwpa_supplicant/wireless-toolshave nothing to bind to. Re-enable once the kernel config gains the wireless stack.general/package/hisilicon-opensdk/hisilicon-opensdk.mkHISILICON_OPENSDK_VERSIONbumped31a5e9f0→b1c4dae5(the merged cv6xx port commit).hi3516cv6xxarm in the SoC dependency ladder,HISILICON_OPENSDK_SDK_CODE = 0x3516C610,DISABLE_VO=1 DISABLE_TDE=1(V5 is encode-only).HISILICON_OPENSDK_SENSORS_hi3516cv6xxlisting the 6 source-built drivers..koto/lib/modules/<kver>/hisilicon/+ sensor.soto/usr/lib/sensors/.FINALIZE_MODULESfilter so the depmod hook runs and theextra/open_*.kodedup wipe applies.general/package/hisilicon-osdrv-hi3516cv6xx/hisilicon-osdrv-hi3516cv6xx.mkINSTALL ... files/kmod/ot_*.kolines — those modules are now built against the running openipc/linux tree by hisilicon-opensdk and ship underhisilicon/.files/sensor/*.soinstall — sensor drivers now built from vendor SDK source by hisilicon-opensdk.NEEDEDclosure of the majestic binary against the vendor MPP lib set infiles/lib/.libopus.sois explicitly excluded becauseBR2_PACKAGE_OPUS_OPENIPCbuilds a source equivalent. 14 unreferenced vendor libs are also omitted, saving ~660 KB:libss_mpi_aibnr/bla/cipher/devstat/km/otp/smartae/syskol/uvc,libss_bcd,libmbedtls_harden_adapt,libsvp_aicpu,libvqe_common,libopus.general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisiliconAligned with the hi3516ev200 canonical pattern (was vendor-flavored
modprobe ot_*previously):modprobe ot_*modprobe open_*(openhisilicon PREFIX isopen_)set_allocator(){}empty stubfw_setenv mmz_allocatorcheck_allocatordefined but never calledinsert_osalinsert_security_subsyshard-fail on missingopen_cipher/open_km2>/dev/null; V5 ships cipher/km as closed-source full.ko, the rest of the MPP pipeline survives their absenceinsert_ko(~15 s, fails on missing cipher/km)insert_detect()/remove_detect()(osal+mmz+sys_config+base+isp+sensor_i2c+sensor_spi, ~3 s)-sensor0/-sensorset onlySNS_TYPE0(auto-detect probe still fired)SENSOR=\$arg, skips the probe gate when user specifies explicitlymodprobe sys_config(vendor name, no prefix)modprobe open_sys_config# modprobe extdrv/ot_sensor_spistale vendor-SDK referenceopen_wdt/open_pwm/open_piris/open_sensor_spicommented outgeneral/package/all-patches/wireguard-tools/0001-netlink-fallback-define-NLM_F_DUMP_INTR.patchThe cv6xx musl toolchain shipped under
openipc/firmwarereleases is built against a pre-3.16 kernel UAPI snapshot, so wireguard-tools1.0.20210914fails to compile withNLM_F_DUMP_INTR undeclared. Patch adds a fallback#define NLM_F_DUMP_INTR 0x10insrc/netlink.h(the value is stable since the flag was added in upstream commit1d4c8c29c7dfin 2014). Same patch applies safely to all other targets.Makefilerepacktarget'sfirmware.binbranch hard-coded an 8192 KB budget regardless ofBR2_OPENIPC_FLASH_SIZE. Added a cv6xx-aware path that usesFLASH_SIZE * 1024socv6xx_ultimate(FLASH_SIZE=16) is checked against 16384 KB instead of 8192 KB. Other SoCs unchanged..github/workflows/build.yml+toolchain.ymlCI matrix entry
hi3516cv6xx_lite→hi3516cv6xx_ultimateto match the renamed defconfig.Dedup audit
open_*.koin/lib/modules/<kver>/hisilicon/.extra/is wiped by theFINALIZE_MODULEShook. 191 unique.kopaths, 0 collisions.libsns_*.soin/usr/lib/sensors/. Vendor prebuilt install stripped from osdrv.mk.libopus.soexcluded from osdrv install (BR2_PACKAGE_OPUS_OPENIPC wins).libprotobuf-c.so.1viaBR2_PACKAGE_PROTOBUF_C=y).Deferred follow-ups (not blocking)
open_cipher/open_km/open_otp/open_hardware_cryptodev— vendor ships only as full closed.ko; blob extraction TBD.CONFIG_WIRELESSfamily in the cv6xx kernel config + restore the WiFi-USB driver packages.OPENIPC_MAJESTIC=\"ultimate\"in the defconfig.Test plan
make BOARD=hi3516cv6xx_ultimate all)firmware.bin≤ 16384 KBopen_*.koinstall to/lib/modules/5.10.221/hisilicon/.soinstall to/usr/lib/sensors/closes #180 on the openhisilicon side; resolves the post-#2167/#2170 boot regression on the firmware side.