Hello,
I would be interested to know if you have got the imx708 Camera running.
I am also trying to get the camera running, unfortunately with no success.
I am using the sensor driver from the RPI kernel.
I have defined the following nodes in the devicetree:
&lpi2c2 {
clock-frequency = <400000>;
imx708: camera-sensor@1a {
compatible = "sony,imx708";
reg = <0x1a>;
clocks = <&clk IMX93_CLK_24M>;
clock-names = "inclk";
assigned-clocks = <&clk IMX93_CLK_CAM_PIX>,
<&clk IMX93_CLK_MIPI_PHY_CFG>;
assigned-clock-parents = <&clk IMX93_CLK_VIDEO_PLL>,
<&clk IMX93_CLK_24M>;
assigned-clock-rates = <140000000>, <24000000>;
reset-gpios = <&expander 14 GPIO_ACTIVE_HIGH>;
port {
imx708_ep: endpoint {
remote-endpoint = <&csi_ep>;
data-lanes = <1 2>;
clock-noncontinuous;
link-frequencies = /bits/ 64 <450000000>;
};
};
};
};
&cameradev {
status = "okay";
};
&isi_0 {
status = "okay";
cap_device {
status = "okay";
};
};
&mipi_csi {
status = "okay";
port {
csi_ep: endpoint {
remote-endpoint = <&imx708_ep>;
data-lanes = <2>;
cfg-clk-range = <28>;
hs-clk-range = <0x29>;
bus-type = <4>;
};
};
};
The sensor driver is also successfully probed:
[ 1.905972] imx708 1-001a: supply vana1 not found, using dummy regulator
[ 1.911470] imx708 1-001a: supply vana2 not found, using dummy regulator
[ 1.916901] imx708 1-001a: supply vdig not found, using dummy regulator
[ 1.922229] imx708 1-001a: supply vddl not found, using dummy regulator
[ 1.937442] imx708 1-001a: camera module ID 0x0301
Missing function definitions had to be added to the sensor driver so that a link between ISI -> Mipi-CSI -> and sensor device can be established:
diff --git a/drivers/media/i2c/imx708.c b/drivers/media/i2c/imx708.c
index 29b1d4479c..17f5877487 100644
--- a/drivers/media/i2c/imx708.c
+++ b/drivers/media/i2c/imx708.c
@@ -6,6 +6,8 @@
* Based on Sony imx477 camera driver
* Copyright (C) 2020 Raspberry Pi Ltd
*/
+
+#define DEBUG 1
#include <asm/unaligned.h>
#include <linux/clk.h>
#include <linux/delay.h>
@@ -1752,9 +1754,15 @@ static int imx708_identify_module(struct imx708 *imx708)
return 0;
}
+static int imx708_s_power(struct v4l2_subdev *sd, int on)
+{
+ return 0;
+}
+
static const struct v4l2_subdev_core_ops imx708_core_ops = {
.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
.unsubscribe_event = v4l2_event_subdev_unsubscribe,
+ .s_power = imx708_s_power,
};
static const struct v4l2_subdev_video_ops imx708_video_ops = {
@@ -1972,6 +1980,18 @@ static int imx708_check_hwcfg(struct device *dev, struct imx708 *imx708)
return ret;
}
+
+static int imx708_link_setup(struct media_entity *entity,
+ const struct media_pad *local,
+ const struct media_pad *remote, u32 flags)
+{
+ return 0;
+}
+
+static const struct media_entity_operations imx708_sd_media_ops = {
+ .link_setup = imx708_link_setup,
+};
+
static int imx708_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
@@ -2038,6 +2058,7 @@ static int imx708_probe(struct i2c_client *client)
imx708->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
V4L2_SUBDEV_FL_HAS_EVENTS;
imx708->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
+ imx708->sd.entity.ops = &imx708_sd_media_ops;
/* Initialize source pads */
imx708->pad[IMAGE_PAD].flags = MEDIA_PAD_FL_SOURCE;
The media driver reports this when booting:
[ 2.337659] mxc-md 42800000.bus:camera: subdev_notifier_complete
[ 2.337664] mxc-md 42800000.bus:camera: mxc_isi.0 entity is found
[ 2.337668] mxc-md 42800000.bus:camera: mxc_isi.0.capture entity is found
[ 2.337673] mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]
[ 2.342989] mxc-md 42800000.bus:camera: mxc_isi.0 entity is found
[ 2.342994] mxc-md 42800000.bus:camera: mxc-mipi-csi2.0 entity is found
[ 2.342999] mx8-img-md: created link [mxc-mipi-csi2.0] => [mxc_isi.0]
[ 2.348128] mxc-md 42800000.bus:camera: mxc-mipi-csi2.0 entity is found
[ 2.348133] mx8-img-md: created link [imx708] => [mxc-mipi-csi2.0]
[ 2.353009] mxc-md 42800000.bus:camera: mxc_md_create_links
The device nodes /dev/video0 and /dev/media0 were also created.
however, as soon as i try to get an image with gst-launch and v4l2src, the pipeline is cancelled.
The cause becomes clear through dmesg:
mxc_isi.0: set remote fmt fail!
A set_fmt() function of the src device is called in the mxc_isi driver. In this case, the set_fmt function of the mxc-mipi-csi2 driver. This returns -EINVAL when called.
I would be interested to know which changes are still necessary.