Skip to content

feat: add hi3516av100 SoC family support#40

Merged
widgetii merged 2 commits into
mainfrom
feat/hi3516av100
Apr 11, 2026
Merged

feat: add hi3516av100 SoC family support#40
widgetii merged 2 commits into
mainfrom
feat/hi3516av100

Conversation

@widgetii

Copy link
Copy Markdown
Member

Summary

  • Add hi3516av100 (V2A generation, Cortex-A7/ARMv7) SoC family support with chip variants hi3516av100 and hi3516dv100
  • Standalone MMZ + himedia architecture (no OSAL), kernel 4.9.37, Hi3516A SDK V1.0.8.0
  • 11 source modules (mmz, himedia, mipi, wdt, IR, hiuser, RTC, sensor_i2c, sensor_spi, pwm, piris) + cipher (not wired)
  • 25 blob modules from OpenIPC .ko files with init wrappers and symbol re-exports
  • ISP userspace library source (libisp: main + algorithms + vreg)
  • 14 sensor drivers with build Makefiles
  • H.265 support, PM and VDA modules included
  • Cross-compiled 33 kernel modules against 4.9.37 kernel
  • QEMU boot verified (hi3516av100 machine, "Starting crond: OK")

Test plan

  • Cross-compile all kernel modules (CHIPARCH=hi3516av100 DISABLE_TDE=1 DISABLE_VO=1)
  • QEMU boot smoke-test (-M hi3516av100 -m 256M, reached userspace)
  • CI: hi3516av100_lite build matrix entry
  • CI: qemu-av100-boot job

🤖 Generated with Claude Code

Vixand and others added 2 commits April 11, 2026 20:56
V2A generation (Cortex-A7 / ARMv7), kernel 4.9.37. Standalone MMZ +
himedia architecture (no OSAL). Chip variants: hi3516av100, hi3516dv100.

SDK source modules: mmz, himedia, mipi, watchdog, IR, hiuser, RTC,
cipher (not wired), sensor_i2c, sensor_spi, pwm, piris.

Blob modules from OpenIPC .ko files: base, sys, vi, vpss, venc, h264e,
h265e, jpege, rc, chnl, region, vgs, ive, vda, pm, isp, tde, aio, ai,
ao, aenc, adec, acodec, vou, hifb.

ISP userspace library source (libisp): main + algorithms + vreg.
14 sensor drivers with Makefiles.

Cross-compiled against kernel 4.9.37 (33 modules). QEMU boot verified
(hi3516av100 machine, "Starting crond: OK").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Copy full ISP firmware source (33 .c files, was only 4)
- Add ISP vreg include paths to kbuild
- Copy missing strfunc.c/h for pwm and piris modules
- Add hi_rtc blob + init wrapper (was source-only, but RTC
  source needs porting)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit 3e1acb4 into main Apr 11, 2026
17 checks passed
widgetii pushed a commit that referenced this pull request May 5, 2026
The directory was imported as part of the original av100 SoC support
in #40 but never built — the source uses V4-era ABI that doesn't
match V2A SDK headers:

- registration callback signature
  GK_S32 sensor_register_callback(VI_PIPE, ALG_LIB_S*, ALG_LIB_S*)
  is V3+/V4 (V2A uses int sensor_register_callback(void))
- ISP_SNS_OBJ_S struct initialiser uses .pfnSetBusInfo and
  .pfnSetInit fields that exist in V4 (ev200) but not in the
  V2A struct definition

The right home for sc4236 is hi3516ev200/smart_sc4236/ — which
already exists and works (1115 lines, current). The av100 copy
(1006 lines, older revision) is a stale partial duplicate; nothing
references it outside its own dir.

Removing the dir lets us drop the libraries/Makefile "|| true"
workaround eventually — silent build failures are exactly what
that workaround masked here.
widgetii pushed a commit that referenced this pull request May 7, 2026
The directory was imported as part of the original av100 SoC support
in #40 but never built — the source uses V4-era ABI that doesn't
match V2A SDK headers:

- registration callback signature
  GK_S32 sensor_register_callback(VI_PIPE, ALG_LIB_S*, ALG_LIB_S*)
  is V3+/V4 (V2A uses int sensor_register_callback(void))
- ISP_SNS_OBJ_S struct initialiser uses .pfnSetBusInfo and
  .pfnSetInit fields that exist in V4 (ev200) but not in the
  V2A struct definition

The right home for sc4236 is hi3516ev200/smart_sc4236/ — which
already exists and works (1115 lines, current). The av100 copy
(1006 lines, older revision) is a stale partial duplicate; nothing
references it outside its own dir.

