Part Number: TDA4VM
Dear Forum,
we are trying to capture DisplayPort Video with a BeagleBone AI-64 using a Lontium LT7911D DP-to-CSI bridge.
Sadly, this only works sometimes and only for one or a few frames, then the capture stalls.
For testing, we attached the same Test-PCB with the Lontium chip to a Raspberry Pi 5 and using the same driver, there the capture works as expected. So probably I (or the driver) am configuring something wrong.
As the vanilla Linux Kernel does not come with a driver for the LT7911D, I ported one found on the Internet (https://gitlabhost.argos-navy.ru/rockchip/rongpin/rk3588_android12/-/blob/master/kernel-5.10/drivers/media/i2c/lt7911d.c) and modified it a bit. The current version is attached, as well as the Device Tree used.
Originally, the driver did not start/stop the CSI stream. As I found multiple posts that said the output should only start after the capture is ready, I modified the driver to actually do something in s_stream. However, this did also not change the problem. Sadly, I have no description of the "inner workings" of the LT7911D (e.g. register description, firmware, ...) and the datasheet I have does not have sufficient detail. I do know that the firmware running had the filename "LT7911d_dp_to_1port-mipi-csi_1920x1080@60hz_YUV422_20250728_(CKS0x1D8C8E).hex" and this is also the resolution reported:
[ 73.892942] m_LT7911D 7-002b: act:1920x1080, total:2200x1125, pixclk:148364000, fps:60[ 73.900861] m_LT7911D 7-002b: hfp:88, hs:44, hbp:148, vfp:4, vs:5, vbp:36[ 73.907639] m_LT7911D 7-002b: inerlaced:0,
I use the following commands to prepare and execute the capture (I added more debug print statements to some of the drivers involved):
# v4l2-ctl -d /dev/v4l-subdev1 --set-dv-bt-timings queryBT timings set# media-ctl -d 0 --set-v4l2 '"cdns_csi2rx.4504000.csi-bridge":0[fmt:UYVY8_1X16/1920x1080 colorspace:srgb]'# v4l2-ctl -v width=1920,height=1080,pixelformat=UYVY# v4l2-ctl --device /dev/video0 --set-fmt-video width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-to=frame.raw --stream-count=10[ 59.778963] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dmaengine_prep_slave_single, addr = 0xfe600000, len = 0x3f4800[ 59.790337] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dma_async_issue_pending[ 59.799256] m_LT7911D 7-002b: enable_stream: enable
Here, the capture hung without recording anything. When it works, it looks like this:
# v4l2-ctl --device /dev/video0 --set-fmt-video width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-to=frame.raw --stream-count=1[ 5523.619795] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dmaengine_prep_slave_single, addr = 0xfe600000, len = 0x3f4800[ 5523.631169] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dma_async_issue_pending[ 5523.639805] m_LT7911D 7-002b: enable_stream: enable[ 5523.662342] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_dma_callback[ 5523.668429] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dmaengine_prep_slave_single, addr = 0xfea00000, len = 0x3f4800[ 5523.679807] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dma_async_issue_pending[ 5523.687798] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dmaengine_prep_slave_single, addr = 0xfee00000, len = 0x3f4800[ 5523.699163] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dma_async_issue_pending[ 5523.707144] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dmaengine_prep_slave_single, addr = 0xff200000, len = 0x3f4800[ 5523.718508] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dma_async_issue_pending<[ 5523.726626] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_dma_callback[ 5523.732795] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dmaengine_prep_slave_single, addr = 0xfe600000, len = 0x3f4800[ 5523.744162] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_start_dma: dma_async_issue_pending[ 5523.752267] m_LT7911D 7-002b: enable_stream: disable[ 5523.757761] j721e-csi2rx 4500000.ticsi2rx: ti_csi2rx_stop_dma
I also examined lots of CSI/D-PHY related registers, while the capture was active and hung:
CSIRX:CSI_RX_IF_VBUS2APB_ERROR_DEBUG devmem 0x04504074 0x00000000CSI_RX_IF_VBUS2APB_ERROR_IRQS devmem 0x04504028 0x00000100CSI_RX_IF_VBUS2APB_DPHY_STATUS devmem 0x04504048 0x00222206 / 0x00333306 / 0x00333307CSI_RX_IF_VBUS2APB_INTEGRATION_DEBUG devmem 0x04504060 0x10000000CSI_RX_IF_VBUS2APB_STREAM0_STATUS devmem 0x04504104 0x80000113CSI_RX_IF_VBUS2APB_STREAM0_DATA_CFG devmem 0x04504108 0x00010000CSI_RX_IF_VBUS2APB_STREAM0_CFG devmem 0x0450410c 0x00000100
DPHY:DPHY_RX_VBUS2APB_DL0_RX_DIG_TBIT33 devmem 0x04580290 0x0003D0B8DPHY_RX_VBUS2APB_DL0_RX_DIG_TBIT34 devmem 0x04580294 0x00008000DPHY_RX_VBUS2APB_DL0_RX_DIG_TBIT42 devmem 0x045802b4 0x00400800DPHY_RX_VBUS2APB_DL0_RX_DIG_TBIT43 devmem 0x045802b8 0x00010020DPHY_RX_VBUS2APB_PCS_TX_DIG_TBIT0 devmem 0x04580b00 0x0000016BDPHY_RX_VBUS2APB_ISO_PHY_ISO_DL_HS_L0 devmem 0x04580c18 0x00000002 / 0x00000080 / 0x00000000 / 0x00000020 / 0x000000ECDPHY_RX_VBUS2APB_ISO_PHY_ISO_DL_HS_L1 devmem 0x04580c24 0x000000FFDPHY_RX_VBUS2APB_ISO_LDD_PHY_ISO_DL_HS_L2 devmem 0x04580c34 0x0000007FDPHY_RX_VBUS2APB_ISO_LDD_PHY_ISO_DL_HS_L3 devmem 0x04580c40 0x000000D5
Rows with multiple values show where the value changed when calling devmem again.
I also attached a full kernel log of the board booting, then attaching a Display Port output and trying to capture (which hung), then cancelling the capture ~18 seconds later (Ctrl + C).
I hope you can guide me in a direction for further debugging, as I am getting out of ideas... Thank you!
Kind regards,
Stefan Krupop
