Environment
- Board: FRDM-IMX93 (i.MX93 11x11)
- BSP: Yocto Scarthgap, linux-imx-6.6.36-2.1.0 (kernel commit 20d9f5efabdd),
MACHINE=imx93frdm, DISTRO=fsl-imx-xwayland
- Sensor: Raspberry Pi Camera Module v2 (Sony IMX219), on the P6 MIPI-CSI connector
- Device tree: stock arch/arm64/boot/dts/freescale/imx93-11x11-frdm-imx219.dtso
Summary
The BSP ships an IMX219 device-tree overlay for this board, and with it the sensor
powers up and is detected correctly on I2C (chip ID at 0x10 reads 0x0219). However,
the V4L2 capture pipeline never delivers frames. Tracing it down, there appear to be
three independent issues in the downstream staging camera drivers. The mainline
sony,imx219 driver follows the modern V4L2 subdev model, whereas the NXP staging
CSI/ISI stack still assumes the older ov5640-style model.
Issue 1 — media graph teardown ("Sensor register failed")
drivers/staging/media/imx/imx8-media-dev.c : mxc_md_create_links() calls
media_entity_call(sensor, link_setup, ...). The mainline imx219 driver does not
implement .link_setup, so the call returns -ENOIOCTLCMD (-515) and is treated as
fatal. The sensor->CSI link is never created and the whole media device is torn down:
mx8-img-md: Registered sensor subdevice: imx219 2-0010 (1)
mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]
mx8-img-md: created link [mxc-mipi-csi2.0] => [mxc_isi.0]
mx8-img-md: subdev_notifier_complete error exit
mxc-md 42800000.bus:camera: Sensor register failed
mxc-md: probe of 42800000.bus:camera failed with error -515
(ov5640 works because ov5640.c provides a no-op .link_setup.)
Issue 2 — streamon aborts ("Call subdev s_power fail!")
drivers/staging/media/imx/imx8-isi-cap.c : mxc_isi_cap_streamon() calls
v4l2_subdev_call(src_sd, core, s_power, 1) and treats failure as fatal. imx219 uses
runtime PM and does not implement the deprecated .s_power, so the call returns
-ENOIOCTLCMD and streaming aborts:
mxc_isi.0: Call subdev s_power fail!
(ov5640 works because ov5640.c provides .s_power.)
Issue 3 — CSI hardcoded to YUV422, cannot parse RAW10 (links up but 0 frames)
drivers/staging/media/imx/dwc-mipi-csi2.c is effectively YUV422-only:
- dwc_csi2h_formats[] lists only SBGGR Bayer codes, not SRGGB (IMX219 is SRGGB10).
find_csi2h_format() therefore fails and the format silently reverts to YUYV.
- dwc_mipi_csi2_set_fmt() never stores csi2h->format, so disp_mix_gasket_config()
sees the default YUYV code.
- dwc_mipi_csi2_param_init() hardcodes ipi_cfg->data_type = DT_YUV422_8.
The CSI then reports the wrong datatype and no frames are captured even though all
links are ENABLED and VIDIOC_STREAMON returns 0:
mxc-mipi-csi2.0: format: 0x2008 <- YUYV; expected 0x300f (SRGGB10)
What made it work for us (for your validation)
After (a) making imx8-media-dev / imx8-isi-cap treat a missing optional op
(-ENOIOCTLCMD from link_setup / s_power) as non-fatal, and (b) teaching
dwc-mipi-csi2 about SRGGB8/10/12 (store the negotiated format and set the IPI
data_type from it), the pipeline comes up correctly:- mxc-mipi-csi2.0: format: 0x300f
imx219 -> mxc-mipi-csi2.0 -> mxc_isi.0 -> /dev/video0
~27 fps, live frames captured.
Fix (a) is sensor-agnostic and would help any modern mainline sensor on this stack;
fix (b) adds RAW Bayer support to the CSI.
Secondary note — module load ordering
On a fresh boot the graph also fails to register because imx8_media_dev runs its
async notifier before the imx219 module is loaded; the video node registers and is
then unregistered. A manual "modprobe -r imx8_media_dev imx219; modprobe imx219;
modprobe imx8_media_dev" rebuilds it. A softdep / load-order hint would make this
work out of the box.
Questions
1. Is IMX219 an officially supported/validated camera on FRDM-IMX93 in this BSP, or
is the intended/validated path the AP1302 ISP module? The shipped imx219.dtso
suggests bare-IMX219 is meant to work.
2. Are the three behaviors above considered bugs you would accept fixes for, or is
there a recommended/known-good configuration we are missing?
3. If useful, I am happy to share the patches as clean commits.
Thanks!
FRDM-i.MX93 #IMX219 RPI-CAM-MIPI
Hello,
Thank you for reaching out, I will check with software team and will double check if there is some fix in later BSP about this, will update as soon as possible.
Best regards/Saludos,
Aldo.