Removing the dir lets us drop the libraries/Makefile "|| true"
workaround eventually — silent build failures are exactly what
that workaround masked here.
widgetii added a commit that referenced this pull request May 7, 2026
* sensor/av100: drop vendor prefix from libsns_* LIB_NAME

The hi3516av100 sensor source dirs were the only platform whose
Makefile LIB_NAME carried a vendor prefix (libsns_aptina_ar0230,
libsns_sony_imx123, etc.). Every other platform — cv200, cv300,
v101, cv500, ev200/gk7205v200, cv100 — uses the unprefixed
libsns_<model> form, and the av100 firmware sensor .ini files
(general/package/hisilicon-osdrv-hi3516av100/files/sensor/config/*.ini
in OpenIPC/firmware) already reference the unprefixed names via
their DllFile= entries.

Renaming aligns av100 with the rest of the platforms and lets the
source-built sensors replace the matching binary blobs shipped by
hisilicon-osdrv-hi3516av100. Without this rename, source-built and
binary lib files would land side-by-side under different names.

The vendor prefix only appeared in the LIB_NAME declaration; no C
symbols, headers, or callers reference it.

  aptina_ar0230            -> libsns_ar0230
  aptina_ar0237            -> libsns_ar0237
  aptina_ar0237_dc         -> libsns_ar0237_dc
  aptina_ar0330            -> libsns_ar0330
  omnivision_ov4689        -> libsns_ov4689
  omnivision_ov5658        -> libsns_ov5658
  panasonic_mn34220        -> libsns_mn34220
  panasonic_mn34220_mipi   -> libsns_mn34220_mipi
  smart_sc4236             -> libsns_sc4236
  sony_imx117              -> libsns_imx117
  sony_imx123              -> libsns_imx123
  sony_imx178              -> libsns_imx178
  sony_imx178_37M          -> libsns_imx178_37M
  sony_imx185              -> libsns_imx185

Tracks #82. Required before the firmware-side hisilicon-av100
sensor wiring PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sensor/av100: fix build errors surfaced by firmware-side wiring

Two pre-existing latent bugs that the libraries/Makefile's
"|| true" suppressed are now blocking the firmware-side install
phase. Both were waiting for a real consumer.

1. sony_imx117: imx117_sensor_ctl.c includes "pwm.h" which lives
   at kernel/pwm/hi3516av100/pwm.h. The Makefile only added
   kernel/include/hi3516av100 and kernel/isp/arch/hi3516av100/
   to the include path. Add kernel/pwm/hi3516av100 alongside.

2. kernel/include/hi3516av100/hi_spi.h uses _IOC_SIZEBITS in its
   SPI_MSGSIZE macro without including <sys/ioctl.h>. glibc's
   <sys/ioctl.h> is implicitly transitively pulled in by the
   sensor_ctl includes, but musl is stricter and the symbol is
   undeclared, breaking sony_imx123 and sony_imx185 (and any
   future SPI-using sensor) under arm-openipc-linux-musleabi-gcc.
   Include <sys/ioctl.h> directly in the header.

Both fixes are no-ops under glibc (Header guards / pre-existing
declarations) and resolve the musl errors. Verified:
arm-openipc-linux-gnueabi-gcc 13.3.0 still produces identical .so
output for the affected sensors.

The smart_sc4236 source is broken in a deeper way (stSnsSc4236Obj
struct uses ISP_SNS_OBJ_S fields that don't exist in V2A; the
sensor_register_callback signature is V3-style not V2A-style).
That's a real port issue, not a header / Makefile fix — left for
a follow-up. The firmware-side PR (#2056) drops smart_sc4236 from
HISILICON_OPENSDK_SENSORS_hi3516av100 in the meantime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sensor/av100: drop orphaned smart_sc4236 (V4-era source in V2A dir)

The directory was imported as part of the original av100 SoC support
in #40 but never built — the source uses V4-era ABI that doesn't
match V2A SDK headers:

- registration callback signature
  GK_S32 sensor_register_callback(VI_PIPE, ALG_LIB_S*, ALG_LIB_S*)
  is V3+/V4 (V2A uses int sensor_register_callback(void))
- ISP_SNS_OBJ_S struct initialiser uses .pfnSetBusInfo and
  .pfnSetInit fields that exist in V4 (ev200) but not in the
  V2A struct definition

The right home for sc4236 is hi3516ev200/smart_sc4236/ — which
already exists and works (1115 lines, current). The av100 copy
(1006 lines, older revision) is a stale partial duplicate; nothing
references it outside its own dir.

Removing the dir lets us drop the libraries/Makefile "|| true"
workaround eventually — silent build failures are exactly what
that workaround masked here.

---------

Co-authored-by: Vasiliy Yakovlev <vixand@openipc.org>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants