Other Parts Discussed in Thread: AM68
We're assessing the AM68 for creating a smart camera and so would be using sensors other than the two currently supported by the SK-AM68.
We're new to low level kernel work, hardware integration and device trees so there's a somewhat steep learning curve.
I've been supplied with v3 of the rpi camera module (IMX708) and so have been attempting to enable it for the devkit:
- Copied across the imx708 i2c source from the raspberrypi project to the ti sdk kernel source tree (drivers/media/i2c/imx708.c)
- Updated the i2c Kconfig with a section for the imx708 (drivers/media/i2c/Kconfig)
- Added the module to the Makefile (drivers/media/i2c/Makefile)
- Added an empty file at include/config/VIDEO_IMX708
- Added `CONFIG_VIDEO_IMX708=m` to arch/arm64/configs/defconfig
- Added `CONFIG_VIDEO_IMX708=m` to arch/arm/configs/sama7_defconfig
- Created a `k3-am68-sk-bb-rpi-cam-imx708.dtso` at arch/arm64/boot/dts/ti/ based on the supplied one for the imx219 (attached below)
I then built the kernel and deployed to the SD card, then modified the uEnv.txt on the boot partition with
name_overlays=ti/k3-j721s2-edgeai-apps.dtbo ti/k3-am68-sk-bb-rpi-cam-imx708.dtbo
So the devkit now looks like it can see the camera
root@am68a-sk:/opt/edgeai-gst-apps# media-ctl -d /dev/media0 -p
...
- entity 17: imx708 (2 pads, 1 link, 0 route)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev2
pad0: Source
[stream:0 fmt:SRGGB10_1X10/4608x2592 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range
crop.bounds:(16,24)/4608x2592
crop:(16,24)/4608x2592]
-> "cdns_csi2rx.4504000.csi-bridge":0 [ENABLED,IMMUTABLE]
pad1: Source
[stream:0 fmt:unknown/28800x1 field:none
crop.bounds:(16,24)/4608x2592
crop:(16,24)/4608x2592]
...
root@am68a-sk:/opt/edgeai-gst-apps# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes
ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0,stream=0)
0x300f: MEDIA_BUS_FMT_SRGGB10_1X10
root@am68a-sk:/opt/edgeai-gst-apps# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0,code=0x300f
ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0,stream=0)
Size Range: 4608x2592 - 4608x2592
Size Range: 2304x1296 - 2304x1296
Size Range: 1536x864 - 1536x864
However all of the format information originates from the imx708 i2c kernel module and is not read from the sensor itself - during boot there is a kernel log message which suggests that the i2c is not working.
[ 5.477570] imx708 5-001a: failed to read chip id 708, with error -5
I assume this is due to a problem with my dtso file?
There are also some errors relating to the supply voltages from the kernel module
[ 5.332492] imx708 4-0010: supply vana1 not found, using dummy regulator
[ 5.421415] imx708 4-0010: supply vana2 not found, using dummy regulator
[ 5.445335] imx708 4-0010: supply vdig not found, using dummy regulator
[ 5.485090] imx708 4-0010: supply vddl not found, using dummy regulator
When I attempt to start streaming from the device the kernel logs show
[ 3980.377812] cdns-csi2rx 4504000.csi-bridge: Failed to start streams 0x1 on subdev
[ 3980.395394] cdns-csi2rx 4504000.csi-bridge: Failed to stop stream0
[ 3980.411592] cdns-csi2rx 4504000.csi-bridge: Failed to stop stream1
[ 3980.427812] cdns-csi2rx 4504000.csi-bridge: Failed to stop stream2
[ 3980.443997] cdns-csi2rx 4504000.csi-bridge: Failed to stop stream3
Any suggestions or links to relevant documentation would be much appreciated.