Skip to content

xiongmai: XM530V200, XM533 and XM535 boards, with the V200 series' vendor modules - #2709

Merged
dimerr merged 3 commits into
masterfrom
xiongmai-v200
Oct 28, 2026
Merged

dimerr merged 3 commits into
masterfrom
xiongmai-v200

Conversation

@dimerr

@dimerr dimerr commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

New hardware support: Xiongmai's V200 series, the XM530V200, XM533, XM535D1, XM535D2 and XM535W1. Xiongmai treats the three XM535 chips as separate chips; a plain XM535 is a first-generation part that xm530_lite already serves. Camera dumps are in OpenIPC/qemu-bench#154. These parts run the XM530's kernel, so the boards join the xm530 family:

  • Boards: xm530v200_lite, xm533_lite, xm535d1_lite, xm535d2_lite and xm535w1_lite, with a kernel config each in board/xm530/.
    • xm530v200 is SMP, with the latched SP804 read.
    • xm533 and the XM535s are built CONFIG_SMP=n: their vendor kernels and modules are uniprocessor, and so is the modules' vermagic.
    • Each config names its machine, so ipcinfo and sysupgrade see the chip (xm535d2, ...), matching soc= from the OpenIPC U-Boot.
  • xiongmai-osdrv-xm530v200: each chip's vendor modules under files/<soc_model>/, and a load_xiongmai per chip.
    • The scripts load the modules in the vendor's order and write its pll.sh with devmem.
    • MMZ is sized from totalmem, or from the chip's own RAM size; each chip has its own PLL settings and SD power pad.
    • The XM535W1 loads its own 2024 module set (vi.ko where the D1/D2 load vpss.ko) and has no SD slot.
    • The SD card goes through the kernel's xm_v200_sd, using the board's power pad. sdio_pdn in the env overrides it.
  • Left out: majestic, Wi-Fi and the vendor xm_wdt. Majestic drives the XM530's media interface, and this series has a different one, linked into the vendor app with no library to call.
  • CI: the five boards are in ALL_BOARDS, beside xm530_lite.

Depends on OpenIPC/linux#156 (exports, latch, machine name, xm_v200_sd) being merged into xiongmai-xm530. The OpenIPC U-Boot side is OpenIPC/u-boot#90.

Warning

