kernel: bring up hi3516cv6xx (V5 — Hi3516CV610/CV608)#202
Merged
Conversation
Adds a CHIPARCH=hi3516cv6xx arm to the module dispatch, covering the V5 generation of HiSilicon vision SoCs (Hi3516CV610 + Hi3516CV608). 42 open_*.ko modules build clean against openipc/linux 5.10.221 (ARMv7 Cortex-A7, musl) and validated by loading on a CV610 demo board: full MPP image + encode + audio + AI pipeline up, /proc/umap exposes 27 chardevs, sensor I2C/SPI probe path reaches the bus. Pattern mirrors hi3516cv500 with two structural differences inherent to V5: * open_mmz ships as a separate module (V4 folded MMZ into open_osal) * every blob's init wrapper is shipped as source by the vendor SDK, so no init source needed to be hand-written; only the closed MPP/codec payloads need blob-linking Three small source patches were required against vendor source: 1. kernel/compat/kernel_compat.h — dma-contiguous.h gate switched to __has_include because the openipc/linux hi3516cv6xx branch backports the upstream-5.16 merge of dma-contiguous.h into dma-map-ops.h onto 5.10.221. 2. kernel/osal/hi3516cv6xx/mmz/cma_allocator.c — pte_fn_t signature drift (4-arg vendor vs upstream 3-arg), bsp_flush_tlb_kernel_range replaced with the public flush_tlb_kernel_range, and the apply_to_page_range/init_mm reference gated behind CONFIG_CMA (init_mm is not EXPORT_SYMBOL'd and the V5 board builds with CONFIG_CMA=n by default; the OT allocator is the boot-time path). 3. kernel/pwm/hi3516cv6xx/pwm.c and kernel/piris/hi3516cv6xx/piris.c — force-undef IOMEM before redefining as __iomem, because arch/arm/include/asm/io.h ships IOMEM(x) as a function-like macro that collides with the vendor's object-like usage. The 30 vendor closed-source blobs under kernel/obj/hi3516cv6xx/ are extracted from out/obj/mod_*.o in the Hi3516CV610_SDK_V1.0.2.0 release and force-added because the repo .gitignore otherwise excludes *.o. Modules not yet covered (deferred to follow-up): * open_cipher, open_km, open_otp, open_hardware_cryptodev — vendor ships these only as full closed .ko (no separate mod_*.o); need a separate extraction step. * open_es8388, open_sample_ist, open_spi_st7789 — extdrv audio codec / sample peripherals, not needed for the standard pipeline. closes #180 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the V5 family row to the supported-hardware table, the 5.10.221 vendor-kernel row to the supported-kernels table, and a hi3516cv6xx.kbuild entry in the repository-structure tree. SoC family column points at hi3516cv610 (the headline chip in the V5 generation) per the table's existing convention of using a real chip ID, while CHIPARCH stays as the hi3516cv6xx umbrella label that covers both hi3516cv610 and the smaller hi3516cv608 in a single build target. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two-part follow-up to the cv6xx kernel-module bring-up:
1. Sensor drivers: port the 6 sensors shipped in
Hi3516CV610_SDK_V1.0.2.0 from mpp/cbb/isp/user/sensor/hi3516cv610/
into libraries/sensor/hi3516cv6xx/:
* GalaxyCore GC4023
* OmniVision OS04D10
* SmartSens SC431HAI / SC4336P / SC450AI / SC500AI
Each sensor builds libsns_<sensor>.{so,a} via a Makefile mirroring
the hi3516cv500 pattern: -I to kernel/include/hi3516cv6xx/ for the
ot_*.h vendor headers staged in the earlier commit, plus
libraries/isp/include/hi3516cv6xx/{,3a,ext_inc}/ for the userspace
ot_mpi_* / ot_common_* headers staged here from the vendor SDK's
mpp/cbb/isp/include/, mpp/cbb/isp/user/3a/include/, and
mpp/cbb/isp/ext_inc/.
The shared sensor_common.c lives in libraries/sensor/hi3516cv6xx/
common/ and is pulled into each sensor's link target.
libraries/Makefile gains an ifeq($(CHIPARCH),hi3516cv6xx) arm that
filters SUBDIRS to ./sensor/hi3516cv6xx/% and excludes ./common/
(no Makefile of its own).
Cross-compile-verified with the openipc arm-musleabi-gcc 13.3
toolchain. Each .so links only against libc.so (no vendor
dependencies) and exports the openhisilicon sensor ABI
(cis_register_callback / cis_i2c_init / cis_read_reg /
cis_write_reg / cis_init_attr / cis_wdr_range_check / cis_delay_ms).
2. README consistency sweep for V5 / CV6xx. The earlier commit only
touched the SoC-family table, the kernel-version table, and the
repo-structure tree. This commit completes coverage:
* V5 row in the "How it evolved across generations" table (CV610,
Cortex-A7, OSAL+MMZ split, raw .o + vendor init wrappers).
* Strategy A list extended with CV6xx, plus a note about the
vendor SDK shipping init wrappers as source.
* Build example: make BOARD=hi3516cv6xx_lite br-hisilicon-opensdk.
* Module load order: V5 = sys_config -> osal -> mmz (separate) ->
base -> vb -> vca -> sys -> everything else.
* V5 column added to the "Kernel modules" matrix; 14 rows added
for V5-specific modules (vb, vca, vpp, svac3e, chnl, svp_npu,
aiisp, piris, adc, spi_dma_transfer, user, user_proc, uvc,
devstat).
* Restored open_vo V4=blank — the previous commit's V5-column
extension accidentally flipped it to V4=x; V4 EV200 has no
video-output module.
* CV6xx column added to the sensor matrix with the 6 V5 sensors
marked; "V5 sensors not yet ported" note removed.
* adc/, piris/, spi_dma_transfer/, user/ now listed in the
repo-structure tree.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Fantastic! Thank you very much for your work. I see that a lot of |
9 tasks
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
Adds a new
CHIPARCH=hi3516cv6xxarm to the openhisilicon kernel-module dispatch, covering the V5 generation of HiSilicon vision SoCs — Hi3516CV610 and Hi3516CV608.42
open_*.komodules build clean againstopenipc/linux5.10.221 (ARMv7 Cortex-A7, musl) and load successfully on a real CV610 demo board:/proc/umap/exposes 27 chardevs (sys, vb, vi, isp, vpss, venc, h264e/h265e/jpege/svac3e, ive, svp_npu, aiisp, audio aio/ai/ao/aenc/adec/acodec, mipi_rx, pm, …)/dev/i2c-{0,1,2},/dev/ot_mipi_rx)depmodwarnings, zero unresolved symbolsPattern
Mirrors
hi3516cv500with two structural differences inherent to V5:open_mmzships as a separate module — V4 folded MMZ intoopen_osalHi3516CV610_SDK_V1.0.2.0/.../out/init/src/*_init.c), so no init source had to be hand-written for the 30 blob-backed modules; only the closed MPP/codec payloads need blob-linkingSource patches against vendor code
Three small, scoped patches:
kernel/compat/kernel_compat.h—dma-contiguous.hgate switched to__has_includebecause theopenipc/linuxcv6xx kernel branch backports the upstream-5.16 merge ofdma-contiguous.hintodma-map-ops.honto 5.10.221, so the version-code-based gate misfires.kernel/osal/hi3516cv6xx/mmz/cma_allocator.c—pte_fn_tsignature drift: 4-arg vendor (pte_t*, struct page*, addr, data) → upstream 3-arg (pte_t*, addr, data)bsp_flush_tlb_kernel_range→ publicflush_tlb_kernel_range(thebsp_wrapper lives in a vendor BSP we don't ship)apply_to_page_range(&init_mm, …)gated behindCONFIG_CMAbecauseinit_mmis notEXPORT_SYMBOL'd and V5 boards default toCONFIG_CMA=nwithmmz_allocator=otat bootkernel/pwm/hi3516cv6xx/pwm.candkernel/piris/hi3516cv6xx/piris.c— force#undef IOMEMbefore redefining as__iomem.arch/arm/include/asm/io.halready providesIOMEM(x)as a function-like macro that collides with the vendor's object-like usage. Both files'#ifndef IOMEMguard sees the function-like macro and skips, leavingIOMEMas an undefined token at the use site.Vendor blobs
The 30 closed-source
.opayloads underkernel/obj/hi3516cv6xx/are extracted fromout/obj/mod_*.oin theHi3516CV610_SDK_V1.0.2.0release. Force-added because the repo.gitignoreotherwise excludes*.o(same pattern as the cv500 / ev200 obj trees).CI status
hi3516cv6xxis intentionally not in.github/workflows/build.yml'sBuild SDKmatrix in this PR. The reason: the CI's "Build OpenHisilicon" step depends onfirmware'shisilicon-opensdk.mkknowing how to dispatchCHIPARCH=hi3516cv6xx, andOpenIPC/firmware:masterdoesn't yet have that wiring (PR #2167 added the cv6xx board package but with prebuilt vendor.ko, not opensdk). Until the firmware companion PR lands (defconfig flip + opensdk.mk SoC arm + osdrv.mkstrip +load_hisiliconrewrite), any matrix entry forhi3516cv6xxhere would fail at the firmware checkout step and gate the PR.CI matrix entry will land in the firmware companion PR cycle once both repos can dispatch cv6xx natively. The build itself has been validated locally (see "Test plan" below) using the firmware-side companion changes via
BR2_PACKAGE_HISILICON_OPENSDK_OVERRIDE_SRCDIR.Deferred follow-ups (not blocking)
open_cipher,open_km,open_otp,open_hardware_cryptodev— vendor ships these only as full closed.ko(not separatemod_*.o); need a separateobjcopy-extraction stepopen_es8388,open_sample_ist,open_spi_st7789— extdrv audio codec / sample peripherals not used by the standardload_hisiliconchainHardware validation
Hi3516CV610 demo board (sc4336p sensor):
Test plan
make BOARD=hi3516cv6xx_lite br-hisilicon-opensdkwith firmware-sideBR2_PACKAGE_HISILICON_OPENSDK_OVERRIDE_SRCDIRpointing at this PR's tree)depmodwarnings on install.kofiles install to/lib/modules/5.10.221/extra/modprobe(with buildroot-generatedmodules.dep)load_hisilicon -a -sensor0 sc4336p -sensor1 sc4336pchain completesHISILICON_OPENSDK_VERSIONbumped and PR #2170'sCONFIG_IO_STRICT_DEVMEM=nmajesticRTSP smoke test once sysupgrade landscloses #180