Skip to content

hi3516cv6xx: add OS02M10 + IMX307 sensor drivers#2175

Merged
widgetii merged 1 commit into
masterfrom
cv6xx-sensor-os02m10-imx307
Jun 5, 2026
Merged

hi3516cv6xx: add OS02M10 + IMX307 sensor drivers#2175
widgetii merged 1 commit into
masterfrom
cv6xx-sensor-os02m10-imx307

Conversation

@widgetii

@widgetii widgetii commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add vendor prebuilt libsns_os02m10.so and libsns_imx307.so to the cv6xx osdrv package — sensor sources don't exist in the Hi3516CV610 SDK so we ship the vendor blobs (same pattern as our other libss_*.so MPP libs).
  • Add libsns_sp2308.so -> libsns_os02m10.so compat symlink so devices whose u-boot env carries the legacy ipctool-emitted name resolve to the correct driver without a manual fw_setenv.
  • Update load_hisilicon "Available sensors" hint to list all 8 sensor names now shipped.

Background

The Hi3516CV608 DEMO board (the one we have in the lab at 10.216.128.115) boots fine through the cv6xx open kernel stack, but majestic fails with sensor autodetection failed → Cannot start SDK because none of our 6 source-built sensors (gc4023, os04d10, sc4336p, sc450ai, sc500ai, sc431hai) match the actual physical sensor on the board.

The vendor UART boot log is unambiguous:

[MPP] Version: [HI3516CV610_MPP_V1.0.1.0 B040 Release], Build Time[Sep  7 2024, 17:51:12]
vi_pipe:0,== os02m10 24Mclk 1080P30fps(MIPI) 2LANE 10bit linear Init OK!
### Sensor: OS02M10 ###

So the chip is OmniVision OS02M10 (1080p30, 2-lane MIPI, 10-bit linear). The closely-related Hi3516CV610 DEMO board ships IMX307 — also bundled by the same vendor build.

Both sensors' drivers ship as prebuilt blobs (libs/libsns_os02m10.so, libs/libsns_imx307.so) in the vendor's /mnt/mtd/ipc JFFS2 partition. The Hi3516CV610_SDK_V1.0.2.0 source tree does NOT include source for either — only for the 6 we already build from source.

SP2308 alias

ipctool's i2c probe identifies the chip via product ID 0x5302 and prints SP2308 (sensors.c:899) with the comment // or OS02M10. SP2308 is SuperPix's rebadge of the same OmniVision silicon — same chip, same registers, just a different marker. Devices that had ipctool dump run before this fix have sensor=sp2308 baked into u-boot env. Symlinking libsns_sp2308.so → libsns_os02m10.so resolves that without forcing a fw_setenv on every existing unit.

Test plan

  • make BOARD=hi3516cv6xx_ultimate build repack succeeds at 10112/16384 KB
  • unsquashfs -ll output/images/rootfs.squashfs | grep libsns shows both new blobs plus the sp2308 symlink under /usr/lib/sensors/
  • Live CV608 reflash + fw_setenv sensor os02m10 (or leave the legacy sp2308 → resolves via symlink) → majestic relocates clean → MIPI sensor initialises → RTSP serves
  • CI build-one passes for hi3516cv6xx-ultimate

What was hunted but NOT included

I swept four additional CV6xx flash backups (CamHi/OS02M10, Black Quad/GC4653, Oval/OS04D10, Avantis/IMX662) looking for more harvestable drivers. The CamHi backup's blobs are md5-identical to the ones we already extracted — no new dynamic libsns_*.so files. The Black Quad / Oval / Avantis vendors statically-link their sensor support into a single monolithic ipcam binary, so there's no clean .so to ship. GC4653 + IMX662 remain follow-ups (separate acquisition route needed: newer SDK source, or static-ELF carve).

🤖 Generated with Claude Code

The Hi3516CV608 DEMO Board ships with an OmniVision OS02M10 sensor
(boot log: "vi_pipe:0,== os02m10 24Mclk 1080P30fps(MIPI) 2LANE 10bit
linear Init OK!"), and the closely-related Hi3516CV610 DEMO Board
ships IMX307. Neither sensor has source available in the
Hi3516CV610_SDK_V1.0.2.0 sensor tree (which only covers gc4023,
os04d10, sc4336p, sc450ai, sc500ai, sc431hai — already source-built
via openhisilicon), so we ship the vendor's prebuilt libsns_*.so
blobs from the original CV608 flash dump alongside the source-built
six.

Also adds a libsns_sp2308.so -> libsns_os02m10.so symlink so devices
whose u-boot env was set via ipctool resolve to the correct driver
without a manual fw_setenv: ipctool's i2c probe reports the OS02M10
chip ID (0x5302) as "SP2308" — SuperPix rebadge of the same silicon
(see ipctool/src/sensors.c:899-901 "or OS02M10" comment).

Updates the load_hisilicon "Available sensors" hint to enumerate all
8 sensor names the package now ships.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit 8b4d216 into master Jun 5, 2026
103 checks passed
@widgetii widgetii deleted the cv6xx-sensor-os02m10-imx307 branch June 5, 2026 12:49
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