This fails the "No binaries without a buildable source" gate, knowingly. The 59 .ko under general/package/xiongmai-osdrv-xm530v200/files/*/kmod/ were extracted from factory firmware dumps, not from a vendor SDK release:

Chip Dump
XM530V200 General_IPC_XM530V200_X6C-WEQ…V5.04.R02.20241125
XM533 General_IPC_XM533W1_X3-WQ-B…V5.04.R02.20250828
XM535D1 General_IPC_XM535D1_X6E-WEQ…V5.07.X02.20250906
XM535D2 General_IPC_XM535D2_X9-WE2Q…V5.02.X02.20251223 (the same media modules as the D1)
XM535W1 General_IPC_XM535W1_X2W-WNG…V5.00.R02.20240410

The modules cannot be shared between chips:

  • the XM530V200 set is SMP and the others UP;
  • apart from the D1 and D2, which ship identical media modules, only ddr.ko and h264.ko are shared, between XM533 and XM535;
  • the HEVC, capture, VPSS and OSD register layouts differ per chip.

The way out is an XM530V200 SDK release, or open-sourcing these modules in OpenIPC/openxiongmai as was done for the XM530. Opened as a draft so maintainers can decide.

Hardware tested on

Not run on a camera. Only in qemu-bench, which emulates these SoCs. That is not hardware evidence: QEMU's SDHCI, SP804 and DDR do not check the vendor register values these modules and scripts write. Every image below was booted through the OpenIPC U-Boot from OpenIPC/u-boot#90, at -m 64M and -m 128M.

Image qemu-bench machine
xm530v200 -M xm530v200 -smp 2
xm533 -M xm533
xm535d1 -M xm535
xm535d2 -M xm535 -m 128M
xm535w1 -M xm535,sensor-id=da4d

Evidence

Before: there are no images for these SoCs.

After, in QEMU (not a camera). Output as captured, trimmed to the lines that matter:

# xm530v200 (-smp 2)
processor	: 0 processor	: 1 Hardware	: xm530v200 xm530v200
mem=64M console=ttyAMA0,115200 panic=20 root=/dev/mtdblock3 rootfstype=squashfs init=/init mtdparts=xm_sfc:256k(u-boot),64k(env),2048k(kernel),5120k(rootfs),7168k@0x50000(firmware),-(rootfs_data)
totalmem=128M osmem=64M soc=xm530v200
acodec adc ddr dwc2 hevc i2c i2s isp jpeg log mmz nn rgn sys vb venc vo vpss xm_usb0 xm_v200_sd
0          <- dmesg lines matching unknown symbol|version magic|oops|unable to handle|BUG:
mmz: init ok start=0x84000000, size=0x4000000

# xm533
processor	: 0 Hardware	: xm533 xm533
totalmem=64M osmem=32M soc=xm533
acodec adc ddr h264 hevc i2s isp ive log mipi_io mmz nn rgn sys vb venc venc_mem vi xm_i2c xm_v200_sd
0
mmz: init ok start=0x82000000, size=0x2000000

# xm535d1
processor	: 0 Hardware	: xm535d1
soc=xm535d1 totalmem=64M osmem=32M ubfile=u-boot-xm535d1-nor.bin
acodec adc ddr dwc2 h264 hevc i2c i2s isp log mmz nn rgn sys vb venc vpss xm_usb0 xm_v200_sd
0
mmz: init ok start=0x82000000, size=0x2000000
0x87020000   <- devmem 0x20000074, PLLC

# xm535d2
processor	: 0 Hardware	: xm535d2
soc=xm535d2 totalmem=128M osmem=64M ubfile=u-boot-xm535d2-nor.bin
acodec adc ddr dwc2 h264 hevc i2c i2s isp log mmz nn rgn sys vb venc vpss xm_usb0 xm_v200_sd
0
mmz: init ok start=0x84000000, size=0x4000000
0x87030000

# xm535w1
processor	: 0 Hardware	: xm535w1
soc=xm535w1 totalmem=64M osmem=32M ubfile=u-boot-xm535w1-nor.bin
acodec adc ddr dwc2 h264 hevc i2c i2s isp log mmz nn rgn sys vb venc vi xm_usb0
0
mmz: init ok start=0x82000000, size=0x2000000
0x87020000

SD in QEMU: a 256 KiB raw write to /dev/mmcblk0 reads back with the same md5 on xm530v200, xm533 and xm535d1. mdev mounts the vfat card at /mnt/mmcblk0 on those and on xm535d2 (xm535w1 has no slot).

Image sizes:

Image uImage rootfs.squashfs
xm530v200 1175 KB 2172 KB
xm533 1104 KB 2112 KB
xm535d1/d2/w1 1104 KB ~2.2 MB

ci-matrix.py --self-test: ok (112 boards); --stdin on this diff selects all five V200 boards.

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it

…ndor modules

Xiongmai's V200 series (OpenIPC/qemu-bench#154) runs the XM530's kernel,
so the boards join the xm530 family: same kernel branch and toolchain,
and a kernel config each in board/xm530:
  - xm530v200: SMP, as its vendor kernel is, with the latched SP804 read
    (XM530_SP804_LATCH).
  - xm533, xm535: uniprocessor. Their vendor kernels and modules are built
    UP, and the modules' vermagic says so.
Each config names its own machine (XM530_MACHINE_NAME), so ipcinfo and
sysupgrade see xm530v200, xm533 or xm535 rather than xm530. Each builds
xm_v200_sd for the card slot.

xiongmai-osdrv-xm530v200 ships each chip's vendor modules from a camera
dump, installed by OPENIPC_SOC_MODEL: the X6C-WEQ for XM530V200, X3-WQ-B
for XM533, and X6E-WEQ (D1) for XM535, whose media modules D2 shares.
load_xiongmai loads them in the vendor's order, with its pll.sh written
as devmem. MMZ is sized from totalmem, or from the chip's usual RAM size
without it; on XM535 that size also selects the D1/W1 or D2/W2 PLLC.
The SD card goes through the kernel's xm_v200_sd with the board's power
pad: 86, 11 and 90 on those boards. sdio_pdn in the U-Boot environment
overrides it; XM535D2 uses 8. Left out:
  - xm_wdt.ko: the kernel's sp805 is the watchdog, as on XM530.
  - the vendor sdio0_sd/sdio1_sd: they pass their own kernel's arasan
    platform data, and the probe jumps to 0.
  - the Wi-Fi drivers.

These boards need the kernel side in OpenIPC/linux xiongmai-xm530:
clk_get_pts, kthread_set_prio, the latch, the machine name and
xm_v200_sd.

Majestic is left out: it drives the XM530's media interface, and the
V200 series has a different one, linked into Sofia with no library to
call. So the boards are in UNBUILT_BOARDS until their modules have run
on a camera.

Tested in qemu-bench (-M xm530v200 -smp 2, xm533, xm535 at 64 and
128 MB). The OpenIPC U-Boot's V200 support and the cameras' own U-Boot,
with its env pointed at 0x50000, both boot this kernel. Every vendor
module loads with no unknown symbol or Oops, ipcinfo reports the chip,
MMZ follows totalmem, and the SD card mounts and reads back what was
written.
@dimerr
dimerr marked this pull request as ready for review October 28, 2026 05:35
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add XM530V200, XM533 and XM535 lite board support

✨ Enhancement ⚙️ Configuration changes 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Add lite images for three V200-series SoCs using chip-specific XM530 kernel configurations.
• Package chip-specific vendor modules and loaders for media, memory, clocks and SD-card
 initialization.
• Add CI package checks; keep images unbuilt pending camera testing and a source-binary policy
 decision.
Diagram

graph TD
  A["Lite board configs"] --> B["XM530 kernel"] --> C["V200 SD driver"]
  A --> D["OSDRV package"] --> E["Chip modules"] --> F["Module loader"]
  F --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Source-backed modules before inclusion
  • ➕ Satisfies the repository's buildable-source gate.
  • ➕ Makes provenance, fixes and kernel compatibility reviewable.
  • ➖ Requires an SDK release or upstreaming work before these images can be included.

Recommendation: The per-SoC package layout is appropriate: the module sets and SMP requirements differ. Keep this as a draft until maintainers resolve the source-binary exception or obtain buildable sources, and validate on cameras before enabling the boards in the build matrix. The implementation also depends on the separate XM530 kernel changes.

Files changed (70) +5716 / -1

Enhancement (60) +391 / -0
acodec.koAdd XM530V200 audio codec module +0/-0

Add XM530V200 audio codec module

• Adds the XM530V200 vendor acodec kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/acodec.ko

adc.koAdd XM530V200 ADC module +0/-0

Add XM530V200 ADC module

• Adds the XM530V200 vendor adc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/adc.ko

ddr.koAdd XM530V200 DDR module +0/-0

Add XM530V200 DDR module

• Adds the XM530V200 vendor ddr kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/ddr.ko

dwc2.koAdd XM530V200 USB controller module +0/-0

Add XM530V200 USB controller module

• Adds the XM530V200 vendor dwc2 kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/dwc2.ko

hevc.koAdd XM530V200 HEVC module +0/-0

Add XM530V200 HEVC module

• Adds the XM530V200 vendor hevc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/hevc.ko

i2c.koAdd XM530V200 I2C module +0/-0

Add XM530V200 I2C module

• Adds the XM530V200 vendor i2c kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/i2c.ko

i2s.koAdd XM530V200 I2S module +0/-0

Add XM530V200 I2S module

• Adds the XM530V200 vendor i2s kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/i2s.ko

isp.koAdd XM530V200 ISP module +0/-0

Add XM530V200 ISP module

• Adds the XM530V200 vendor isp kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/isp.ko

jpeg.koAdd XM530V200 JPEG module +0/-0

Add XM530V200 JPEG module

• Adds the XM530V200 vendor jpeg kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/jpeg.ko

log.koAdd XM530V200 logging module +0/-0

Add XM530V200 logging module

• Adds the XM530V200 vendor log kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/log.ko

mmz.koAdd XM530V200 MMZ module +0/-0

Add XM530V200 MMZ module

• Adds the XM530V200 vendor mmz kernel binary used with the loader's reserved-memory settings.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/mmz.ko

nn.koAdd XM530V200 neural-network module +0/-0

Add XM530V200 neural-network module

• Adds the XM530V200 vendor nn kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/nn.ko

rgn.koAdd XM530V200 region module +0/-0

Add XM530V200 region module

• Adds the XM530V200 vendor rgn kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/rgn.ko

sys.koAdd XM530V200 system module +0/-0

Add XM530V200 system module

• Adds the XM530V200 vendor sys kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/sys.ko

vb.koAdd XM530V200 video-buffer module +0/-0

Add XM530V200 video-buffer module

• Adds the XM530V200 vendor vb kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/vb.ko

venc.koAdd XM530V200 video-encoder module +0/-0

Add XM530V200 video-encoder module

• Adds the XM530V200 vendor venc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/venc.ko

vo.koAdd XM530V200 video-output module +0/-0

Add XM530V200 video-output module

• Adds the XM530V200 vendor vo kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/vo.ko

vpss.koAdd XM530V200 video-processing module +0/-0

Add XM530V200 video-processing module

• Adds the XM530V200 vendor vpss kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/vpss.ko

xm_usb0.koAdd XM530V200 USB platform module +0/-0

Add XM530V200 USB platform module

• Adds the XM530V200 vendor xm_usb0 kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/kmod/xm_usb0.ko

load_xiongmaiInitialize and load XM530V200 modules +116/-0

Initialize and load XM530V200 modules

• Applies vendor PLL writes, sizes MMZ using totalmem, and loads modules in vendor order. Loads the kernel V200 SD driver with a default power pad of 86 or an sdio_pdn override.

general/package/xiongmai-osdrv-xm530v200/files/xm530v200/load_xiongmai

acodec.koAdd XM533 audio codec module +0/-0

Add XM533 audio codec module

• Adds the XM533 vendor acodec kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/acodec.ko

adc.koAdd XM533 ADC module +0/-0

Add XM533 ADC module

• Adds the XM533 vendor adc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/adc.ko

ddr.koAdd XM533 DDR module +0/-0

Add XM533 DDR module

• Adds the XM533 vendor ddr kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/ddr.ko

h264.koAdd XM533 H.264 module +0/-0

Add XM533 H.264 module

• Adds the XM533 vendor h264 kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/h264.ko

hevc.koAdd XM533 HEVC module +0/-0

Add XM533 HEVC module

• Adds the XM533 vendor hevc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/hevc.ko

i2c.koAdd XM533 I2C module +0/-0

Add XM533 I2C module

• Adds the XM533 vendor i2c kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/i2c.ko

i2s.koAdd XM533 I2S module +0/-0

Add XM533 I2S module

• Adds the XM533 vendor i2s kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/i2s.ko

isp.koAdd XM533 ISP module +0/-0

Add XM533 ISP module

• Adds the XM533 vendor isp kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/isp.ko

ive.koAdd XM533 image-processing module +0/-0

Add XM533 image-processing module

• Adds the XM533 vendor ive kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/ive.ko

log.koAdd XM533 logging module +0/-0

Add XM533 logging module

• Adds the XM533 vendor log kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/log.ko

mipi_io.koAdd XM533 MIPI-I/O module +0/-0

Add XM533 MIPI-I/O module

• Adds the XM533 vendor mipi_io kernel binary used for board GPIO pads.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/mipi_io.ko

mmz.koAdd XM533 MMZ module +0/-0

Add XM533 MMZ module

• Adds the XM533 vendor mmz kernel binary used with the loader's reserved-memory settings.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/mmz.ko

nn.koAdd XM533 neural-network module +0/-0

Add XM533 neural-network module

• Adds the XM533 vendor nn kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/nn.ko

rgn.koAdd XM533 region module +0/-0

Add XM533 region module

• Adds the XM533 vendor rgn kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/rgn.ko

sys.koAdd XM533 system module +0/-0

Add XM533 system module

• Adds the XM533 vendor sys kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/sys.ko

vb.koAdd XM533 video-buffer module +0/-0

Add XM533 video-buffer module

• Adds the XM533 vendor vb kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/vb.ko

venc.koAdd XM533 video-encoder module +0/-0

Add XM533 video-encoder module

• Adds the XM533 vendor venc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/venc.ko

venc_mem.koAdd XM533 encoder-memory module +0/-0

Add XM533 encoder-memory module

• Adds the XM533 vendor venc_mem kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/venc_mem.ko

vi.koAdd XM533 video-input module +0/-0

Add XM533 video-input module

• Adds the XM533 vendor vi kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm533/kmod/vi.ko

load_xiongmaiInitialize and load XM533 modules +119/-0

Initialize and load XM533 modules

• Applies XM533 PLL writes, sizes MMZ, and loads the chip's modules in vendor order, including MIPI-I/O. Loads the kernel V200 SD driver with a default power pad of 11 or an sdio_pdn override.

general/package/xiongmai-osdrv-xm530v200/files/xm533/load_xiongmai

acodec.koAdd XM535 audio codec module +0/-0

Add XM535 audio codec module

• Adds the XM535 vendor acodec kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/acodec.ko

adc.koAdd XM535 ADC module +0/-0

Add XM535 ADC module

• Adds the XM535 vendor adc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/adc.ko

ddr.koAdd XM535 DDR module +0/-0

Add XM535 DDR module

• Adds the XM535 vendor ddr kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/ddr.ko

dwc2.koAdd XM535 USB controller module +0/-0

Add XM535 USB controller module

• Adds the XM535 vendor dwc2 kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/dwc2.ko

h264.koAdd XM535 H.264 module +0/-0

Add XM535 H.264 module

• Adds the XM535 vendor h264 kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/h264.ko

hevc.koAdd XM535 HEVC module +0/-0

Add XM535 HEVC module

• Adds the XM535 vendor hevc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/hevc.ko

i2c.koAdd XM535 I2C module +0/-0

Add XM535 I2C module

• Adds the XM535 vendor i2c kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/i2c.ko

i2s.koAdd XM535 I2S module +0/-0

Add XM535 I2S module

• Adds the XM535 vendor i2s kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/i2s.ko

isp.koAdd XM535 ISP module +0/-0

Add XM535 ISP module

• Adds the XM535 vendor isp kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/isp.ko

log.koAdd XM535 logging module +0/-0

Add XM535 logging module

• Adds the XM535 vendor log kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/log.ko

mmz.koAdd XM535 MMZ module +0/-0

Add XM535 MMZ module

• Adds the XM535 vendor mmz kernel binary used with the loader's reserved-memory settings.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/mmz.ko

nn.koAdd XM535 neural-network module +0/-0

Add XM535 neural-network module

• Adds the XM535 vendor nn kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/nn.ko

rgn.koAdd XM535 region module +0/-0

Add XM535 region module

• Adds the XM535 vendor rgn kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/rgn.ko

sys.koAdd XM535 system module +0/-0

Add XM535 system module

• Adds the XM535 vendor sys kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/sys.ko

vb.koAdd XM535 video-buffer module +0/-0

Add XM535 video-buffer module

• Adds the XM535 vendor vb kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/vb.ko

venc.koAdd XM535 video-encoder module +0/-0

Add XM535 video-encoder module

• Adds the XM535 vendor venc kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/venc.ko

vpss.koAdd XM535 video-processing module +0/-0

Add XM535 video-processing module

• Adds the XM535 vendor vpss kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/vpss.ko

xm_usb0.koAdd XM535 USB platform module +0/-0

Add XM535 USB platform module

• Adds the XM535 vendor xm_usb0 kernel binary extracted from camera firmware.

general/package/xiongmai-osdrv-xm530v200/files/xm535/kmod/xm_usb0.ko

load_xiongmaiInitialize and load XM535 modules +126/-0

Initialize and load XM535 modules

• Applies chip-specific PLL writes, selecting a different PLLC setting for 128 MB variants, and loads the vendor modules with MMZ sized from totalmem. Loads the kernel V200 SD driver with a default power pad of 90 or an sdio_pdn override.

general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai

xiongmai-osdrv-xm530v200.mkInstall modules and loader for the selected SoC +30/-0

Install modules and loader for the selected SoC

• Uses OPENIPC_SOC_MODEL to install one chip's binary modules under the kernel module tree and its load_xiongmai script under /usr/bin. The included binaries are extracted from firmware rather than built from source.

general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk

Tests (1) +1 / -0
check_target_modules.shCheck installation of V200 vendor modules +1/-0

Check installation of V200 vendor modules

• Requires a packaged hevc.ko when the new OSDRV package is selected, catching missing target modules in CI.

.github/scripts/check_target_modules.sh

Other (9) +5324 / -1
ci-matrix.pyRegister the package and defer untested boards +11/-1

Register the package and defer untested boards

• Recognizes the new package and places all three lite boards in UNBUILT_BOARDS because they have not run on cameras.

.github/scripts/ci-matrix.py

xm530v200.generic.configConfigure the SMP XM530V200 kernel +1722/-0

Configure the SMP XM530V200 kernel

• Sets the XM530V200 machine name, enables SMP and the latched SP804 read, and builds the V200 SD module.

br-ext-chip-xiongmai/board/xm530/xm530v200.generic.config

xm533.generic.configConfigure the uniprocessor XM533 kernel +1692/-0

Configure the uniprocessor XM533 kernel

• Sets the XM533 machine name, disables SMP to match vendor-module vermagic, and builds the V200 SD module.

br-ext-chip-xiongmai/board/xm530/xm533.generic.config

xm535.generic.configConfigure the uniprocessor XM535 kernel +1692/-0

Configure the uniprocessor XM535 kernel

• Sets the XM535 machine name, disables SMP to match vendor-module vermagic, and builds the V200 SD module.

br-ext-chip-xiongmai/board/xm530/xm535.generic.config

xm530v200_lite_defconfigDefine the XM530V200 lite image +66/-0

Define the XM530V200 lite image

• Selects the XM530-family kernel configuration and new OSDRV package for an 8 MB flash image. Majestic is omitted because its existing media backend does not support this series.

br-ext-chip-xiongmai/configs/xm530v200_lite_defconfig

xm533_lite_defconfigDefine the XM533 lite image +67/-0

Define the XM533 lite image

• Selects the XM533 kernel configuration and chip-selected OSDRV modules for an 8 MB flash image, without majestic.

br-ext-chip-xiongmai/configs/xm533_lite_defconfig

xm535_lite_defconfigDefine the XM535 lite image +66/-0

Define the XM535 lite image

• Selects the XM535 kernel configuration and chip-selected OSDRV modules for an 8 MB flash image, without majestic.

br-ext-chip-xiongmai/configs/xm535_lite_defconfig

Config.inExpose the V200 OSDRV package +1/-0

Expose the V200 OSDRV package

• Sources the new package configuration in the general package menu.

general/package/Config.in

Config.inDefine the V200-series module option +7/-0

Define the V200-series module option

• Adds a Buildroot option for the XM530V200, XM533 and XM535 kernel-module package.

general/package/xiongmai-osdrv-xm530v200/Config.in

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Future builds cannot reproduce modules 📘 Rule violation ⚙ Maintainability
Description
XIONGMAI_OSDRV_XM530V200_INSTALL_TARGET_CMDS installs precompiled, model-specific .ko files from
the package’s files directories without a source location or compilation step. Because all three
module sets are identified as extracted from camera firmware, the three images depend on binaries
that cannot be traced to a buildable source or rebuilt for a kernel change.
Code

general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[R12-24]

+# The V200 series' vendor modules, one set per chip, from camera firmware
+# (OpenIPC/qemu-bench#154):
+#   xm530v200  X6C-WEQ, V5.04.R02.20241125
+#   xm533      X3-WQ-B, V5.04.R02.20250828
+#   xm535      X6E-WEQ (D1), V5.07.X02.20250906; D2 and W1 share its modules
+# They are built for their 3.10.103 vendor kernels. This family's kernel
+# matches their vermagic (SMP on xm530v200, UP on xm533 and xm535) and exports
+# what those kernels add (clk_get_pts, kthread_set_prio).
+XIONGMAI_OSDRV_XM530V200_FILES = $(XIONGMAI_OSDRV_XM530V200_PKGDIR)/files/$(OPENIPC_SOC_MODEL)
+
+define XIONGMAI_OSDRV_XM530V200_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/3.10.103+/xiongmai
+	$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/3.10.103+/xiongmai $(XIONGMAI_OSDRV_XM530V200_FILES)/kmod/*.ko
Evidence
The package declares no source site or module build step and instead copies the checked-in .ko
files into the image. Its comments and the three loader scripts identify the per-chip module sets as
originating from camera firmware, supporting the finding that the installed binaries are extracted
artifacts rather than modules built by this package.

general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[7-24]
general/package/xiongmai-osdrv-xm530v200/files/xm530v200/load_xiongmai[2-3]
general/package/xiongmai-osdrv-xm530v200/files/xm533/load_xiongmai[2-3]
general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[2-3]
Best Practice: Repository guidelines

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The three images install factory-extracted kernel modules without a traceable, buildable source, preventing reproducible rebuilds for kernel changes.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[7-24]
- general/package/xiongmai-osdrv-xm530v200/files/xm530v200[kmod]
- general/package/xiongmai-osdrv-xm530v200/files/xm533[kmod]
- general/package/xiongmai-osdrv-xm530v200/files/xm535[kmod]
## Recommended Fix
Replace the extracted modules with a traceable, version-pinned OpenIPC-hosted source package or vendor SDK release that builds the required per-chip modules, and integrate that compilation into the package. If buildable source is unavailable, do not ship the extracted `.ko` files until their provenance and rebuild process are established.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. New cameras boot without the SD driver 🐞 Bug ≡ Correctness
Description
XIONGMAI_OSDRV_XM530V200_INSTALL_TARGET_CMDS installs load_xiongmai in /usr/bin but does not
arrange for it to run at boot. On each new image, the SD driver and vendor modules remain unloaded
until someone invokes the script manually, because the boot-time module loader reads only
/etc/modules.
Code

general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[R26-27]

+	$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
+	$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(XIONGMAI_OSDRV_XM530V200_FILES)/load_xiongmai
Evidence
The package only copies the script and modules. The existing boot service reads /etc/modules,
which lists vfat and exfat, while the SD-driver insertion is inside load_xiongmai.

general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[22-28]
general/overlay/etc/init.d/S35modules[4-21]
general/overlay/etc/modules[1-2]
general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[71-75]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The package installs its loader but nothing runs it during normal boot, leaving the SD driver and vendor modules unloaded.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[22-28]
- general/overlay/etc/init.d/S35modules[4-21]
## Recommended Fix
Install a model-specific boot service that invokes the appropriate loader, or otherwise integrate its required module initialization into the boot sequence.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Some XM535 cards use the wrong power pad 🐞 Bug ≡ Correctness
Description
xm535/load_xiongmai defaults SDIO_PDN to 90 although its own board mapping identifies pad 8 for
XM535D2. If sdio_pdn is missing or unreadable in the bootloader environment, the script passes pad
90 to xm_v200_sd on a D2 camera.
Code

general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[R18-19]

+SDIO_PDN=$(fw_printenv -n sdio_pdn 2>/dev/null)
+[ -n "$SDIO_PDN" ] || SDIO_PDN=90
Evidence
The loader explicitly names the D2 pad, assigns a different fallback, and passes that fallback
directly to the SD driver.

general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[16-19]
general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[71-73]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
XM535D2 uses SD power pad 8, but the shared XM535 loader falls back to pad 90 when the bootloader variable is unavailable.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[16-19]
- general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[71-73]
## Recommended Fix
Obtain the power pad from reliable board-specific configuration; do not silently apply the D1 default to D2 when the environment value is absent.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. XM535D2 can receive the wrong memory setup 🐞 Bug ≡ Correctness
Description
xm535/load_xiongmai treats an absent or unreadable totalmem as 64 MiB and uses that value for
both MMZ sizing and PLL selection. On the 128 MiB D2/W2 variants identified in the same script, this
selects the 64 MiB PLL branch and computes the MMZ region from the wrong total.
Code

general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[R9-10]

+MEM_ALL=$(fw_printenv -n totalmem 2>/dev/null | sed 's/[^0-9]//g')
+[ -n "$MEM_ALL" ] || MEM_ALL=64
Evidence
The fallback feeds both the MMZ calculation and the conditional PLL write, which the script labels
as different for the 64 MiB and 128 MiB variants.

general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[6-13]
general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[29-35]
general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[51-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
When `totalmem` is unavailable, the XM535 loader assumes 64 MiB even for 128 MiB D2/W2 boards, affecting MMZ and PLL setup.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[6-13]
- general/package/xiongmai-osdrv-xm530v200/files/xm535/load_xiongmai[29-35]
## Recommended Fix
Require a reliable board-specific RAM value or detect the installed variant before calculating MMZ and selecting PLL registers; fail initialization rather than using a potentially wrong variant.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. License collection lacks its declared file ✓ Resolved
Description
XIONGMAI_OSDRV_XM530V200_LICENSE_FILES names LICENSE, but the new package contains no such file.
A legal-information collection for an image selecting this package cannot copy its declared license
text.
Code

general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[R9-10]

+XIONGMAI_OSDRV_XM530V200_LICENSE = MIT
+XIONGMAI_OSDRV_XM530V200_LICENSE_FILES = LICENSE
Evidence
The makefile declares LICENSE as its license file, but inspection of the added package tree finds
only the package metadata, model-specific loaders, and modules; there is no LICENSE file.

general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[7-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new package declares a LICENSE file that is not present, preventing collection of its declared license text.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[9-10]
## Recommended Fix
Establish the actual licensing terms of the supplied modules and include the corresponding license file, updating LICENSE and LICENSE_FILES to match.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +12 to +24
# The V200 series' vendor modules, one set per chip, from camera firmware
# (OpenIPC/qemu-bench#154):
# xm530v200 X6C-WEQ, V5.04.R02.20241125
# xm533 X3-WQ-B, V5.04.R02.20250828
# xm535 X6E-WEQ (D1), V5.07.X02.20250906; D2 and W1 share its modules
# They are built for their 3.10.103 vendor kernels. This family's kernel
# matches their vermagic (SMP on xm530v200, UP on xm533 and xm535) and exports
# what those kernels add (clk_get_pts, kthread_set_prio).
XIONGMAI_OSDRV_XM530V200_FILES = $(XIONGMAI_OSDRV_XM530V200_PKGDIR)/files/$(OPENIPC_SOC_MODEL)

define XIONGMAI_OSDRV_XM530V200_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/3.10.103+/xiongmai
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/3.10.103+/xiongmai $(XIONGMAI_OSDRV_XM530V200_FILES)/kmod/*.ko

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Future builds cannot reproduce modules 📘 Rule violation ⚙ Maintainability

XIONGMAI_OSDRV_XM530V200_INSTALL_TARGET_CMDS installs precompiled, model-specific .ko files from
the package’s files directories without a source location or compilation step. Because all three
module sets are identified as extracted from camera firmware, the three images depend on binaries
that cannot be traced to a buildable source or rebuilt for a kernel change.
Agent Prompt
## Issue description
The three images install factory-extracted kernel modules without a traceable, buildable source, preventing reproducible rebuilds for kernel changes.

## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530v200/xiongmai-osdrv-xm530v200.mk[7-24]
- general/package/xiongmai-osdrv-xm530v200/files/xm530v200[kmod]
- general/package/xiongmai-osdrv-xm530v200/files/xm533[kmod]
- general/package/xiongmai-osdrv-xm530v200/files/xm535[kmod]

## Recommended Fix
Replace the extracted modules with a traceable, version-pinned OpenIPC-hosted source package or vendor SDK release that builds the required per-chip modules, and integrate that compilation into the package. If buildable source is unavailable, do not ship the extracted `.ko` files until their provenance and rebuild process are established.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Known, and the reason this is a draft: the PR description says so at the top. These modules come from factory firmware dumps, not a vendor SDK release. The way out is an XM530V200 SDK, or open-sourcing them in OpenIPC/openxiongmai as was done for the XM530; maintainers to decide.

…ttings

Xiongmai treats the XM535D1, XM535D2 and XM535W1 as distinct chips, with
one U-Boot and one firmware each. A plain XM535 is a first-generation
part that xm530_lite already serves. So xm535_lite becomes xm535d1_lite,
xm535d2_lite and xm535w1_lite. Each has a kernel config naming its
machine, so ipcinfo and soc= match the OpenIPC U-Boot's image for the
chip. Each also has its own module set and load_xiongmai:
  - xm535d1: the X6E-WEQ's modules; PLLC 444 MHz; 64 MB; SD power pad 90.
  - xm535d2: the X9-WE2Q's modules (the same media modules as the D1);
    PLLC 450 MHz; 128 MB; SD power pad 8.
  - xm535w1: the X2W-WNG's 2024 modules and pll.sh. It loads vi.ko
    (line=0) where the D1/D2 load vpss.ko, and has no SD slot.

That replaces guessing D1 from D2 by the RAM size, which picked the wrong
PLL and power pad whenever totalmem was missing (review on #2709). The
package's licence is PROPRIETARY, not MIT: these are vendor binaries, and
there is no LICENSE file to name.

In qemu-bench, booted through each chip's OpenIPC U-Boot (OpenIPC/u-boot#90),
each chip:
  - reports its own chip in /proc/cpuinfo, ipcinfo and soc;
  - programs its own PLLC;
  - sizes MMZ from its own RAM;
  - loads every module with no unknown symbol or Oops.
On the D1 and D2 the SD card mounts.
xm530v200_lite, xm533_lite, xm535d1_lite, xm535d2_lite and xm535w1_lite
move from UNBUILT_BOARDS to ALL_BOARDS, beside xm530_lite, and
xiongmai-osdrv-xm530v200 leaves NOT_BUILT now that they select it.
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